From 6dd870e74c90d39c6ef2443f2f6c058f5973af62 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Tue, 9 Apr 2024 10:59:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E6=92=AD=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/conf/MediaConfig.java | 83 +++++++++++-------- .../vmp/storager/dao/MediaServerMapper.java | 2 +- src/main/resources/application.yml | 2 +- 3 files changed, 52 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java index 0dc1ba98..eac7c113 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/MediaConfig.java @@ -212,41 +212,58 @@ public class MediaConfig{ } public MediaServer getMediaSerItem(){ - MediaServer mediaServerItem = new MediaServer(); - mediaServerItem.setId(id); - mediaServerItem.setIp(ip); - mediaServerItem.setDefaultServer(true); - mediaServerItem.setHookIp(getHookIp()); - mediaServerItem.setSdpIp(getSdpIp()); - mediaServerItem.setStreamIp(getStreamIp()); - mediaServerItem.setHttpPort(httpPort); - mediaServerItem.setFlvPort(flvPort); - mediaServerItem.setWsFlvPort(wsFlvPort); - mediaServerItem.setHttpSSlPort(httpSSlPort); - mediaServerItem.setFlvSSLPort(flvSSlPort); - mediaServerItem.setWsFlvSSLPort(wsFlvSSlPort); - mediaServerItem.setRtmpPort(rtmpPort); - mediaServerItem.setRtmpSSlPort(rtmpSSlPort); - mediaServerItem.setRtpProxyPort(getRtpProxyPort()); - mediaServerItem.setRtspPort(rtspPort); - mediaServerItem.setRtspSSLPort(rtspSSLPort); - mediaServerItem.setAutoConfig(autoConfig); - mediaServerItem.setSecret(secret); - mediaServerItem.setRtpEnable(rtpEnable); - mediaServerItem.setRtpPortRange(rtpPortRange); - mediaServerItem.setSendRtpPortRange(rtpSendPortRange); - mediaServerItem.setRecordAssistPort(recordAssistPort); - mediaServerItem.setHookAliveInterval(10f); - mediaServerItem.setRecordDay(recordDay); - mediaServerItem.setStatus(false); - mediaServerItem.setType(type); - if (recordPath != null) { - mediaServerItem.setRecordPath(recordPath); + MediaServer mediaServer = new MediaServer(); + mediaServer.setId(id); + mediaServer.setIp(ip); + mediaServer.setDefaultServer(true); + mediaServer.setHookIp(getHookIp()); + mediaServer.setSdpIp(getSdpIp()); + mediaServer.setStreamIp(getStreamIp()); + mediaServer.setHttpPort(httpPort); + if (flvPort == 0) { + mediaServer.setFlvPort(httpPort); + }else { + mediaServer.setFlvPort(flvPort); + } + if (wsFlvPort == 0) { + mediaServer.setWsFlvPort(httpPort); + }else { + mediaServer.setWsFlvPort(wsFlvPort); + } + if (flvSSlPort == 0) { + mediaServer.setFlvSSLPort(httpSSlPort); + }else { + mediaServer.setFlvSSLPort(flvSSlPort); + } + if (wsFlvSSlPort == 0) { + mediaServer.setWsFlvSSLPort(httpSSlPort); + }else { + mediaServer.setWsFlvSSLPort(wsFlvSSlPort); } - mediaServerItem.setCreateTime(DateUtil.getNow()); - mediaServerItem.setUpdateTime(DateUtil.getNow()); - return mediaServerItem; + mediaServer.setHttpSSlPort(httpSSlPort); + mediaServer.setRtmpPort(rtmpPort); + mediaServer.setRtmpSSlPort(rtmpSSlPort); + mediaServer.setRtpProxyPort(getRtpProxyPort()); + mediaServer.setRtspPort(rtspPort); + mediaServer.setRtspSSLPort(rtspSSLPort); + mediaServer.setAutoConfig(autoConfig); + mediaServer.setSecret(secret); + mediaServer.setRtpEnable(rtpEnable); + mediaServer.setRtpPortRange(rtpPortRange); + mediaServer.setSendRtpPortRange(rtpSendPortRange); + mediaServer.setRecordAssistPort(recordAssistPort); + mediaServer.setHookAliveInterval(10f); + mediaServer.setRecordDay(recordDay); + mediaServer.setStatus(false); + mediaServer.setType(type); + if (recordPath != null) { + mediaServer.setRecordPath(recordPath); + } + mediaServer.setCreateTime(DateUtil.getNow()); + mediaServer.setUpdateTime(DateUtil.getNow()); + + return mediaServer; } public Integer getRecordDay() { diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java index 6473c42f..d34657f5 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/MediaServerMapper.java @@ -27,7 +27,7 @@ public interface MediaServerMapper { "flv_port," + "flv_ssl_port," + "ws_flv_port," + - "ws_flv_ssl__port," + + "ws_flv_ssl_port," + "rtsp_ssl_port,"+ "auto_config,"+ "secret,"+ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 3d36b847..3f478442 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -2,4 +2,4 @@ spring: application: name: wvp profiles: - active: abl \ No newline at end of file + active: local \ No newline at end of file