From b63a89a0a83dfddab0d714bb9aad90114ab9d514 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 18 Aug 2023 14:06:39 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8F=91=E6=B5=81?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/genersoft/iot/vmp/vmanager/ps/PsController.java | 2 -- .../java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/ps/PsController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/ps/PsController.java index 045480ac..bed8f9ce 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/ps/PsController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/ps/PsController.java @@ -221,8 +221,6 @@ public class PsController { String is_Udp = isUdp ? "1" : "0"; param.put("is_udp", is_Udp); param.put("src_port", sendInfo.getSendLocalPort()); - param.put("use_ps", "0"); - param.put("only_audio", "1"); Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, app, stream); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java index ba4473f8..3b4fa3bf 100644 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java @@ -246,7 +246,6 @@ public class RtpController { String is_Udp = isUdp ? "1" : "0"; paramForAudio.put("is_udp", is_Udp); paramForAudio.put("src_port", sendInfo.getSendLocalPortForAudio()); - paramForAudio.put("use_ps", "0"); paramForAudio.put("only_audio", "1"); if (ptForAudio != null) { paramForAudio.put("pt", ptForAudio); @@ -267,7 +266,6 @@ public class RtpController { String is_Udp = isUdp ? "1" : "0"; paramForVideo.put("is_udp", is_Udp); paramForVideo.put("src_port", sendInfo.getSendLocalPortForVideo()); - paramForVideo.put("use_ps", "0"); paramForVideo.put("only_audio", "0"); if (ptForVideo != null) { paramForVideo.put("pt", ptForVideo); From 23ce55260fdb9277cd72987c1e6a3d4e058f3bb4 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 25 Aug 2023 08:51:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E7=82=B9=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/impl/InviteRequestProcessor.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java index 073720aa..89381d90 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java @@ -1,6 +1,7 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; import com.alibaba.fastjson2.JSONObject; +import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.bean.*; @@ -454,21 +455,17 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements }); } else { sendRtpItem.setPlayType(InviteStreamType.PLAY); - SsrcTransaction playTransaction = sessionManager.getSsrcTransaction(device.getDeviceId(), channelId, "play", null); - if (playTransaction != null) { - Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, "rtp", playTransaction.getStream()); +// SsrcTransaction playTransaction = sessionManager.getSsrcTransaction(device.getDeviceId(), channelId, "play", null); + StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channelId); + if (streamInfo != null) { + Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, streamInfo.getApp(), streamInfo.getStream()); if (!streamReady) { - boolean hasRtpServer = mediaServerService.checkRtpServer(mediaServerItem, "rtp", playTransaction.getStream()); - if (hasRtpServer) { - logger.info("[上级点播]已经开启rtpServer但是尚未收到流,开启监听流的到来"); - HookSubscribeForStreamChange hookSubscribe = HookSubscribeFactory.on_stream_changed("rtp", playTransaction.getStream(), true, "rtsp", mediaServerItem.getId()); - zlmHttpHookSubscribe.addSubscribe(hookSubscribe, hookEvent); - }else { - playTransaction = null; - } + redisCatchStorage.stopPlay(streamInfo); + storager.stopPlay(streamInfo.getDeviceID(), streamInfo.getChannelId()); + streamInfo = null; } } - if (playTransaction == null) { + if (streamInfo == null) { String streamId = null; if (mediaServerItem.isRtpEnable()) { streamId = String.format("%s_%s", device.getDeviceId(), channelId); @@ -488,7 +485,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements } else { // 当前系统作为下级平台使用,当上级平台点播时不携带ssrc时,并且设备在当前系统中已经点播了。这个时候需要重新给生成一个ssrc,不使用默认的"0000000000"。 sendRtpItem.setSsrc(ssrc); - sendRtpItem.setStreamId(playTransaction.getStream()); + sendRtpItem.setStreamId(streamInfo.getStream()); // 写入redis, 超时时回复 redisCatchStorage.updateSendRTPSever(sendRtpItem); JSONObject jsonObject = new JSONObject();