1078-点播添加类型

This commit is contained in:
648540858
2024-05-28 18:58:16 +08:00
parent 37b79633f0
commit 9ece77d54a
3 changed files with 10 additions and 5 deletions

View File

@@ -61,10 +61,15 @@ public class JT1078Controller {
@Operation(summary = "1078-开始点播", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "deviceId", description = "设备国标编号", required = true)
@Parameter(name = "channelId", description = "通道国标编号, 一般为从1开始的数字", required = true)
@Parameter(name = "type", description = "类型0:音视频,1:视频,2:音频", required = true)
@GetMapping("/live/start")
public DeferredResult<WVPResult<StreamContent>> startLive(HttpServletRequest request,
@Parameter(required = true) String deviceId,
@Parameter(required = false) String channelId) {
@Parameter(required = false) String channelId,
@Parameter(required = false) Integer type) {
if (type == null || (type != 0 && type != 1 && type != 2)) {
type = 0;
}
DeferredResult<WVPResult<StreamContent>> result = new DeferredResult<>(userSetting.getPlayTimeout().longValue());
if (ObjectUtils.isEmpty(channelId)) {
channelId = "1";
@@ -80,7 +85,7 @@ public class JT1078Controller {
service.stopPlay(deviceId, finalChannelId);
});
service.play(deviceId, channelId, (code, msg, streamInfo) -> {
service.play(deviceId, channelId, type, (code, msg, streamInfo) -> {
WVPResult<StreamContent> wvpResult = new WVPResult<>();
if (code == InviteErrorCode.SUCCESS.getCode()) {
wvpResult.setCode(ErrorCode.SUCCESS.getCode());

View File

@@ -21,7 +21,7 @@ public interface Ijt1078Service {
void updateDeviceStatus(boolean connected, String terminalId);
void play(String deviceId, String channelId, GeneralCallback<StreamInfo> callback);
void play(String deviceId, String channelId, int type, GeneralCallback<StreamInfo> callback);
void playback(String deviceId, String channelId, String startTime, String endTime, GeneralCallback<StreamInfo> callback);

View File

@@ -113,7 +113,7 @@ public class jt1078ServiceImpl implements Ijt1078Service {
private final Map<String, List<GeneralCallback<StreamInfo>>> inviteErrorCallbackMap = new ConcurrentHashMap<>();
@Override
public void play(String deviceId, String channelId, GeneralCallback<StreamInfo> callback) {
public void play(String deviceId, String channelId, int type, GeneralCallback<StreamInfo> callback) {
// 检查流是否已经存在,存在则返回
String playKey = VideoManagerConstants.INVITE_INFO_1078_PLAY + deviceId + ":" + channelId;
@@ -180,7 +180,7 @@ public class jt1078ServiceImpl implements Ijt1078Service {
j9101.setRate(1);
j9101.setTcpPort(ssrcInfo.getPort());
j9101.setUdpPort(ssrcInfo.getPort());
j9101.setType(0);
j9101.setType(type);
Object s = jt1078Template.startLive(deviceId, j9101, 6);
System.out.println("ssss=== " + s);