From f96250ef45af8d4c8f52fed382da058ab9330bbf Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 21 三月 2024 16:59:14 +0800 Subject: [PATCH] Merge branch 'master' into dev/abl支持 --- src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java index 3624c7b..2eb3da9 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java @@ -2,12 +2,12 @@ import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; import com.genersoft.iot.vmp.common.GeneralCallback; import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.conf.exception.ControllerException; -import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent; import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; import com.genersoft.iot.vmp.media.zlm.ZLMServerFactory; @@ -18,13 +18,12 @@ import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam; import com.genersoft.iot.vmp.service.IGbStreamService; -import com.genersoft.iot.vmp.service.IMediaServerService; +import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.service.IMediaService; import com.genersoft.iot.vmp.service.IStreamProxyService; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import com.genersoft.iot.vmp.storager.dao.GbStreamMapper; -import com.genersoft.iot.vmp.storager.dao.ParentPlatformMapper; import com.genersoft.iot.vmp.storager.dao.PlatformGbStreamMapper; import com.genersoft.iot.vmp.storager.dao.StreamProxyMapper; import com.genersoft.iot.vmp.utils.DateUtil; @@ -53,6 +52,7 @@ * 瑙嗛浠g悊涓氬姟 */ @Service +@DS("master") public class StreamProxyServiceImpl implements IStreamProxyService { private final static Logger logger = LoggerFactory.getLogger(StreamProxyServiceImpl.class); @@ -126,7 +126,13 @@ } JSONArray dataArray = jsonObject.getJSONArray("data"); JSONObject mediaServerConfig = dataArray.getJSONObject(0); + if (ObjectUtils.isEmpty(param.getFfmpegCmdKey())) { + param.setFfmpegCmdKey("ffmpeg.cmd"); + } String ffmpegCmd = mediaServerConfig.getString(param.getFfmpegCmdKey()); + if (ffmpegCmd == null) { + throw new ControllerException(ErrorCode.ERROR100.getCode(), "ffmpeg鎷夋祦浠g悊鏃犳硶鑾峰彇ffmpeg cmd"); + } String schema = getSchemaFromFFmpegCmd(ffmpegCmd); if (schema == null) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "ffmpeg鎷夋祦浠g悊鏃犳硶浠巉fmpeg cmd涓幏鍙栧埌杈撳嚭鏍煎紡"); @@ -401,6 +407,8 @@ logger.info("鍚敤浠g悊澶辫触锛� {}/{}->{}({})", app, stream, jsonObject.getString("msg"), streamProxy.getSrcUrl() == null? streamProxy.getUrl():streamProxy.getSrcUrl()); } + } else if (streamProxy != null && streamProxy.isEnable()) { + return true ; } return result; } @@ -452,7 +460,7 @@ streamProxyMapper.deleteAutoRemoveItemByMediaServerId(mediaServerId); // 绉婚櫎鎷夋祦浠g悊鐢熸垚鐨勬祦淇℃伅 -// syncPullStream(mediaServerId); + syncPullStream(mediaServerId); // 鎭㈠娴佷唬鐞�, 鍙煡鎵捐繖涓繖涓祦濯掍綋 List<StreamProxyItem> streamProxyListForEnable = storager.getStreamProxyListForEnableInMediaServer( -- Gitblit v1.8.0