From 670d18f688548e5188715ea4a8c02a7b6213f42b Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 18 Oct 2021 17:31:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E5=88=AB=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../callback/DeferredResultHolder.java | 3 ++- .../iot/vmp/service/impl/PlayServiceImpl.java | 18 +++++++++--------- .../vmanager/gb28181/play/PlayController.java | 4 ++-- .../gb28181/playback/DownloadController.java | 8 ++++---- .../gb28181/playback/PlaybackController.java | 8 ++++---- .../iot/vmp/web/ApiDeviceController.java | 2 -- web_src/src/components/dialog/jessibuca.vue | 1 + 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/callback/DeferredResultHolder.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/callback/DeferredResultHolder.java index f21895c4..e6a7e414 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/callback/DeferredResultHolder.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/callback/DeferredResultHolder.java @@ -31,7 +31,7 @@ public class DeferredResultHolder { public static final String CALLBACK_CMD_RECORDINFO = "CALLBACK_RECORDINFO"; - public static final String CALLBACK_CMD_PlAY = "CALLBACK_PLAY"; + public static final String CALLBACK_CMD_PLAY = "CALLBACK_PLAY"; public static final String CALLBACK_CMD_STOP = "CALLBACK_STOP"; @@ -47,6 +47,7 @@ public class DeferredResultHolder { private Map map = new ConcurrentHashMap(); + public void put(String key, DeferredResult result) { map.put(key, result); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java index fea31233..057025b2 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -80,7 +80,7 @@ public class PlayServiceImpl implements IPlayService { PlayResult playResult = new PlayResult(); if (mediaServerItem == null) { RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + playResult.getUuid()); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + playResult.getUuid()); WVPResult wvpResult = new WVPResult(); wvpResult.setCode(-1); wvpResult.setMsg("未找到可用的zlm"); @@ -96,12 +96,12 @@ public class PlayServiceImpl implements IPlayService { DeferredResult> result = new DeferredResult>(userSetup.getPlayTimeout()); playResult.setResult(result); // 录像查询以channelId作为deviceId查询 - resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid, result); + resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid, result); // 超时处理 result.onTimeout(()->{ logger.warn(String.format("设备点播超时,deviceId:%s ,channelId:%s", deviceId, channelId)); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + playResult.getUuid()); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + playResult.getUuid()); WVPResult wvpResult = new WVPResult(); wvpResult.setCode(-1); SIPDialog dialog = streamSession.getDialog(deviceId, channelId); @@ -170,7 +170,7 @@ public class PlayServiceImpl implements IPlayService { }, (event) -> { // 点播返回sip错误 RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); Response response = event.getResponse(); mediaServerService.closeRTPServer(playResult.getDevice(), channelId); WVPResult wvpResult = new WVPResult(); @@ -187,7 +187,7 @@ public class PlayServiceImpl implements IPlayService { String streamId = streamInfo.getStreamId(); if (streamId == null) { RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); WVPResult wvpResult = new WVPResult(); wvpResult.setCode(-1); wvpResult.setMsg(String.format("点播失败, redis缓存streamId等于null")); @@ -201,7 +201,7 @@ public class PlayServiceImpl implements IPlayService { JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaInfo, streamId); if (rtpInfo != null && rtpInfo.getBoolean("exist")) { RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); WVPResult wvpResult = new WVPResult(); wvpResult.setCode(0); @@ -230,7 +230,7 @@ public class PlayServiceImpl implements IPlayService { }, (event) -> { mediaServerService.closeRTPServer(playResult.getDevice(), channelId); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); Response response = event.getResponse(); WVPResult wvpResult = new WVPResult(); @@ -248,7 +248,7 @@ public class PlayServiceImpl implements IPlayService { @Override public void onPublishHandlerForPlay(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid) { RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); StreamInfo streamInfo = onPublishHandler(mediaServerItem, resonse, deviceId, channelId, uuid); if (streamInfo != null) { DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId); @@ -292,7 +292,7 @@ public class PlayServiceImpl implements IPlayService { @Override public void onPublishHandlerForPlayBack(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid) { RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); StreamInfo streamInfo = onPublishHandler(mediaServerItem, resonse, deviceId, channelId, uuid); if (streamInfo != null) { redisCatchStorage.startPlayback(streamInfo); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java index 911f2133..fb31fa06 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java @@ -134,13 +134,13 @@ public class PlayController { json.put("deviceId", deviceId); json.put("channelId", channelId); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData(json.toString()); resultHolder.invokeResult(msg); } else { logger.warn("设备预览/回放停止API调用失败!"); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData("streamId null"); resultHolder.invokeResult(msg); } diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/DownloadController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/DownloadController.java index d963c315..5b244e6c 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/DownloadController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/DownloadController.java @@ -82,7 +82,7 @@ public class DownloadController { result.onTimeout(()->{ logger.warn(String.format("设备下载响应超时,deviceId:%s ,channelId:%s", deviceId, channelId)); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData("Timeout"); resultHolder.invokeResult(msg); }); @@ -92,12 +92,12 @@ public class DownloadController { // 停止之前的下载 cmder.streamByeCmd(deviceId, channelId); } - resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid, result); + resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid, result); MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device); if (newMediaServerItem == null) { logger.warn(String.format("设备下载响应超时,deviceId:%s ,channelId:%s", deviceId, channelId)); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData("Timeout"); resultHolder.invokeResult(msg); return result; @@ -111,7 +111,7 @@ public class DownloadController { }, event -> { Response response = event.getResponse(); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase())); resultHolder.invokeResult(msg); }); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java index 511ce85c..30bca1d6 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/playback/PlaybackController.java @@ -91,7 +91,7 @@ public class PlaybackController { result.onTimeout(()->{ logger.warn(String.format("设备回放超时,deviceId:%s ,channelId:%s", deviceId, channelId)); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData("Timeout"); resultHolder.invokeResult(msg); }); @@ -101,12 +101,12 @@ public class PlaybackController { // 停止之前的回放 cmder.streamByeCmd(deviceId, channelId); } - resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid, result); + resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid, result); if (newMediaServerItem == null) { logger.warn(String.format("设备回放超时,deviceId:%s ,channelId:%s", deviceId, channelId)); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData("Timeout"); resultHolder.invokeResult(msg); return result; @@ -118,7 +118,7 @@ public class PlaybackController { }, event -> { Response response = event.getResponse(); RequestMessage msg = new RequestMessage(); - msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid); + msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid); msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase())); resultHolder.invokeResult(msg); }); diff --git a/src/main/java/com/genersoft/iot/vmp/web/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/ApiDeviceController.java index 264f2b2f..764a6542 100644 --- a/src/main/java/com/genersoft/iot/vmp/web/ApiDeviceController.java +++ b/src/main/java/com/genersoft/iot/vmp/web/ApiDeviceController.java @@ -53,8 +53,6 @@ public class ApiDeviceController { if (logger.isDebugEnabled()) { logger.debug("查询所有视频设备API调用"); } - - logger.debug("查询所有视频设备API调用"); JSONObject result = new JSONObject(); List devices; if (start == null || limit ==null) { diff --git a/web_src/src/components/dialog/jessibuca.vue b/web_src/src/components/dialog/jessibuca.vue index dabd3889..7e9e0097 100644 --- a/web_src/src/components/dialog/jessibuca.vue +++ b/web_src/src/components/dialog/jessibuca.vue @@ -80,6 +80,7 @@ export default { container: this.$refs.container, videoBuffer: 0.5, // 最大缓冲时长,单位秒 isResize: true, + isFlv: true, decoder: "./static/js/jessibuca/index.js", // text: "WVP-PRO", // background: "bg.jpg",