From 3de49d1c2a4385eba7c4a05952d7c9356a9bb603 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Mon, 31 Jul 2023 16:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=91=E6=B5=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/conf/UserSetting.java | 10 -------- .../vmp/media/zlm/ZLMRTPServerFactory.java | 23 ++++++------------- src/main/resources/all-application.yml | 3 --- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java b/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java index b3ccf773..aa98d58d 100644 --- a/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java +++ b/src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java @@ -43,8 +43,6 @@ public class UserSetting { private Boolean pushAuthority = Boolean.TRUE; - private Boolean gbSendStreamStrict = Boolean.FALSE; - private Boolean syncChannelOnDeviceOnline = Boolean.FALSE; private Boolean sipLog = Boolean.FALSE; @@ -204,14 +202,6 @@ public class UserSetting { this.pushAuthority = pushAuthority; } - public Boolean getGbSendStreamStrict() { - return gbSendStreamStrict; - } - - public void setGbSendStreamStrict(Boolean gbSendStreamStrict) { - this.gbSendStreamStrict = gbSendStreamStrict; - } - public Boolean getSyncChannelOnDeviceOnline() { return syncChannelOnDeviceOnline; } diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java index 76ab7332..0f0c139d 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java @@ -163,15 +163,9 @@ public class ZLMRTPServerFactory { public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, String deviceId, String channelId, boolean tcp, boolean rtcp){ - // 默认为随机端口 - int localPort = 0; - if (userSetting.getGbSendStreamStrict()) { - if (userSetting.getGbSendStreamStrict()) { - localPort = sendRtpPortManager.getNextPort(serverItem); - if (localPort == 0) { - return null; - } - } + int localPort = sendRtpPortManager.getNextPort(serverItem); + if (localPort == 0) { + return null; } SendRtpItem sendRtpItem = new SendRtpItem(); sendRtpItem.setIp(ip); @@ -201,13 +195,10 @@ public class ZLMRTPServerFactory { */ public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, String app, String stream, String channelId, boolean tcp, boolean rtcp){ - // 默认为随机端口 - int localPort = 0; - if (userSetting.getGbSendStreamStrict()) { - localPort = sendRtpPortManager.getNextPort(serverItem); - if (localPort == 0) { - return null; - } + + int localPort = sendRtpPortManager.getNextPort(serverItem); + if (localPort == 0) { + return null; } SendRtpItem sendRtpItem = new SendRtpItem(); sendRtpItem.setIp(ip); diff --git a/src/main/resources/all-application.yml b/src/main/resources/all-application.yml index ceaa82f7..8ad1d31c 100644 --- a/src/main/resources/all-application.yml +++ b/src/main/resources/all-application.yml @@ -170,9 +170,6 @@ user-settings: stream-on-demand: true # 推流鉴权, 默认开启 push-authority: true - # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能, - # 非严格模式使用随机端口发流,性能更好, 默认关闭 - gb-send-stream-strict: false # 设备上线时是否自动同步通道 sync-channel-on-device-online: false # 是否使用设备来源Ip作为回复IP, 不设置则为 false