From ccc0a99d6894844d83d751b924cfebe74da7826c Mon Sep 17 00:00:00 2001 From: ‘sxh’ <1632740646@qq.com> Date: 星期四, 15 六月 2023 11:20:43 +0800 Subject: [PATCH] 同步主线的代码,保持一致性 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java index d615980..8e9b3d0 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMMediaListManager.java @@ -3,6 +3,7 @@ import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.gb28181.bean.GbStream; import com.genersoft.iot.vmp.media.zlm.dto.*; +import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; import com.genersoft.iot.vmp.service.IMediaServerService; import com.genersoft.iot.vmp.service.IStreamProxyService; import com.genersoft.iot.vmp.service.IStreamPushService; @@ -67,19 +68,19 @@ private Map<String, ChannelOnlineEvent> channelOnPublishEvents = new ConcurrentHashMap<>(); - public StreamPushItem addPush(MediaItem mediaItem) { - StreamPushItem transform = streamPushService.transform(mediaItem); - StreamPushItem pushInDb = streamPushService.getPush(mediaItem.getApp(), mediaItem.getStream()); - transform.setPushIng(mediaItem.isRegist()); + public StreamPushItem addPush(OnStreamChangedHookParam onStreamChangedHookParam) { + StreamPushItem transform = streamPushService.transform(onStreamChangedHookParam); + StreamPushItem pushInDb = streamPushService.getPush(onStreamChangedHookParam.getApp(), onStreamChangedHookParam.getStream()); + transform.setPushIng(onStreamChangedHookParam.isRegist()); transform.setUpdateTime(DateUtil.getNow()); transform.setPushTime(DateUtil.getNow()); - transform.setSelf(userSetting.getServerId().equals(mediaItem.getSeverId())); + transform.setSelf(userSetting.getServerId().equals(onStreamChangedHookParam.getSeverId())); if (pushInDb == null) { transform.setCreateTime(DateUtil.getNow()); streamPushMapper.add(transform); }else { streamPushMapper.update(transform); - gbStreamMapper.updateMediaServer(mediaItem.getApp(), mediaItem.getStream(), mediaItem.getMediaServerId()); + gbStreamMapper.updateMediaServer(onStreamChangedHookParam.getApp(), onStreamChangedHookParam.getStream(), onStreamChangedHookParam.getMediaServerId()); } ChannelOnlineEvent channelOnlineEventLister = getChannelOnlineEventLister(transform.getApp(), transform.getStream()); if ( channelOnlineEventLister != null) { @@ -96,7 +97,8 @@ public void sendStreamEvent(String app, String stream, String mediaServerId) { MediaServerItem mediaServerItem = mediaServerService.getOne(mediaServerId); // 鏌ョ湅鎺ㄦ祦鐘舵�� - if (zlmrtpServerFactory.isStreamReady(mediaServerItem, app, stream)) { + Boolean streamReady = zlmrtpServerFactory.isStreamReady(mediaServerItem, app, stream); + if (streamReady != null && streamReady) { ChannelOnlineEvent channelOnlineEventLister = getChannelOnlineEventLister(app, stream); if (channelOnlineEventLister != null) { try { -- Gitblit v1.8.0