Commit 9889f908c80cfc69bb3d240ce1705fcddfb5e9fb
1 parent
becea827
合并主线
Showing
11 changed files
with
48 additions
and
87 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| ... | ... | @@ -14,7 +14,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| 14 | 14 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderProvider; |
| 15 | 15 | import com.genersoft.iot.vmp.gb28181.utils.NumericUtil; |
| 16 | 16 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 17 | -import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | |
| 17 | +import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | |
| 18 | 18 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| 19 | 19 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| 20 | 20 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| ... | ... | @@ -24,7 +24,6 @@ import com.genersoft.iot.vmp.media.zlm.dto.hook.HookParam; |
| 24 | 24 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 25 | 25 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 26 | 26 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 27 | -import com.genersoft.iot.vmp.utils.GitUtil; | |
| 28 | 27 | import gov.nist.javax.sip.message.SIPRequest; |
| 29 | 28 | import gov.nist.javax.sip.message.SIPResponse; |
| 30 | 29 | import org.slf4j.Logger; |
| ... | ... | @@ -75,15 +74,10 @@ public class SIPCommander implements ISIPCommander { |
| 75 | 74 | private ZlmHttpHookSubscribe subscribe; |
| 76 | 75 | |
| 77 | 76 | @Autowired |
| 78 | - private GitUtil gitUtil; | |
| 79 | - | |
| 80 | - | |
| 81 | - | |
| 82 | - @Autowired | |
| 83 | 77 | private IMediaServerService mediaServerService; |
| 84 | 78 | |
| 85 | 79 | @Autowired |
| 86 | - private ZLMRTPServerFactory zlmrtpServerFactory; | |
| 80 | + private ZLMServerFactory zlmServerFactory; | |
| 87 | 81 | |
| 88 | 82 | |
| 89 | 83 | /** | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java
| 1 | 1 | package com.genersoft.iot.vmp.gb28181.transmit.cmd.impl; |
| 2 | 2 | |
| 3 | 3 | import com.alibaba.fastjson2.JSON; |
| 4 | -import com.alibaba.fastjson2.JSONObject; | |
| 5 | 4 | import com.genersoft.iot.vmp.common.InviteSessionType; |
| 6 | 5 | import com.genersoft.iot.vmp.conf.DynamicTask; |
| 7 | 6 | import com.genersoft.iot.vmp.conf.UserSetting; |
| ... | ... | @@ -14,7 +13,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; |
| 14 | 13 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 15 | 14 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.SIPRequestHeaderPlarformProvider; |
| 16 | 15 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 17 | -import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | |
| 18 | 16 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| 19 | 17 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| 20 | 18 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| ... | ... | @@ -69,7 +67,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 69 | 67 | private SipSubscribe sipSubscribe; |
| 70 | 68 | |
| 71 | 69 | @Autowired |
| 72 | - private ZLMServerFactory ZLMServerFactory; | |
| 70 | + private ZLMServerFactory zlmserverfactory; | |
| 73 | 71 | |
| 74 | 72 | @Autowired |
| 75 | 73 | private SipLayer sipLayer; |
| ... | ... | @@ -844,7 +842,7 @@ public class SIPCommanderFroPlatform implements ISIPCommanderForPlatform { |
| 844 | 842 | MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); |
| 845 | 843 | if (mediaServerItem != null) { |
| 846 | 844 | mediaServerService.releaseSsrc(mediaServerItem.getId(), sendRtpItem.getSsrc()); |
| 847 | - zlmrtpServerFactory.closeRtpServer(mediaServerItem, sendRtpItem.getStream()); | |
| 845 | + zlmserverfactory.closeRtpServer(mediaServerItem, sendRtpItem.getStream()); | |
| 848 | 846 | } |
| 849 | 847 | SIPRequest byeRequest = headerProviderPlatformProvider.createByeRequest(platform, sendRtpItem); |
| 850 | 848 | if (byeRequest == null) { | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
| ... | ... | @@ -66,7 +66,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In |
| 66 | 66 | private IDeviceService deviceService; |
| 67 | 67 | |
| 68 | 68 | @Autowired |
| 69 | - private ZLMServerFactory ZLMServerFactory; | |
| 69 | + private ZLMServerFactory zlmServerFactory; | |
| 70 | 70 | |
| 71 | 71 | @Autowired |
| 72 | 72 | private ZlmHttpHookSubscribe hookSubscribe; |
| ... | ... | @@ -168,19 +168,19 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In |
| 168 | 168 | JSONObject startSendRtpStreamResult = null; |
| 169 | 169 | if (sendRtpItem.getLocalPort() != 0) { |
| 170 | 170 | if (sendRtpItem.isTcpActive()) { |
| 171 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 171 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 172 | 172 | }else { |
| 173 | 173 | param.put("dst_url", sendRtpItem.getIp()); |
| 174 | 174 | param.put("dst_port", sendRtpItem.getPort()); |
| 175 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param); | |
| 175 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpStream(mediaInfo, param); | |
| 176 | 176 | } |
| 177 | 177 | }else { |
| 178 | 178 | if (sendRtpItem.isTcpActive()) { |
| 179 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 179 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 180 | 180 | }else { |
| 181 | 181 | param.put("dst_url", sendRtpItem.getIp()); |
| 182 | 182 | param.put("dst_port", sendRtpItem.getPort()); |
| 183 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param); | |
| 183 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpStream(mediaInfo, param); | |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | return startSendRtpStreamResult; | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| ... | ... | @@ -7,19 +7,14 @@ import com.genersoft.iot.vmp.conf.SipConfig; |
| 7 | 7 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 8 | 8 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 9 | 9 | import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager; |
| 10 | -import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | |
| 11 | 10 | import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; |
| 12 | 11 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 13 | 12 | import com.genersoft.iot.vmp.gb28181.transmit.SIPSender; |
| 14 | -import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | |
| 15 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; | |
| 16 | 13 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 17 | 14 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; |
| 18 | 15 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| 19 | 16 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 20 | 17 | import com.genersoft.iot.vmp.media.zlm.ZLMMediaListManager; |
| 21 | -import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | |
| 22 | -import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | |
| 23 | 18 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| 24 | 19 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| 25 | 20 | import com.genersoft.iot.vmp.media.zlm.dto.*; |
| ... | ... | @@ -103,18 +98,12 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 103 | 98 | private AudioBroadcastManager audioBroadcastManager; |
| 104 | 99 | |
| 105 | 100 | @Autowired |
| 106 | - private ZLMServerFactory ZLMServerFactory; | |
| 101 | + private ZLMServerFactory zlmServerFactory; | |
| 107 | 102 | |
| 108 | 103 | @Autowired |
| 109 | 104 | private IMediaServerService mediaServerService; |
| 110 | 105 | |
| 111 | 106 | @Autowired |
| 112 | - private ISIPCommander commander; | |
| 113 | - | |
| 114 | - @Autowired | |
| 115 | - private ZLMRESTfulUtils zlmresTfulUtils; | |
| 116 | - | |
| 117 | - @Autowired | |
| 118 | 107 | private ZlmHttpHookSubscribe zlmHttpHookSubscribe; |
| 119 | 108 | |
| 120 | 109 | @Autowired |
| ... | ... | @@ -127,17 +116,8 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 127 | 116 | private ZLMMediaListManager mediaListManager; |
| 128 | 117 | |
| 129 | 118 | @Autowired |
| 130 | - private DeferredResultHolder resultHolder; | |
| 131 | - | |
| 132 | - @Autowired | |
| 133 | - private ZlmHttpHookSubscribe subscribe; | |
| 134 | - | |
| 135 | - @Autowired | |
| 136 | 119 | private SipConfig config; |
| 137 | 120 | |
| 138 | - @Autowired | |
| 139 | - private VideoStreamSessionManager streamSession; | |
| 140 | - | |
| 141 | 121 | |
| 142 | 122 | @Autowired |
| 143 | 123 | private RedisGbPlayMsgListener redisGbPlayMsgListener; |
| ... | ... | @@ -375,7 +355,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 375 | 355 | streamTypeStr = "UDP"; |
| 376 | 356 | } |
| 377 | 357 | logger.info("[上级Invite] {}, 平台:{}, 通道:{}, 收流地址:{}:{},收流方式:{}, ssrc:{}", sessionName, username, channelId, addressStr, port, streamTypeStr, ssrc); |
| 378 | - SendRtpItem sendRtpItem = ZLMServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 358 | + SendRtpItem sendRtpItem = zlmServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 379 | 359 | device.getDeviceId(), channelId, mediaTransmissionTCP, platform.isRtcp()); |
| 380 | 360 | |
| 381 | 361 | if (tcpActive != null) { |
| ... | ... | @@ -578,10 +558,10 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 578 | 558 | CallIdHeader callIdHeader, MediaServerItem mediaServerItem, |
| 579 | 559 | int port, Boolean tcpActive, boolean mediaTransmissionTCP, |
| 580 | 560 | String channelId, String addressStr, String ssrc, String requesterId) { |
| 581 | - Boolean streamReady = ZLMServerFactory.isStreamReady(mediaServerItem, gbStream.getApp(), gbStream.getStream()); | |
| 561 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, gbStream.getApp(), gbStream.getStream()); | |
| 582 | 562 | if (streamReady != null && streamReady) { |
| 583 | 563 | // 自平台内容 |
| 584 | - SendRtpItem sendRtpItem = ZLMServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 564 | + SendRtpItem sendRtpItem = zlmServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 585 | 565 | gbStream.getApp(), gbStream.getStream(), channelId, mediaTransmissionTCP, platform.isRtcp()); |
| 586 | 566 | |
| 587 | 567 | if (sendRtpItem == null) { |
| ... | ... | @@ -618,10 +598,10 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 618 | 598 | String channelId, String addressStr, String ssrc, String requesterId) { |
| 619 | 599 | // 推流 |
| 620 | 600 | if (streamPushItem.isSelf()) { |
| 621 | - Boolean streamReady = ZLMServerFactory.isStreamReady(mediaServerItem, gbStream.getApp(), gbStream.getStream()); | |
| 601 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, gbStream.getApp(), gbStream.getStream()); | |
| 622 | 602 | if (streamReady != null && streamReady) { |
| 623 | 603 | // 自平台内容 |
| 624 | - SendRtpItem sendRtpItem = ZLMServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 604 | + SendRtpItem sendRtpItem = zlmServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 625 | 605 | gbStream.getApp(), gbStream.getStream(), channelId, mediaTransmissionTCP, platform.isRtcp()); |
| 626 | 606 | |
| 627 | 607 | if (sendRtpItem == null) { |
| ... | ... | @@ -736,7 +716,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 736 | 716 | mediaListManager.addChannelOnlineEventLister(gbStream.getApp(), gbStream.getStream(), (app, stream, serverId) -> { |
| 737 | 717 | dynamicTask.stop(callIdHeader.getCallId()); |
| 738 | 718 | if (serverId.equals(userSetting.getServerId())) { |
| 739 | - SendRtpItem sendRtpItem = ZLMServerFactory.createSendRtpItem(mediaServerItem, addressStr, finalPort, ssrc, requesterId, | |
| 719 | + SendRtpItem sendRtpItem = zlmServerFactory.createSendRtpItem(mediaServerItem, addressStr, finalPort, ssrc, requesterId, | |
| 740 | 720 | app, stream, channelId, mediaTransmissionTCP, platform.isRtcp()); |
| 741 | 721 | |
| 742 | 722 | if (sendRtpItem == null) { |
| ... | ... | @@ -1011,7 +991,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 1011 | 991 | mediaTransmissionTCP ? (tcpActive ? "TCP主动" : "TCP被动") : "UDP", sdp.getSessionName().getValue()); |
| 1012 | 992 | CallIdHeader callIdHeader = (CallIdHeader) request.getHeader(CallIdHeader.NAME); |
| 1013 | 993 | |
| 1014 | - SendRtpItem sendRtpItem = zlmrtpServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 994 | + SendRtpItem sendRtpItem = zlmServerFactory.createSendRtpItem(mediaServerItem, addressStr, port, ssrc, requesterId, | |
| 1015 | 995 | device.getDeviceId(), broadcastCatch.getChannelId(), |
| 1016 | 996 | mediaTransmissionTCP, false); |
| 1017 | 997 | |
| ... | ... | @@ -1045,7 +1025,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements |
| 1045 | 1025 | |
| 1046 | 1026 | redisCatchStorage.updateSendRTPSever(sendRtpItem); |
| 1047 | 1027 | |
| 1048 | - Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, broadcastCatch.getApp(), broadcastCatch.getStream()); | |
| 1028 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, broadcastCatch.getApp(), broadcastCatch.getStream()); | |
| 1049 | 1029 | if (streamReady) { |
| 1050 | 1030 | sendOk(device, sendRtpItem, sdp, request, mediaServerItem, mediaTransmissionTCP, ssrc); |
| 1051 | 1031 | } else { | ... | ... |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/BroadcastNotifyMessageHandler.java
| ... | ... | @@ -8,7 +8,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 8 | 8 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| 9 | 9 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.IMessageHandler; |
| 10 | 10 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.impl.message.notify.NotifyMessageHandler; |
| 11 | -import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | |
| 11 | +import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | |
| 12 | 12 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 13 | 13 | import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; |
| 14 | 14 | import com.genersoft.iot.vmp.service.IDeviceService; |
| ... | ... | @@ -65,7 +65,7 @@ public class BroadcastNotifyMessageHandler extends SIPRequestProcessorParent imp |
| 65 | 65 | private AudioBroadcastManager audioBroadcastManager; |
| 66 | 66 | |
| 67 | 67 | @Autowired |
| 68 | - private ZLMRTPServerFactory zlmrtpServerFactory; | |
| 68 | + private ZLMServerFactory zlmServerFactory; | |
| 69 | 69 | |
| 70 | 70 | @Autowired |
| 71 | 71 | private IRedisCatchStorage redisCatchStorage; |
| ... | ... | @@ -163,7 +163,7 @@ public class BroadcastNotifyMessageHandler extends SIPRequestProcessorParent imp |
| 163 | 163 | } |
| 164 | 164 | }else { |
| 165 | 165 | // 发流 |
| 166 | - JSONObject jsonObject = zlmrtpServerFactory.startSendRtp(mediaServerItem, sendRtpItem); | |
| 166 | + JSONObject jsonObject = zlmServerFactory.startSendRtp(mediaServerItem, sendRtpItem); | |
| 167 | 167 | if (jsonObject != null && jsonObject.getInteger("code") == 0 ) { |
| 168 | 168 | logger.info("[语音喊话] 自动推流成功, device: {}, channel: {}", device.getDeviceId(), targetId); |
| 169 | 169 | }else { | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
| ... | ... | @@ -67,7 +67,7 @@ public class ZLMHttpHookListener { |
| 67 | 67 | private AudioBroadcastManager audioBroadcastManager; |
| 68 | 68 | |
| 69 | 69 | @Autowired |
| 70 | - private ZLMRTPServerFactory zlmrtpServerFactory; | |
| 70 | + private ZLMServerFactory zlmServerFactory; | |
| 71 | 71 | |
| 72 | 72 | @Autowired |
| 73 | 73 | private IPlayService playService; | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
| ... | ... | @@ -87,7 +87,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | @Autowired |
| 90 | - private ZLMServerFactory ZLMServerFactory; | |
| 90 | + private ZLMServerFactory zlmServerFactory; | |
| 91 | 91 | |
| 92 | 92 | @Autowired |
| 93 | 93 | private EventPublisher publisher; |
| ... | ... | @@ -183,7 +183,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 183 | 183 | } |
| 184 | 184 | int rtpServerPort; |
| 185 | 185 | if (mediaServerItem.isRtpEnable()) { |
| 186 | - rtpServerPort = zlmrtpServerFactory.createRTPServer(mediaServerItem, streamId, ssrcCheck?Integer.parseInt(ssrc):0, port, onlyAuto, reUsePort, tcpMode); | |
| 186 | + rtpServerPort = zlmServerFactory.createRTPServer(mediaServerItem, streamId, ssrcCheck?Integer.parseInt(ssrc):0, port, onlyAuto, reUsePort, tcpMode); | |
| 187 | 187 | } else { |
| 188 | 188 | rtpServerPort = mediaServerItem.getRtpProxyPort(); |
| 189 | 189 | } |
| ... | ... | @@ -201,7 +201,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 201 | 201 | if (mediaServerItem == null) { |
| 202 | 202 | return; |
| 203 | 203 | } |
| 204 | - ZLMServerFactory.closeRtpServer(mediaServerItem, streamId); | |
| 204 | + zlmServerFactory.closeRtpServer(mediaServerItem, streamId); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | @Override |
| ... | ... | @@ -210,7 +210,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 210 | 210 | callback.run(false); |
| 211 | 211 | return; |
| 212 | 212 | } |
| 213 | - ZLMServerFactory.closeRtpServer(mediaServerItem, streamId, callback); | |
| 213 | + zlmServerFactory.closeRtpServer(mediaServerItem, streamId, callback); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | @Override |
| ... | ... | @@ -221,7 +221,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 221 | 221 | |
| 222 | 222 | @Override |
| 223 | 223 | public Boolean updateRtpServerSSRC(MediaServerItem mediaServerItem, String streamId, String ssrc) { |
| 224 | - return ZLMServerFactory.updateRtpServerSSRC(mediaServerItem, streamId, ssrc); | |
| 224 | + return zlmServerFactory.updateRtpServerSSRC(mediaServerItem, streamId, ssrc); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | @Override | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java
| ... | ... | @@ -10,7 +10,6 @@ import com.genersoft.iot.vmp.gb28181.event.SipSubscribe; |
| 10 | 10 | import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; |
| 11 | 11 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 12 | 12 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; |
| 13 | -import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | |
| 14 | 13 | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| 15 | 14 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| 16 | 15 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| ... | ... | @@ -60,15 +59,6 @@ public class PlatformServiceImpl implements IPlatformService { |
| 60 | 59 | private ParentPlatformMapper platformMapper; |
| 61 | 60 | |
| 62 | 61 | @Autowired |
| 63 | - private PlatformCatalogMapper catalogMapper; | |
| 64 | - | |
| 65 | - @Autowired | |
| 66 | - private PlatformChannelMapper platformChannelMapper; | |
| 67 | - | |
| 68 | - @Autowired | |
| 69 | - private PlatformGbStreamMapper platformGbStreamMapper; | |
| 70 | - | |
| 71 | - @Autowired | |
| 72 | 62 | private IRedisCatchStorage redisCatchStorage; |
| 73 | 63 | |
| 74 | 64 | @Autowired |
| ... | ... | @@ -84,7 +74,7 @@ public class PlatformServiceImpl implements IPlatformService { |
| 84 | 74 | private DynamicTask dynamicTask; |
| 85 | 75 | |
| 86 | 76 | @Autowired |
| 87 | - private ZLMServerFactory ZLMServerFactory; | |
| 77 | + private ZLMServerFactory zlmServerFactory; | |
| 88 | 78 | |
| 89 | 79 | @Autowired |
| 90 | 80 | private SubscribeHolder subscribeHolder; |
| ... | ... | @@ -365,7 +355,7 @@ public class PlatformServiceImpl implements IPlatformService { |
| 365 | 355 | param.put("vhost", "__defaultVhost__"); |
| 366 | 356 | param.put("app", sendRtpItem.getApp()); |
| 367 | 357 | param.put("stream", sendRtpItem.getStream()); |
| 368 | - ZLMServerFactory.stopSendRtpStream(mediaInfo, param); | |
| 358 | + zlmServerFactory.stopSendRtpStream(mediaInfo, param); | |
| 369 | 359 | } |
| 370 | 360 | } |
| 371 | 361 | } |
| ... | ... | @@ -437,7 +427,7 @@ public class PlatformServiceImpl implements IPlatformService { |
| 437 | 427 | // 如果zlm不存在这个流,则删除数据即可 |
| 438 | 428 | MediaServerItem mediaServerItemForStreamInfo = mediaServerService.getOne(inviteInfo.getStreamInfo().getMediaServerId()); |
| 439 | 429 | if (mediaServerItemForStreamInfo != null) { |
| 440 | - Boolean ready = zlmrtpServerFactory.isStreamReady(mediaServerItemForStreamInfo, inviteInfo.getStreamInfo().getApp(), inviteInfo.getStreamInfo().getStream()); | |
| 430 | + Boolean ready = zlmServerFactory.isStreamReady(mediaServerItemForStreamInfo, inviteInfo.getStreamInfo().getApp(), inviteInfo.getStreamInfo().getStream()); | |
| 441 | 431 | if (!ready) { |
| 442 | 432 | // 错误存在于redis中的数据 |
| 443 | 433 | inviteStreamService.removeInviteInfo(inviteInfo); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| ... | ... | @@ -20,7 +20,6 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| 20 | 20 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; |
| 21 | 21 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 22 | 22 | import com.genersoft.iot.vmp.media.zlm.*; |
| 23 | -import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; | |
| 24 | 23 | import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils; |
| 25 | 24 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 26 | 25 | import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; |
| ... | ... | @@ -89,7 +88,7 @@ public class PlayServiceImpl implements IPlayService { |
| 89 | 88 | private IRedisCatchStorage redisCatchStorage; |
| 90 | 89 | |
| 91 | 90 | @Autowired |
| 92 | - private ZLMRTPServerFactory zlmrtpServerFactory; | |
| 91 | + private ZLMServerFactory zlmServerFactory; | |
| 93 | 92 | |
| 94 | 93 | @Autowired |
| 95 | 94 | private IInviteStreamService inviteStreamService; |
| ... | ... | @@ -101,7 +100,7 @@ public class PlayServiceImpl implements IPlayService { |
| 101 | 100 | private ZLMRESTfulUtils zlmresTfulUtils; |
| 102 | 101 | |
| 103 | 102 | @Autowired |
| 104 | - private ZLMServerFactory ZLMServerFactory; | |
| 103 | + private ZLMServerFactory zlmserverfactory; | |
| 105 | 104 | |
| 106 | 105 | @Autowired |
| 107 | 106 | private AssistRESTfulUtils assistRESTfulUtils; |
| ... | ... | @@ -175,7 +174,7 @@ public class PlayServiceImpl implements IPlayService { |
| 175 | 174 | String mediaServerId = streamInfo.getMediaServerId(); |
| 176 | 175 | MediaServerItem mediaInfo = mediaServerService.getOne(mediaServerId); |
| 177 | 176 | |
| 178 | - Boolean ready = ZLMServerFactory.isStreamReady(mediaInfo, "rtp", streamId); | |
| 177 | + Boolean ready = zlmserverfactory.isStreamReady(mediaInfo, "rtp", streamId); | |
| 179 | 178 | if (ready != null && ready) { |
| 180 | 179 | callback.run(InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo); |
| 181 | 180 | inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channelId, null, |
| ... | ... | @@ -195,7 +194,7 @@ public class PlayServiceImpl implements IPlayService { |
| 195 | 194 | if (mediaServerItem.isRtpEnable()) { |
| 196 | 195 | streamId = String.format("%s_%s", device.getDeviceId(), channelId); |
| 197 | 196 | } |
| 198 | - SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, null, device.isSsrcCheck(), false, 0, false, device.getStreamModeForParam()); | |
| 197 | + SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, null, device.isSsrcCheck(), false, 0, false, false,device.getStreamModeForParam()); | |
| 199 | 198 | if (ssrcInfo == null) { |
| 200 | 199 | callback.run(InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getCode(), InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getMsg(), null); |
| 201 | 200 | inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channelId, null, |
| ... | ... | @@ -279,7 +278,7 @@ public class PlayServiceImpl implements IPlayService { |
| 279 | 278 | param.put("recv_stream_id", sendRtpItem.getReceiveStream()); |
| 280 | 279 | param.put("close_delay_ms", userSetting.getPlayTimeout() * 1000); |
| 281 | 280 | |
| 282 | - zlmrtpServerFactory.startSendRtpPassive(mediaServerItem, param, jsonObject -> { | |
| 281 | + zlmServerFactory.startSendRtpPassive(mediaServerItem, param, jsonObject -> { | |
| 283 | 282 | if (jsonObject == null || jsonObject.getInteger("code") != 0 ) { |
| 284 | 283 | mediaServerService.releaseSsrc(mediaServerItem.getId(), sendRtpItem.getSsrc()); |
| 285 | 284 | logger.info("[语音对讲]失败 deviceId: {}, channelId: {}", device.getDeviceId(), channelId); |
| ... | ... | @@ -1240,7 +1239,7 @@ public class PlayServiceImpl implements IPlayService { |
| 1240 | 1239 | SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(device.getDeviceId(), channelId, null, null); |
| 1241 | 1240 | if (sendRtpItem != null && sendRtpItem.isOnlyAudio()) { |
| 1242 | 1241 | // 查询流是否存在,不存在则认为是异常状态 |
| 1243 | - Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream()); | |
| 1242 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, sendRtpItem.getApp(), sendRtpItem.getStream()); | |
| 1244 | 1243 | if (streamReady) { |
| 1245 | 1244 | logger.warn("语音广播已经开启: {}", channelId); |
| 1246 | 1245 | event.call("语音广播已经开启"); |
| ... | ... | @@ -1253,7 +1252,7 @@ public class PlayServiceImpl implements IPlayService { |
| 1253 | 1252 | SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(device.getDeviceId(), channelId, null, null); |
| 1254 | 1253 | if (sendRtpItem != null) { |
| 1255 | 1254 | MediaServerItem mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| 1256 | - Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServer, "rtp", sendRtpItem.getReceiveStream()); | |
| 1255 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServer, "rtp", sendRtpItem.getReceiveStream()); | |
| 1257 | 1256 | if (streamReady) { |
| 1258 | 1257 | logger.warn("[语音对讲] 进行中: {}", channelId); |
| 1259 | 1258 | event.call("语音对讲进行中"); |
| ... | ... | @@ -1284,7 +1283,7 @@ public class PlayServiceImpl implements IPlayService { |
| 1284 | 1283 | if (sendRtpItem != null && sendRtpItem.isOnlyAudio()) { |
| 1285 | 1284 | // 查询流是否存在,不存在则认为是异常状态 |
| 1286 | 1285 | MediaServerItem mediaServerServiceOne = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| 1287 | - Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerServiceOne, sendRtpItem.getApp(), sendRtpItem.getStream()); | |
| 1286 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerServiceOne, sendRtpItem.getApp(), sendRtpItem.getStream()); | |
| 1288 | 1287 | if (streamReady) { |
| 1289 | 1288 | logger.warn("语音广播通道使用中: {}", channelId); |
| 1290 | 1289 | return true; |
| ... | ... | @@ -1466,19 +1465,19 @@ public class PlayServiceImpl implements IPlayService { |
| 1466 | 1465 | JSONObject startSendRtpStreamResult = null; |
| 1467 | 1466 | if (sendRtpItem.getLocalPort() != 0) { |
| 1468 | 1467 | if (sendRtpItem.isTcpActive()) { |
| 1469 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 1468 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 1470 | 1469 | } else { |
| 1471 | 1470 | param.put("dst_url", sendRtpItem.getIp()); |
| 1472 | 1471 | param.put("dst_port", sendRtpItem.getPort()); |
| 1473 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param); | |
| 1472 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpStream(mediaInfo, param); | |
| 1474 | 1473 | } |
| 1475 | 1474 | } else { |
| 1476 | 1475 | if (sendRtpItem.isTcpActive()) { |
| 1477 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 1476 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpPassive(mediaInfo, param); | |
| 1478 | 1477 | } else { |
| 1479 | 1478 | param.put("dst_url", sendRtpItem.getIp()); |
| 1480 | 1479 | param.put("dst_port", sendRtpItem.getPort()); |
| 1481 | - startSendRtpStreamResult = zlmrtpServerFactory.startSendRtpStream(mediaInfo, param); | |
| 1480 | + startSendRtpStreamResult = zlmServerFactory.startSendRtpStream(mediaInfo, param); | |
| 1482 | 1481 | } |
| 1483 | 1482 | } |
| 1484 | 1483 | if (startSendRtpStreamResult != null) { |
| ... | ... | @@ -1542,7 +1541,7 @@ public class PlayServiceImpl implements IPlayService { |
| 1542 | 1541 | if (sendRtpItem != null && sendRtpItem.isOnlyAudio()) { |
| 1543 | 1542 | // 查询流是否存在,不存在则认为是异常状态 |
| 1544 | 1543 | MediaServerItem mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| 1545 | - Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServer, sendRtpItem.getApp(), sendRtpItem.getStream()); | |
| 1544 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServer, sendRtpItem.getApp(), sendRtpItem.getStream()); | |
| 1546 | 1545 | if (streamReady) { |
| 1547 | 1546 | logger.warn("[语音对讲] 正在语音广播,无法开启语音通话: {}", channelId); |
| 1548 | 1547 | event.call("正在语音广播"); |
| ... | ... | @@ -1556,7 +1555,7 @@ public class PlayServiceImpl implements IPlayService { |
| 1556 | 1555 | SendRtpItem sendRtpItem = redisCatchStorage.querySendRTPServer(device.getDeviceId(), channelId, stream, null); |
| 1557 | 1556 | if (sendRtpItem != null) { |
| 1558 | 1557 | MediaServerItem mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| 1559 | - Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServer, "rtp", sendRtpItem.getReceiveStream()); | |
| 1558 | + Boolean streamReady = zlmServerFactory.isStreamReady(mediaServer, "rtp", sendRtpItem.getReceiveStream()); | |
| 1560 | 1559 | if (streamReady) { |
| 1561 | 1560 | logger.warn("[语音对讲] 进行中: {}", channelId); |
| 1562 | 1561 | event.call("语音对讲进行中"); |
| ... | ... | @@ -1608,7 +1607,7 @@ public class PlayServiceImpl implements IPlayService { |
| 1608 | 1607 | param.put("app", sendRtpItem.getApp()); |
| 1609 | 1608 | param.put("stream", sendRtpItem.getStream()); |
| 1610 | 1609 | param.put("ssrc", sendRtpItem.getSsrc()); |
| 1611 | - zlmrtpServerFactory.stopSendRtpStream(mediaServer, param); | |
| 1610 | + zlmServerFactory.stopSendRtpStream(mediaServer, param); | |
| 1612 | 1611 | } |
| 1613 | 1612 | |
| 1614 | 1613 | ssrcFactory.releaseSsrc(mediaServerId, sendRtpItem.getSsrc()); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/redisMsg/RedisPushStreamCloseResponseListener.java
| ... | ... | @@ -58,7 +58,7 @@ public class RedisPushStreamCloseResponseListener implements MessageListener { |
| 58 | 58 | private IMediaServerService mediaServerService; |
| 59 | 59 | |
| 60 | 60 | @Autowired |
| 61 | - private ZLMServerFactory ZLMServerFactory; | |
| 61 | + private ZLMServerFactory zlmServerFactory; | |
| 62 | 62 | |
| 63 | 63 | |
| 64 | 64 | private Map<String, PushStreamResponseEvent> responseEvents = new ConcurrentHashMap<>(); |
| ... | ... | @@ -89,7 +89,7 @@ public class RedisPushStreamCloseResponseListener implements MessageListener { |
| 89 | 89 | logger.info("[REDIS消息-推流结束] 停止向上级推流:{}", streamId); |
| 90 | 90 | MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| 91 | 91 | redisCatchStorage.deleteSendRTPServer(sendRtpItem.getPlatformId(), sendRtpItem.getChannelId(), sendRtpItem.getCallId(), sendRtpItem.getStream()); |
| 92 | - zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param); | |
| 92 | + zlmServerFactory.stopSendRtpStream(mediaInfo, param); | |
| 93 | 93 | |
| 94 | 94 | try { |
| 95 | 95 | commanderFroPlatform.streamByeCmd(parentPlatform, sendRtpItem); | ... | ... |
src/main/java/com/genersoft/iot/vmp/vmanager/rtp/RtpController.java
| ... | ... | @@ -125,7 +125,7 @@ public class RtpController { |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | } |
| 128 | - int localPort = zlmServerFactory.createRTPServer(mediaServerItem, stream, ssrcInt, null, false, tcpMode); | |
| 128 | + int localPort = zlmServerFactory.createRTPServer(mediaServerItem, stream, ssrcInt, null, false, false, tcpMode); | |
| 129 | 129 | // 注册回调如果rtp收流超时则通过回调发送通知 |
| 130 | 130 | if (callBack != null) { |
| 131 | 131 | HookSubscribeForRtpServerTimeout hookSubscribeForRtpServerTimeout = HookSubscribeFactory.on_rtp_server_timeout(ssrc, null, mediaServerItem.getId()); | ... | ... |