Commit e8b766172e4f1af382a27185172dccf1e1ada556
1 parent
f62bf7b2
合并268优化内容
Showing
3 changed files
with
11 additions
and
22 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java
| ... | ... | @@ -2,15 +2,10 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; |
| 2 | 2 | |
| 3 | 3 | import com.genersoft.iot.vmp.common.InviteInfo; |
| 4 | 4 | import com.genersoft.iot.vmp.common.InviteSessionType; |
| 5 | -import com.genersoft.iot.vmp.common.StreamInfo; | |
| 6 | 5 | import com.genersoft.iot.vmp.conf.UserSetting; |
| 7 | 6 | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; |
| 8 | -import com.genersoft.iot.vmp.gb28181.bean.Device; | |
| 9 | -import com.genersoft.iot.vmp.gb28181.bean.InviteStreamType; | |
| 10 | -import com.genersoft.iot.vmp.gb28181.bean.SendRtpItem; | |
| 11 | -import com.genersoft.iot.vmp.gb28181.bean.SsrcTransaction; | |
| 12 | -import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; | |
| 13 | 7 | import com.genersoft.iot.vmp.gb28181.bean.*; |
| 8 | +import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; | |
| 14 | 9 | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| 15 | 10 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 16 | 11 | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; |
| ... | ... | @@ -18,11 +13,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor |
| 18 | 13 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| 19 | 14 | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; |
| 20 | 15 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 21 | -import com.genersoft.iot.vmp.service.IDeviceChannelService; | |
| 22 | -import com.genersoft.iot.vmp.service.IDeviceService; | |
| 23 | -import com.genersoft.iot.vmp.service.IInviteStreamService; | |
| 24 | -import com.genersoft.iot.vmp.service.IMediaServerService; | |
| 25 | -import com.genersoft.iot.vmp.service.IPlatformService; | |
| 16 | +import com.genersoft.iot.vmp.service.*; | |
| 26 | 17 | import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; |
| 27 | 18 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 28 | 19 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| ... | ... | @@ -36,10 +27,6 @@ import org.springframework.stereotype.Component; |
| 36 | 27 | import javax.sip.InvalidArgumentException; |
| 37 | 28 | import javax.sip.RequestEvent; |
| 38 | 29 | import javax.sip.SipException; |
| 39 | -import javax.sip.address.SipURI; | |
| 40 | -import javax.sip.InvalidArgumentException; | |
| 41 | -import javax.sip.RequestEvent; | |
| 42 | -import javax.sip.SipException; | |
| 43 | 30 | import javax.sip.header.CallIdHeader; |
| 44 | 31 | import javax.sip.message.Response; |
| 45 | 32 | import java.text.ParseException; |
| ... | ... | @@ -160,6 +147,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In |
| 160 | 147 | } |
| 161 | 148 | } |
| 162 | 149 | }else { |
| 150 | + | |
| 163 | 151 | // 可能是设备发送的停止 |
| 164 | 152 | SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(null, null, callIdHeader.getCallId(), null); |
| 165 | 153 | if (ssrcTransaction == null) { |
| ... | ... | @@ -180,10 +168,12 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In |
| 180 | 168 | return; |
| 181 | 169 | } |
| 182 | 170 | storager.stopPlay(device.getDeviceId(), channel.getChannelId()); |
| 183 | - StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(device.getDeviceId(), channel.getChannelId()); | |
| 184 | - if (streamInfo != null) { | |
| 185 | - redisCatchStorage.stopPlay(streamInfo); | |
| 186 | - mediaServerService.closeRTPServer(streamInfo.getMediaServerId(), streamInfo.getStream()); | |
| 171 | + InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, device.getDeviceId(), channel.getChannelId()); | |
| 172 | + if (inviteInfo != null) { | |
| 173 | + inviteStreamService.removeInviteInfo(inviteInfo); | |
| 174 | + if (inviteInfo.getStreamInfo() != null) { | |
| 175 | + mediaServerService.closeRTPServer(inviteInfo.getStreamInfo().getMediaServerId(), inviteInfo.getStreamInfo().getStream()); | |
| 176 | + } | |
| 187 | 177 | } |
| 188 | 178 | // 释放ssrc |
| 189 | 179 | MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId()); | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlatformServiceImpl.java
| ... | ... | @@ -105,7 +105,6 @@ public class PlatformServiceImpl implements IPlatformService { |
| 105 | 105 | // 行政区划默认去编号的前6位 |
| 106 | 106 | parentPlatform.setAdministrativeDivision(parentPlatform.getServerGBId().substring(0,6)); |
| 107 | 107 | } |
| 108 | - parentPlatform.setTreeType("CivilCode"); | |
| 109 | 108 | parentPlatform.setCatalogId(parentPlatform.getDeviceGBId()); |
| 110 | 109 | int result = platformMapper.addParentPlatform(parentPlatform); |
| 111 | 110 | // 添加缓存 | ... | ... |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| ... | ... | @@ -185,7 +185,7 @@ public class PlayServiceImpl implements IPlayService { |
| 185 | 185 | null); |
| 186 | 186 | return; |
| 187 | 187 | } |
| 188 | - logger.info("[点播开始] deviceId: {}, channelId: {},码流类型:{},收流端口: {}, 收流模式:{}, SSRC: {}, SSRC校验:{}", | |
| 188 | + logger.info("[点播开始] deviceId: {}, channelId: {},码流类型:{}, 收流端口: {}, 收流模式:{}, SSRC: {}, SSRC校验:{}", | |
| 189 | 189 | device.getDeviceId(), channelId, device.isSwitchPrimarySubStream() ? "辅码流" : "主码流", ssrcInfo.getPort(), |
| 190 | 190 | device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck()); |
| 191 | 191 | //端口获取失败的ssrcInfo 没有必要发送点播指令 |
| ... | ... | @@ -267,7 +267,7 @@ public class PlayServiceImpl implements IPlayService { |
| 267 | 267 | InviteErrorCode.SUCCESS.getCode(), |
| 268 | 268 | InviteErrorCode.SUCCESS.getMsg(), |
| 269 | 269 | streamInfo); |
| 270 | - logger.info("[点播成功] deviceId: {}, channelId: {},码流类型:{}", device.getDeviceId(), | |
| 270 | + logger.info("[点播成功] deviceId: {}, channelId:{}, 码流类型:{}", device.getDeviceId(), | |
| 271 | 271 | device.isSwitchPrimarySubStream() ? "辅码流" : "主码流"); |
| 272 | 272 | String streamUrl; |
| 273 | 273 | if (mediaServerItemInuse.getRtspPort() != 0) { | ... | ... |