From 988dc36fa56a47cc4f331ab48c07577805a71425 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期五, 04 八月 2023 15:47:56 +0800 Subject: [PATCH] 重构点播,回放,下载时ssrc不一致以及TCP主动播放的逻辑 --- src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java index f1dcda1..b75b477 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java @@ -4,8 +4,9 @@ import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.bean.*; import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; +import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; -import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; +import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import com.genersoft.iot.vmp.service.IMediaServerService; import com.genersoft.iot.vmp.service.IPlatformService; @@ -56,6 +57,9 @@ private IRedisCatchStorage redisCatchStorage; @Autowired + private SSRCFactory ssrcFactory; + + @Autowired private IMediaServerService mediaServerService; @Autowired @@ -65,7 +69,7 @@ private DynamicTask dynamicTask; @Autowired - private ZLMRTPServerFactory zlmrtpServerFactory; + private ZLMServerFactory zlmServerFactory; @Autowired private SubscribeHolder subscribeHolder; @@ -101,7 +105,6 @@ // 琛屾斂鍖哄垝榛樿鍘荤紪鍙风殑鍓�6浣� parentPlatform.setAdministrativeDivision(parentPlatform.getServerGBId().substring(0,6)); } - parentPlatform.setTreeType("CivilCode"); parentPlatform.setCatalogId(parentPlatform.getDeviceGBId()); int result = platformMapper.addParentPlatform(parentPlatform); // 娣诲姞缂撳瓨 @@ -127,8 +130,6 @@ @Override public boolean update(ParentPlatform parentPlatform) { logger.info("[鍥芥爣绾ц仈]鏇存柊骞冲彴 {}", parentPlatform.getDeviceGBId()); - // TODO 鍚庣画鐗堟湰鍘婚櫎 - parentPlatform.setTreeType(""); parentPlatform.setCharacterSet(parentPlatform.getCharacterSet().toUpperCase()); ParentPlatform parentPlatformOld = platformMapper.getParentPlatById(parentPlatform.getId()); ParentPlatformCatch parentPlatformCatchOld = redisCatchStorage.queryPlatformCatchInfo(parentPlatformOld.getServerGBId()); @@ -330,13 +331,14 @@ List<SendRtpItem> sendRtpItems = redisCatchStorage.querySendRTPServer(platformId); if (sendRtpItems != null && sendRtpItems.size() > 0) { for (SendRtpItem sendRtpItem : sendRtpItems) { + ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc()); redisCatchStorage.deleteSendRTPServer(platformId, sendRtpItem.getChannelId(), null, null); MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); Map<String, Object> param = new HashMap<>(3); param.put("vhost", "__defaultVhost__"); param.put("app", sendRtpItem.getApp()); param.put("stream", sendRtpItem.getStreamId()); - zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param); + zlmServerFactory.stopSendRtpStream(mediaInfo, param); } } } -- Gitblit v1.8.0