Commit e8b766172e4f1af382a27185172dccf1e1ada556

Authored by 648540858
1 parent f62bf7b2

合并268优化内容

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,15 +2,10 @@ package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl;
2 2
3 import com.genersoft.iot.vmp.common.InviteInfo; 3 import com.genersoft.iot.vmp.common.InviteInfo;
4 import com.genersoft.iot.vmp.common.InviteSessionType; 4 import com.genersoft.iot.vmp.common.InviteSessionType;
5 -import com.genersoft.iot.vmp.common.StreamInfo;  
6 import com.genersoft.iot.vmp.conf.UserSetting; 5 import com.genersoft.iot.vmp.conf.UserSetting;
7 import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; 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 import com.genersoft.iot.vmp.gb28181.bean.*; 7 import com.genersoft.iot.vmp.gb28181.bean.*;
  8 +import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
14 import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; 9 import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
15 import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; 10 import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver;
16 import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommander; 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,11 +13,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor
18 import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; 13 import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent;
19 import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; 14 import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory;
20 import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; 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 import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; 17 import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
27 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 18 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
28 import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 19 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
@@ -36,10 +27,6 @@ import org.springframework.stereotype.Component; @@ -36,10 +27,6 @@ import org.springframework.stereotype.Component;
36 import javax.sip.InvalidArgumentException; 27 import javax.sip.InvalidArgumentException;
37 import javax.sip.RequestEvent; 28 import javax.sip.RequestEvent;
38 import javax.sip.SipException; 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 import javax.sip.header.CallIdHeader; 30 import javax.sip.header.CallIdHeader;
44 import javax.sip.message.Response; 31 import javax.sip.message.Response;
45 import java.text.ParseException; 32 import java.text.ParseException;
@@ -160,6 +147,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In @@ -160,6 +147,7 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
160 } 147 }
161 } 148 }
162 }else { 149 }else {
  150 +
163 // 可能是设备发送的停止 151 // 可能是设备发送的停止
164 SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(null, null, callIdHeader.getCallId(), null); 152 SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(null, null, callIdHeader.getCallId(), null);
165 if (ssrcTransaction == null) { 153 if (ssrcTransaction == null) {
@@ -180,10 +168,12 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In @@ -180,10 +168,12 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
180 return; 168 return;
181 } 169 }
182 storager.stopPlay(device.getDeviceId(), channel.getChannelId()); 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 // 释放ssrc 178 // 释放ssrc
189 MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId()); 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,7 +105,6 @@ public class PlatformServiceImpl implements IPlatformService {
105 // 行政区划默认去编号的前6位 105 // 行政区划默认去编号的前6位
106 parentPlatform.setAdministrativeDivision(parentPlatform.getServerGBId().substring(0,6)); 106 parentPlatform.setAdministrativeDivision(parentPlatform.getServerGBId().substring(0,6));
107 } 107 }
108 - parentPlatform.setTreeType("CivilCode");  
109 parentPlatform.setCatalogId(parentPlatform.getDeviceGBId()); 108 parentPlatform.setCatalogId(parentPlatform.getDeviceGBId());
110 int result = platformMapper.addParentPlatform(parentPlatform); 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,7 +185,7 @@ public class PlayServiceImpl implements IPlayService {
185 null); 185 null);
186 return; 186 return;
187 } 187 }
188 - logger.info("[点播开始] deviceId: {}, channelId: {},码流类型:{},收流端口: {}, 收流模式:{}, SSRC: {}, SSRC校验:{}", 188 + logger.info("[点播开始] deviceId: {}, channelId: {},码流类型:{}, 收流端口: {}, 收流模式:{}, SSRC: {}, SSRC校验:{}",
189 device.getDeviceId(), channelId, device.isSwitchPrimarySubStream() ? "辅码流" : "主码流", ssrcInfo.getPort(), 189 device.getDeviceId(), channelId, device.isSwitchPrimarySubStream() ? "辅码流" : "主码流", ssrcInfo.getPort(),
190 device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck()); 190 device.getStreamMode(), ssrcInfo.getSsrc(), device.isSsrcCheck());
191 //端口获取失败的ssrcInfo 没有必要发送点播指令 191 //端口获取失败的ssrcInfo 没有必要发送点播指令
@@ -267,7 +267,7 @@ public class PlayServiceImpl implements IPlayService { @@ -267,7 +267,7 @@ public class PlayServiceImpl implements IPlayService {
267 InviteErrorCode.SUCCESS.getCode(), 267 InviteErrorCode.SUCCESS.getCode(),
268 InviteErrorCode.SUCCESS.getMsg(), 268 InviteErrorCode.SUCCESS.getMsg(),
269 streamInfo); 269 streamInfo);
270 - logger.info("[点播成功] deviceId: {}, channelId: {},码流类型:{}", device.getDeviceId(), 270 + logger.info("[点播成功] deviceId: {}, channelId:{}, 码流类型:{}", device.getDeviceId(),
271 device.isSwitchPrimarySubStream() ? "辅码流" : "主码流"); 271 device.isSwitchPrimarySubStream() ? "辅码流" : "主码流");
272 String streamUrl; 272 String streamUrl;
273 if (mediaServerItemInuse.getRtspPort() != 0) { 273 if (mediaServerItemInuse.getRtspPort() != 0) {