diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java b/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java index e8381491d..f18df1bc3 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/controller/JT1078Controller.java @@ -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> 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> 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 wvpResult = new WVPResult<>(); if (code == InviteErrorCode.SUCCESS.getCode()) { wvpResult.setCode(ErrorCode.SUCCESS.getCode()); diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java index 4056896cd..b52256a88 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/Ijt1078Service.java @@ -21,7 +21,7 @@ public interface Ijt1078Service { void updateDeviceStatus(boolean connected, String terminalId); - void play(String deviceId, String channelId, GeneralCallback callback); + void play(String deviceId, String channelId, int type, GeneralCallback callback); void playback(String deviceId, String channelId, String startTime, String endTime, GeneralCallback callback); diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java index 435cb1203..0af1713b0 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/jt1078ServiceImpl.java @@ -113,7 +113,7 @@ public class jt1078ServiceImpl implements Ijt1078Service { private final Map>> inviteErrorCallbackMap = new ConcurrentHashMap<>(); @Override - public void play(String deviceId, String channelId, GeneralCallback callback) { + public void play(String deviceId, String channelId, int type, GeneralCallback 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);