Commit fc9ed976cfb5faa3c92ac878dcd62c322ff22502
1 parent
e898c344
合并主线
Showing
6 changed files
with
5 additions
and
25 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java
| @@ -100,10 +100,9 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In | @@ -100,10 +100,9 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In | ||
| 100 | } | 100 | } |
| 101 | // tcp主动时,此时是级联下级平台,在回复200ok时,本地已经请求zlm开启监听,跳过下面步骤 | 101 | // tcp主动时,此时是级联下级平台,在回复200ok时,本地已经请求zlm开启监听,跳过下面步骤 |
| 102 | if (sendRtpItem.isTcpActive()) { | 102 | if (sendRtpItem.isTcpActive()) { |
| 103 | - logger.info("收到ACK,rtp/{} TCP主动方式后续处理", sendRtpItem.getStreamId()); | 103 | + logger.info("收到ACK,rtp/{} TCP主动方式后续处理", sendRtpItem.getStream()); |
| 104 | return; | 104 | return; |
| 105 | } | 105 | } |
| 106 | - String is_Udp = sendRtpItem.isTcp() ? "0" : "1"; | ||
| 107 | MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); | 106 | MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| 108 | logger.info("收到ACK,rtp/{}开始向上级推流, 目标={}:{},SSRC={}, 协议:{}", | 107 | logger.info("收到ACK,rtp/{}开始向上级推流, 目标={}:{},SSRC={}, 协议:{}", |
| 109 | sendRtpItem.getStream(), | 108 | sendRtpItem.getStream(), |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java
| @@ -472,7 +472,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | @@ -472,7 +472,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements | ||
| 472 | String startTimeStr = DateUtil.urlFormatter.format(start); | 472 | String startTimeStr = DateUtil.urlFormatter.format(start); |
| 473 | String endTimeStr = DateUtil.urlFormatter.format(end); | 473 | String endTimeStr = DateUtil.urlFormatter.format(end); |
| 474 | String stream = device.getDeviceId() + "_" + channelId + "_" + startTimeStr + "_" + endTimeStr; | 474 | String stream = device.getDeviceId() + "_" + channelId + "_" + startTimeStr + "_" + endTimeStr; |
| 475 | - SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, stream, null, device.isSsrcCheck(), true, 0, false, device.getStreamModeForParam()); | 475 | + SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, stream, null, device.isSsrcCheck(), true, 0,false, false, device.getStreamModeForParam()); |
| 476 | // 写入redis, 超时时回复 | 476 | // 写入redis, 超时时回复 |
| 477 | redisCatchStorage.updateSendRTPSever(sendRtpItem); | 477 | redisCatchStorage.updateSendRTPSever(sendRtpItem); |
| 478 | playService.playBack(mediaServerItem, ssrcInfo, device.getDeviceId(), channelId, DateUtil.formatter.format(start), | 478 | playService.playBack(mediaServerItem, ssrcInfo, device.getDeviceId(), channelId, DateUtil.formatter.format(start), |
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/notify/cmd/KeepaliveNotifyMessageHandler.java
| @@ -68,7 +68,7 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp | @@ -68,7 +68,7 @@ public class KeepaliveNotifyMessageHandler extends SIPRequestProcessorParent imp | ||
| 68 | } catch (SipException | InvalidArgumentException | ParseException e) { | 68 | } catch (SipException | InvalidArgumentException | ParseException e) { |
| 69 | logger.error("[命令发送失败] 心跳回复: {}", e.getMessage()); | 69 | logger.error("[命令发送失败] 心跳回复: {}", e.getMessage()); |
| 70 | } | 70 | } |
| 71 | - if (DateUtil.getDifferenceForNow(device.getKeepaliveTime()) <= 3000L){ | 71 | + if (device.getKeepaliveTime() != null && DateUtil.getDifferenceForNow(device.getKeepaliveTime()) <= 3000L){ |
| 72 | logger.info("[收到心跳] 心跳发送过于频繁,已忽略 device: {}, callId: {}", device.getDeviceId(), request.getCallIdHeader().getCallId()); | 72 | logger.info("[收到心跳] 心跳发送过于频繁,已忽略 device: {}, callId: {}", device.getDeviceId(), request.getCallIdHeader().getCallId()); |
| 73 | return; | 73 | return; |
| 74 | } | 74 | } |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -18,14 +18,8 @@ import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; | @@ -18,14 +18,8 @@ import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; | ||
| 18 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; | 18 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 19 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; | 19 | 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.transmit.cmd.impl.SIPCommanderFroPlatform; | ||
| 22 | -import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | ||
| 23 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; | 21 | import com.genersoft.iot.vmp.gb28181.utils.SipUtils; |
| 24 | import com.genersoft.iot.vmp.media.zlm.*; | 22 | import com.genersoft.iot.vmp.media.zlm.*; |
| 25 | -import com.genersoft.iot.vmp.media.zlm.AssistRESTfulUtils; | ||
| 26 | -import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | ||
| 27 | -import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; | ||
| 28 | -import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; | ||
| 29 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; | 23 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| 30 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; | 24 | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| 31 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 25 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| @@ -45,7 +39,6 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | @@ -45,7 +39,6 @@ import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | ||
| 45 | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | 39 | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; |
| 46 | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.AudioBroadcastEvent; | 40 | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.AudioBroadcastEvent; |
| 47 | import gov.nist.javax.sip.message.SIPResponse; | 41 | import gov.nist.javax.sip.message.SIPResponse; |
| 48 | -import gov.nist.javax.sip.message.SIPResponse; | ||
| 49 | import org.slf4j.Logger; | 42 | import org.slf4j.Logger; |
| 50 | import org.slf4j.LoggerFactory; | 43 | import org.slf4j.LoggerFactory; |
| 51 | import org.springframework.beans.factory.annotation.Autowired; | 44 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -198,7 +191,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -198,7 +191,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 198 | } | 191 | } |
| 199 | } | 192 | } |
| 200 | String streamId = String.format("%s_%s", device.getDeviceId(), channelId);; | 193 | String streamId = String.format("%s_%s", device.getDeviceId(), channelId);; |
| 201 | - SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, ssrc, device.isSsrcCheck(), false, 0, false, device.getStreamModeForParam()); | 194 | + SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, ssrc, device.isSsrcCheck(), false, 0, false, false, device.getStreamModeForParam()); |
| 202 | if (ssrcInfo == null) { | 195 | if (ssrcInfo == null) { |
| 203 | callback.run(InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getCode(), InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getMsg(), null); | 196 | callback.run(InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getCode(), InviteErrorCode.ERROR_FOR_RESOURCE_EXHAUSTION.getMsg(), null); |
| 204 | inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channelId, null, | 197 | inviteStreamService.call(InviteSessionType.PLAY, device.getDeviceId(), channelId, null, |
| @@ -642,7 +635,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -642,7 +635,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 642 | .replace(":", "") | 635 | .replace(":", "") |
| 643 | .replace(" ", ""); | 636 | .replace(" ", ""); |
| 644 | String stream = deviceId + "_" + channelId + "_" + startTimeStr + "_" + endTimeTimeStr; | 637 | String stream = deviceId + "_" + channelId + "_" + startTimeStr + "_" + endTimeTimeStr; |
| 645 | - SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, stream, null, device.isSsrcCheck(), true, 0, false, device.getStreamModeForParam()); | 638 | + SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, stream, null, device.isSsrcCheck(), true, 0, false, false, device.getStreamModeForParam()); |
| 646 | playBack(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, callback); | 639 | playBack(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, callback); |
| 647 | } | 640 | } |
| 648 | 641 |
src/main/resources/all-device-compatible.yml deleted
100644 → 0
| 1 | -# 设备列表 | ||
| 2 | - # 国标编号, 标识哪些设备使用这套兼容配置,优先级 id > model > manufacturer | ||
| 3 | -- id: 88880000013200000888 | ||
| 4 | - # 型号 | ||
| 5 | - model: DH-P40A2-PV | ||
| 6 | - # 生产商 | ||
| 7 | - manufacturer: Dahua | ||
| 8 | - # 收到ack消息后开始发流,默认false, 回复200ok后直接开始发流 | ||
| 9 | - push-stream-after-ack: false | ||
| 10 | - # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能, | ||
| 11 | - # 非严格模式使用随机端口发流,性能更好, 默认关闭 | ||
| 12 | - gb-send-stream-strict: false |
src/main/resources/device-compatible.yml deleted
100644 → 0