From 00e61d9a80b5b013a75d1ce567dc997694577a45 Mon Sep 17 00:00:00 2001 From: panlinlin <648540858@qq.com> Date: 星期一, 28 十二月 2020 11:45:40 +0800 Subject: [PATCH] 增加对 需要扩展SDP的设备的单独设置 --- src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java index e7cfdb2..3f88b2a 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java @@ -36,6 +36,9 @@ @Value("${media.wanIp}") private String mediaWanIp; + @Value("${media.hookIp}") + private String mediaHookIp; + @Value("${media.port}") private int mediaPort; @@ -51,6 +54,9 @@ @Value("${server.port}") private String serverPort; + @Value("${media.autoConfig}") + private boolean autoConfig; + @Autowired private ZLMRESTfulUtils zlmresTfulUtils; @@ -61,15 +67,11 @@ MediaServerConfig mediaServerConfig = getMediaServerConfig(); if (mediaServerConfig != null) { logger.info("zlm鎺ュ叆鎴愬姛..."); - logger.info("璁剧疆zlm..."); - saveZLMConfig(); + if (autoConfig) saveZLMConfig(); mediaServerConfig = getMediaServerConfig(); storager.updateMediaInfo(mediaServerConfig); - } } - - public MediaServerConfig getMediaServerConfig() { JSONObject responseJSON = zlmresTfulUtils.getMediaServerConfig(); @@ -94,12 +96,12 @@ } private void saveZLMConfig() { - String hookIP = sipIP; - if (mediaIp.equals(sipIP)) { - hookIP = "127.0.0.1"; + logger.info("璁剧疆zlm..."); + if (StringUtils.isEmpty(mediaHookIp)) { + mediaHookIp = sipIP; } - String hookPrex = String.format("http://%s:%s/index/hook", hookIP, serverPort); + String hookPrex = String.format("http://%s:%s/index/hook", mediaHookIp, serverPort); Map<String, Object> param = new HashMap<>(); param.put("api.secret",mediaSecret); // -profile:v Baseline param.put("ffmpeg.cmd","%s -fflags nobuffer -rtsp_transport tcp -i %s -c:a aac -strict -2 -ar 44100 -ab 48k -c:v libx264 -f flv %s"); -- Gitblit v1.8.0