From cc63a52884ca3c56df66b74aa508803ff91c20e0 Mon Sep 17 00:00:00 2001 From: chenjialing <595168663@qq.com> Date: 星期五, 06 五月 2022 17:44:56 +0800 Subject: [PATCH] 开发----增加预置位查询接口开发 --- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java index 2811c4f..bdea90f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java @@ -2,7 +2,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.gb28181.bean.Device; -import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; +import com.genersoft.iot.vmp.gb28181.bean.InviteStreamType; import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; @@ -13,8 +13,9 @@ import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; import com.genersoft.iot.vmp.service.IMediaServerService; +import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; +import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.utils.SerializeUtils; import gov.nist.javax.sip.stack.SIPDialog; import org.slf4j.Logger; @@ -50,7 +51,7 @@ private IRedisCatchStorage redisCatchStorage; @Autowired - private IVideoManagerStorager storager; + private IVideoManagerStorage storager; @Autowired private ZLMRTPServerFactory zlmrtpServerFactory; @@ -93,14 +94,26 @@ param.put("app",sendRtpItem.getApp()); param.put("stream",streamId); param.put("ssrc",sendRtpItem.getSsrc()); - logger.info("鍋滄鍚戜笂绾ф帹娴侊細" + streamId); + logger.info("鏀跺埌bye:鍋滄鍚戜笂绾ф帹娴侊細" + streamId); MediaServerItem mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); zlmrtpServerFactory.stopSendRtpStream(mediaInfo, param); redisCatchStorage.deleteSendRTPServer(platformGbId, channelId, callIdHeader.getCallId(), null); int totalReaderCount = zlmrtpServerFactory.totalReaderCount(mediaInfo, sendRtpItem.getApp(), streamId); if (totalReaderCount <= 0) { - logger.info(streamId + "鏃犲叾瀹冭鐪嬭�咃紝閫氱煡璁惧鍋滄鎺ㄦ祦"); - cmder.streamByeCmd(sendRtpItem.getDeviceId(), channelId, streamId); + logger.info("鏀跺埌bye: {} 鏃犲叾瀹冭鐪嬭�咃紝閫氱煡璁惧鍋滄鎺ㄦ祦", streamId); + if (sendRtpItem.getPlayType().equals(InviteStreamType.PLAY)) { + cmder.streamByeCmd(sendRtpItem.getDeviceId(), channelId, streamId, null); + } + if (sendRtpItem.getPlayType().equals(InviteStreamType.PUSH)) { + MessageForPushChannel messageForPushChannel = new MessageForPushChannel(); + messageForPushChannel.setType(0); + messageForPushChannel.setGbId(sendRtpItem.getChannelId()); + messageForPushChannel.setApp(sendRtpItem.getApp()); + messageForPushChannel.setStream(sendRtpItem.getStreamId()); + messageForPushChannel.setMediaServerId(sendRtpItem.getMediaServerId()); + messageForPushChannel.setPlatFormId(sendRtpItem.getPlatformId()); + redisCatchStorage.sendStreamPushRequestedMsg(messageForPushChannel); + } } } // 鍙兘鏄澶囦富鍔ㄥ仠姝� -- Gitblit v1.8.0