From 622d72b3f0f1b3103518ef15931f160d639198a5 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 08 五月 2024 12:16:18 +0800
Subject: [PATCH] 解决刷新通道异常
---
src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 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 69bae41..f0230f7 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;
@@ -24,7 +24,6 @@
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);
@@ -86,12 +86,6 @@
@Autowired
private PlatformGbStreamMapper platformGbStreamMapper;
-
- @Autowired
- private EventPublisher eventPublisher;
-
- @Autowired
- private ParentPlatformMapper parentPlatformMapper;
@Autowired
private IGbStreamService gbStreamService;
@@ -132,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涓幏鍙栧埌杈撳嚭鏍煎紡");
@@ -331,8 +331,6 @@
result = zlmresTfulUtils.addStreamProxy(mediaServerItem, param.getApp(), param.getStream(), param.getUrl().trim(),
param.isEnableAudio(), param.isEnableMp4(), param.getRtpType());
}
- System.out.println("addStreamProxyToZlm====");
- System.out.println(result);
if (result != null && result.getInteger("code") == 0) {
JSONObject data = result.getJSONObject("data");
if (data == null) {
@@ -460,7 +458,7 @@
streamProxyMapper.deleteAutoRemoveItemByMediaServerId(mediaServerId);
// 绉婚櫎鎷夋祦浠g悊鐢熸垚鐨勬祦淇℃伅
-// syncPullStream(mediaServerId);
+ syncPullStream(mediaServerId);
// 鎭㈠娴佷唬鐞�, 鍙煡鎵捐繖涓繖涓祦濯掍綋
List<StreamProxyItem> streamProxyListForEnable = storager.getStreamProxyListForEnableInMediaServer(
--
Gitblit v1.8.0