From ab13017117b18427bb5ee687c9a1b3fd5a94f2ae Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Tue, 20 Apr 2021 17:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/impl/ByeRequestProcessor.java | 1 + .../vmp/media/zlm/ZLMHttpHookListener.java | 21 ++++++++++--------- .../src/components/dialog/StreamProxyEdit.vue | 10 ++++----- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java index ec136e99..5fe10b6b 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/request/impl/ByeRequestProcessor.java @@ -48,6 +48,7 @@ public class ByeRequestProcessor extends SIPRequestAbstractProcessor { String platformGbId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(FromHeader.NAME)).getAddress().getURI()).getUser(); String channelId = ((SipURI) ((HeaderAddress) evt.getRequest().getHeader(ToHeader.NAME)).getAddress().getURI()).getUser(); SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(platformGbId, channelId); + if (sendRtpItem == null) return; String streamId = sendRtpItem.getStreamId(); Map param = new HashMap<>(); param.put("vhost","__defaultVhost__"); diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index 183a5441..cf1ce4cd 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -295,25 +295,26 @@ public class ZLMHttpHookListener { String streamId = json.getString("stream"); String app = json.getString("app"); - StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); - if ("rtp".equals(app)){ JSONObject ret = new JSONObject(); ret.put("code", 0); ret.put("close", true); - if (streamInfo != null) { - if (redisCatchStorage.isChannelSendingRTP(streamInfo.getChannelId())) { + StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(streamId); + if (streamInfoForPlayCatch != null) { + if (redisCatchStorage.isChannelSendingRTP(streamInfoForPlayCatch.getChannelId())) { ret.put("close", false); } else { - cmder.streamByeCmd(streamInfo.getDeviceID(), streamInfo.getChannelId()); - redisCatchStorage.stopPlay(streamInfo); - storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); + cmder.streamByeCmd(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId()); + redisCatchStorage.stopPlay(streamInfoForPlayCatch); + storager.stopPlay(streamInfoForPlayCatch.getDeviceID(), streamInfoForPlayCatch.getChannelId()); } }else{ - cmder.streamByeCmd(streamInfo.getDeviceID(), streamInfo.getChannelId()); - streamInfo = redisCatchStorage.queryPlaybackByStreamId(streamId); - redisCatchStorage.stopPlayback(streamInfo); + StreamInfo streamInfoForPlayBackCatch = redisCatchStorage.queryPlaybackByStreamId(streamId); + if (streamInfoForPlayBackCatch != null) { + cmder.streamByeCmd(streamInfoForPlayBackCatch.getDeviceID(), streamInfoForPlayBackCatch.getChannelId()); + redisCatchStorage.stopPlayback(streamInfoForPlayBackCatch); + } } return new ResponseEntity(ret.toString(),HttpStatus.OK); }else { diff --git a/web_src/src/components/dialog/StreamProxyEdit.vue b/web_src/src/components/dialog/StreamProxyEdit.vue index b0ea10ec..d849ec6a 100644 --- a/web_src/src/components/dialog/StreamProxyEdit.vue +++ b/web_src/src/components/dialog/StreamProxyEdit.vue @@ -62,14 +62,14 @@ - +
{{onSubmit_text}} 取消
- +
@@ -110,7 +110,7 @@ export default { type: "default", app: null, stream: null, - url: "rtmp://58.200.131.2:1935/livetv/hunantv", + url: "rtmp://58.200.131.2/livetv/cctv5hd", src_url: null, timeout_ms: null, ffmpeg_cmd_key: null, @@ -120,7 +120,7 @@ export default { enable_hls: true, enable_mp4: false, }, - + rules: { name: [{ required: true, message: "请输入名称", trigger: "blur" }], app: [{ required: true, message: "请输入应用名", trigger: "blur" }], @@ -148,7 +148,7 @@ export default { var that = this; that.$axios({ method: 'post', - url:`/api/proxy/save`, + url:`/api/proxy/save`, data: that.proxyParam }).then(function (res) { console.log(res);