From 54f6ff9f816e538722fe6dabd368a03278c48648 Mon Sep 17 00:00:00 2001 From: lin <648540858@qq.com> Date: Fri, 27 Jun 2025 15:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=89=E6=B5=81=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E8=BD=AC=E5=9B=BD=E6=A0=87=E7=BA=A7=E8=81=94=E7=82=B9?= =?UTF-8?q?=E6=92=AD=E5=A4=B1=E8=B4=A5=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/GbChannelPlayServiceImpl.java | 1 + .../service/impl/StreamProxyPlayServiceImpl.java | 14 ++++++++++++-- web/src/views/dialog/linkChannelRecord.vue | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java index 71c4b0b0a..8a849a28e 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java @@ -118,6 +118,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService { @Override public void play(CommonGBChannel channel, Platform platform, Boolean record, ErrorCallback callback) { + log.info("[通用通道] 播放, 类型: {}, 编号:{}", channel.getDataType(), channel.getGbDeviceId()); if (channel.getDataType() == ChannelDataType.GB28181.value) { // 国标通道 playGbDeviceChannel(channel, record, callback); diff --git a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyPlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyPlayServiceImpl.java index a6cffa93f..a9ff6dc23 100755 --- a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyPlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyPlayServiceImpl.java @@ -1,7 +1,6 @@ package com.genersoft.iot.vmp.streamProxy.service.impl; import com.genersoft.iot.vmp.common.StreamInfo; -import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.exception.ControllerException; @@ -12,9 +11,9 @@ import com.genersoft.iot.vmp.media.event.hook.HookSubscribe; import com.genersoft.iot.vmp.media.event.hook.HookType; import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent; import com.genersoft.iot.vmp.media.service.IMediaServerService; -import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcPlayService; import com.genersoft.iot.vmp.service.bean.ErrorCallback; import com.genersoft.iot.vmp.service.bean.InviteErrorCode; +import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcPlayService; import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy; import com.genersoft.iot.vmp.streamProxy.dao.StreamProxyMapper; import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyPlayService; @@ -107,6 +106,7 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService { @Override public StreamInfo start(int id, Boolean record, ErrorCallback callback) { + log.info("[拉流代理], 开始拉流,ID:{}", id); StreamProxy streamProxy = streamProxyMapper.select(id); if (streamProxy == null) { throw new ControllerException(ErrorCode.ERROR404.getCode(), "代理信息未找到"); @@ -114,6 +114,15 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService { if (record != null) { streamProxy.setEnableMp4(record); } + if (streamProxy.getMediaServerId() != null) { + StreamInfo streamInfo = mediaServerService.getStreamInfoByAppAndStreamWithCheck(streamProxy.getApp(), streamProxy.getStream(), streamProxy.getMediaServerId(), false); + if (streamInfo != null) { + callbackMap.remove(id); + streamInfoMap.remove(id); + callback.run(InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo); + return streamInfo; + } + } StreamInfo streamInfo = startProxy(streamProxy); if (callback != null) { @@ -121,6 +130,7 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService { String timeOutTaskKey = UUID.randomUUID().toString(); Hook rtpHook = Hook.getInstance(HookType.on_media_arrival, streamProxy.getApp(), streamProxy.getStream(), streamInfo.getMediaServer().getId()); dynamicTask.startDelay(timeOutTaskKey, () -> { + log.info("[拉流代理], 收流超时,ID:{}", id); // 收流超时 subscribe.removeSubscribe(rtpHook); callback.run(InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getCode(), InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getMsg(), streamInfo); diff --git a/web/src/views/dialog/linkChannelRecord.vue b/web/src/views/dialog/linkChannelRecord.vue index 04387d98f..b4ebe44c3 100755 --- a/web/src/views/dialog/linkChannelRecord.vue +++ b/web/src/views/dialog/linkChannelRecord.vue @@ -1,7 +1,7 @@