From 69e7ab54398c40b81fa4e13b3b1dd6038ff8a224 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: Sat, 29 Jun 2024 12:01:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StreamProxyServiceImpl.java | 63 +------------------ 1 file changed, 1 insertion(+), 62 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java index 72f5775b..ac957963 100755 --- a/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/streamProxy/service/impl/StreamProxyServiceImpl.java @@ -225,68 +225,6 @@ public class StreamProxyServiceImpl implements IStreamProxyService { return true; } - @Override - public WVPResult addStreamProxyToZlm(StreamProxy param) { - WVPResult result = null; - MediaServer mediaServer = null; - if (param.getMediaServerId() == null) { - log.warn("添加代理时MediaServerId 为null"); - return null; - }else { - mediaServer = mediaServerService.getOne(param.getMediaServerId()); - } - if (mediaServer == null) { - return null; - } - if (mediaServerService.isStreamReady(mediaServer, param.getApp(), param.getStream())) { - mediaServerService.closeStreams(mediaServer, param.getApp(), param.getStream()); - } - String msgResult; - if ("ffmpeg".equalsIgnoreCase(param.getType())){ - if (param.getTimeoutMs() == 0) { - param.setTimeoutMs(15); - } - result = mediaServerService.addFFmpegSource(mediaServer, param.getSrcUrl().trim(), param.getDstUrl(), - param.getTimeoutMs(), param.isEnableAudio(), param.isEnableMp4(), - param.getFfmpegCmdKey()); - }else { - result = mediaServerService.addStreamProxy(mediaServer, param.getApp(), param.getStream(), param.getSrcUrl().trim(), - param.isEnableAudio(), param.isEnableMp4(), param.getRtspType(), param.getTimeout()); - } - if (result != null && result.getCode() == 0) { - String key = result.getData(); - if (key == null) { - log.warn("[获取拉流代理的结果数据Data] 失败: {}", result ); - return result; - } - param.setStreamKey(key); - streamProxyMapper.update(param); - } - return result; - } - - @Override - public Boolean removeStreamProxyFromZlm(StreamProxy param) { - if (param ==null) { - return null; - } - MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId()); - if (mediaServer == null) { - return null; - } - List mediaList = mediaServerService.getMediaList(mediaServer, param.getApp(), param.getStream(), null); - if (mediaList == null || mediaList.isEmpty()) { - return true; - } - Boolean result = false; - if ("ffmpeg".equalsIgnoreCase(param.getType())){ - result = mediaServerService.delFFmpegSource(mediaServer, param.getStreamKey()); - }else { - result = mediaServerService.delStreamProxy(mediaServer, param.getStreamKey()); - } - return result; - } - @Override public PageInfo getAll(Integer page, Integer count) { PageHelper.startPage(page, count); @@ -380,6 +318,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService { mediaServerId, true); for (StreamProxy streamProxyDto : streamProxyListForEnable) { log.info("恢复流代理," + streamProxyDto.getApp() + "/" + streamProxyDto.getStream()); + mediaServerService.startProxy(me) WVPResult wvpResult = addStreamProxyToZlm(streamProxyDto); if (wvpResult == null) { // 设置为离线