Sfoglia il codice sorgente

Merge pull request #1242 from criver31/wvp-28181-2.0

1、修复zlm重连不在线  2、单端口下历史回放暂停和恢复发送的流ID与zlm不一致
648540858 2 anni fa
parent
commit
41c7137e3a

+ 1 - 0
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java

@@ -699,6 +699,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
             ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null);
             String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItem.getId();
             redisTemplate.opsForValue().set(key, mediaServerItem);
+            resetOnlineServerItem(mediaServerItem);
             clearRTPServer(mediaServerItem);
         }
         final String zlmKeepaliveKey = zlmKeepaliveKeyPrefix + mediaServerItem.getId();

+ 6 - 2
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java

@@ -954,7 +954,9 @@ public class PlayServiceImpl implements IPlayService {
             throw new ServiceException("mediaServer不存在");
         }
         // zlm 暂停RTP超时检查
-        JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, streamId);
+        // 使用zlm中的流ID
+        String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
+        JSONObject jsonObject = zlmresTfulUtils.pauseRtpCheck(mediaServerItem, ssrc);
         if (jsonObject == null || jsonObject.getInteger("code") != 0) {
             throw new ServiceException("暂停RTP接收失败");
         }
@@ -977,7 +979,9 @@ public class PlayServiceImpl implements IPlayService {
             throw new ServiceException("mediaServer不存在");
         }
         // zlm 暂停RTP超时检查
-        JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, streamId);
+        // 使用zlm中的流ID
+        String ssrc = Long.toHexString(Long.parseLong(ssrcTransaction.getSsrc())).toUpperCase();
+        JSONObject jsonObject = zlmresTfulUtils.resumeRtpCheck(mediaServerItem, ssrc);
         if (jsonObject == null || jsonObject.getInteger("code") != 0) {
             throw new ServiceException("继续RTP接收失败");
         }