From 674ab18c028eb8d9520f4b4f77f282aad303439f Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 12 Jan 2024 15:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drtp=E6=9A=82=E5=81=9C?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E8=B0=83=E7=94=A8=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/service/impl/InviteStreamServiceImpl.java | 3 +++ .../iot/vmp/service/impl/PlayServiceImpl.java | 14 ++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java index faaefab6..fb2623d5 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java @@ -116,6 +116,9 @@ public class InviteStreamServiceImpl implements IInviteStreamService { ":" + (stream != null ? stream : "*") + ":*"; List scanResult = RedisUtil.scan(redisTemplate, key); + if (scanResult.isEmpty()) { + return null; + } if (scanResult.size() != 1) { logger.warn("[获取InviteInfo] 发现 key: {}存在多条", key); } 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 9012c298..8f0a23f9 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java @@ -955,8 +955,11 @@ public class PlayServiceImpl implements IPlayService { } // zlm 暂停RTP超时检查 // 使用zlm中的流ID - String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase(); - JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, ssrc); + String streamKey = inviteInfo.getStream(); + if (!mediaServerItem.isRtpEnable()) { + streamKey = Long.toHexString(Long.parseLong(inviteInfo.getSsrcInfo().getSsrc())).toUpperCase(); + } + JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, streamKey); if (jsonObject == null || jsonObject.getInteger("code") != 0) { throw new ServiceException("暂停RTP接收失败"); } @@ -980,8 +983,11 @@ public class PlayServiceImpl implements IPlayService { } // zlm 暂停RTP超时检查 // 使用zlm中的流ID - String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase(); - JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, ssrc); + String streamKey = inviteInfo.getStream(); + if (!mediaServerItem.isRtpEnable()) { + streamKey = Long.toHexString(Long.parseLong(inviteInfo.getSsrcInfo().getSsrc())).toUpperCase(); + } + JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, streamKey); if (jsonObject == null || jsonObject.getInteger("code") != 0) { throw new ServiceException("继续RTP接收失败"); }