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 | 670 | try { |
| 671 | 671 | SsrcTransaction ssrcTransaction = streamSession.getSsrcTransaction(deviceId, channelId, null, stream); |
| 672 | 672 | ClientTransaction transaction = streamSession.getTransactionByStream(deviceId, channelId, stream); |
| 673 | + | |
| 673 | 674 | if (transaction == null) { |
| 674 | 675 | logger.warn("[ {} -> {}]停止视频流的时候发现事务已丢失", deviceId, channelId); |
| 675 | 676 | SipSubscribe.EventResult<Object> eventResult = new SipSubscribe.EventResult<>(); |
| ... | ... | @@ -685,7 +686,12 @@ public class SIPCommander implements ISIPCommander { |
| 685 | 686 | if (stream == null) return; |
| 686 | 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 | 696 | if (dialog == null) { |
| 691 | 697 | logger.warn("[ {} -> {}]停止视频流的时候发现对话已丢失", deviceId, channelId); |
| ... | ... | @@ -730,12 +736,6 @@ public class SIPCommander implements ISIPCommander { |
| 730 | 736 | |
| 731 | 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 | 739 | } catch (SipException | ParseException e) { |
| 740 | 740 | e.printStackTrace(); |
| 741 | 741 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
| ... | ... | @@ -95,7 +95,7 @@ public class ZLMRTPServerFactory { |
| 95 | 95 | if (openRtpServerResultJson.getInteger("code") == 0) { |
| 96 | 96 | result= openRtpServerResultJson.getInteger("port"); |
| 97 | 97 | }else { |
| 98 | - logger.error("创建RTP Server 失败 {}: " + openRtpServerResultJson.getString("msg"), param.get("port")); | |
| 98 | + logger.error("创建RTP Server 失败 {}: ", openRtpServerResultJson.getString("msg")); | |
| 99 | 99 | } |
| 100 | 100 | }else { |
| 101 | 101 | // 检查ZLM状态 | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStoragerImpl.java
| ... | ... | @@ -885,12 +885,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager { |
| 885 | 885 | List<ParentPlatform> parentPlatforms = parentPlatformMapper.selectAllAhareAllLiveStream(); |
| 886 | 886 | if (parentPlatforms.size() > 0) { |
| 887 | 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 | 889 | parentPlatform.getServerGBId()); |
| 893 | 890 | if (streamProxyItems == null) { |
| 891 | + streamPushItem.setCatalogId(parentPlatform.getCatalogId()); | |
| 892 | + streamPushItem.setPlatformId(parentPlatform.getServerGBId()); | |
| 894 | 893 | platformGbStreamMapper.add(streamPushItem); |
| 895 | 894 | eventPublisher.catalogEventPublishForStream(parentPlatform.getServerGBId(), streamPushItem, CatalogEvent.ADD); |
| 896 | 895 | } | ... | ... |
web_src/src/components/dialog/chooseChannelForStream.vue
| ... | ... | @@ -174,7 +174,7 @@ export default { |
| 174 | 174 | page: that.currentPage, |
| 175 | 175 | count: that.count, |
| 176 | 176 | query: that.searchSrt, |
| 177 | - pushing: that.online, | |
| 177 | + pushing: that.pushing, | |
| 178 | 178 | platformId: that.platformId, |
| 179 | 179 | catalogId: that.catalogId, |
| 180 | 180 | mediaServerId: that.mediaServerId | ... | ... |