Commit 9889f908c80cfc69bb3d240ce1705fcddfb5e9fb

Authored by 648540858
1 parent becea827

合并主线

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