Commit d21a00418e04cc773eaeeff3d220e5931023929a
1 parent
0dfce85d
修复推流关联平台的bug
Showing
4 changed files
with
12 additions
and
13 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
| @@ -670,6 +670,7 @@ public class SIPCommander implements ISIPCommander { | @@ -670,6 +670,7 @@ public class SIPCommander implements ISIPCommander { | ||
| 670 | try { | 670 | try { |
| 671 | SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(deviceId, channelId, null, stream); | 671 | SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(deviceId, channelId, null, stream); |
| 672 | ClientTransaction transaction = streamSession.getTransactionByStream(deviceId, channelId, stream); | 672 | ClientTransaction transaction = streamSession.getTransactionByStream(deviceId, channelId, stream); |
| 673 | + | ||
| 673 | if (transaction == null) { | 674 | if (transaction == null) { |
| 674 | logger.warn("[ {} -> {}]停止视频流的时候发现事务已丢失", deviceId, channelId); | 675 | logger.warn("[ {} -> {}]停止视频流的时候发现事务已丢失", deviceId, channelId); |
| 675 | SipSubscribe.EventResult<Object> eventResult = new SipSubscribe.EventResult<>(); | 676 | SipSubscribe.EventResult<Object> eventResult = new SipSubscribe.EventResult<>(); |
| @@ -685,7 +686,12 @@ public class SIPCommander implements ISIPCommander { | @@ -685,7 +686,12 @@ public class SIPCommander implements ISIPCommander { | ||
| 685 | if (stream == null) return; | 686 | if (stream == null) return; |
| 686 | dialog = streamSession.getDialogByStream(deviceId, channelId, stream); | 687 | dialog = streamSession.getDialogByStream(deviceId, channelId, stream); |
| 687 | } | 688 | } |
| 688 | - | 689 | + if (ssrcTransaction != null) { |
| 690 | + MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId()); | ||
| 691 | + mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcTransaction.getSsrc()); | ||
| 692 | + mediaServerService.closeRTPServer(deviceId, channelId, ssrcTransaction.getStream()); | ||
| 693 | + streamSession.remove(deviceId, channelId, ssrcTransaction.getStream()); | ||
| 694 | + } | ||
| 689 | 695 | ||
| 690 | if (dialog == null) { | 696 | if (dialog == null) { |
| 691 | logger.warn("[ {} -> {}]停止视频流的时候发现对话已丢失", deviceId, channelId); | 697 | logger.warn("[ {} -> {}]停止视频流的时候发现对话已丢失", deviceId, channelId); |
| @@ -730,12 +736,6 @@ public class SIPCommander implements ISIPCommander { | @@ -730,12 +736,6 @@ public class SIPCommander implements ISIPCommander { | ||
| 730 | 736 | ||
| 731 | dialog.sendRequest(clientTransaction); | 737 | dialog.sendRequest(clientTransaction); |
| 732 | 738 | ||
| 733 | - if (ssrcTransaction != null) { | ||
| 734 | - MediaServerItem mediaServerItem = mediaServerService.getOne(ssrcTransaction.getMediaServerId()); | ||
| 735 | - mediaServerService.releaseSsrc(mediaServerItem.getId(), ssrcTransaction.getSsrc()); | ||
| 736 | - mediaServerService.closeRTPServer(deviceId, channelId, ssrcTransaction.getStream()); | ||
| 737 | - streamSession.remove(deviceId, channelId, ssrcTransaction.getStream()); | ||
| 738 | - } | ||
| 739 | } catch (SipException | ParseException e) { | 739 | } catch (SipException | ParseException e) { |
| 740 | e.printStackTrace(); | 740 | e.printStackTrace(); |
| 741 | } | 741 | } |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
| @@ -95,7 +95,7 @@ public class ZLMRTPServerFactory { | @@ -95,7 +95,7 @@ public class ZLMRTPServerFactory { | ||
| 95 | if (openRtpServerResultJson.getInteger("code") == 0) { | 95 | if (openRtpServerResultJson.getInteger("code") == 0) { |
| 96 | result= openRtpServerResultJson.getInteger("port"); | 96 | result= openRtpServerResultJson.getInteger("port"); |
| 97 | }else { | 97 | }else { |
| 98 | - logger.error("创建RTP Server 失败 {}: " + openRtpServerResultJson.getString("msg"), param.get("port")); | 98 | + logger.error("创建RTP Server 失败 {}: ", openRtpServerResultJson.getString("msg")); |
| 99 | } | 99 | } |
| 100 | }else { | 100 | }else { |
| 101 | // 检查ZLM状态 | 101 | // 检查ZLM状态 |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| @@ -885,12 +885,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | @@ -885,12 +885,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { | ||
| 885 | List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream(); | 885 | List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream(); |
| 886 | if (parentPlatforms.size() > 0) { | 886 | if (parentPlatforms.size() > 0) { |
| 887 | for (ParentPlatform parentPlatform : parentPlatforms) { | 887 | for (ParentPlatform parentPlatform : parentPlatforms) { |
| 888 | - streamPushItem.setCatalogId(parentPlatform.getCatalogId()); | ||
| 889 | - streamPushItem.setPlatformId(parentPlatform.getServerGBId()); | ||
| 890 | - String stream = streamPushItem.getStream(); | ||
| 891 | - StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), stream, | 888 | + StreamProxyItem streamProxyItems = platformGbStreamMapper.selectOne(streamPushItem.getApp(), streamPushItem.getStream(), |
| 892 | parentPlatform.getServerGBId()); | 889 | parentPlatform.getServerGBId()); |
| 893 | if (streamProxyItems == null) { | 890 | if (streamProxyItems == null) { |
| 891 | + streamPushItem.setCatalogId(parentPlatform.getCatalogId()); | ||
| 892 | + streamPushItem.setPlatformId(parentPlatform.getServerGBId()); | ||
| 894 | platformGbStreamMapper.add(streamPushItem); | 893 | platformGbStreamMapper.add(streamPushItem); |
| 895 | eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD); | 894 | eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD); |
| 896 | } | 895 | } |
web_src/src/components/dialog/chooseChannelForStream.vue
| @@ -174,7 +174,7 @@ export default { | @@ -174,7 +174,7 @@ export default { | ||
| 174 | page: that.currentPage, | 174 | page: that.currentPage, |
| 175 | count: that.count, | 175 | count: that.count, |
| 176 | query: that.searchSrt, | 176 | query: that.searchSrt, |
| 177 | - pushing: that.online, | 177 | + pushing: that.pushing, |
| 178 | platformId: that.platformId, | 178 | platformId: that.platformId, |
| 179 | catalogId: that.catalogId, | 179 | catalogId: that.catalogId, |
| 180 | mediaServerId: that.mediaServerId | 180 | mediaServerId: that.mediaServerId |