Commit 3de49d1c2a4385eba7c4a05952d7c9356a9bb603

Authored by 648540858
1 parent 17ea3750

优化发流逻辑

src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java
@@ -43,8 +43,6 @@ public class UserSetting { @@ -43,8 +43,6 @@ public class UserSetting {
43 43
44 private Boolean pushAuthority = Boolean.TRUE; 44 private Boolean pushAuthority = Boolean.TRUE;
45 45
46 - private Boolean gbSendStreamStrict = Boolean.FALSE;  
47 -  
48 private Boolean syncChannelOnDeviceOnline = Boolean.FALSE; 46 private Boolean syncChannelOnDeviceOnline = Boolean.FALSE;
49 47
50 private Boolean sipLog = Boolean.FALSE; 48 private Boolean sipLog = Boolean.FALSE;
@@ -204,14 +202,6 @@ public class UserSetting { @@ -204,14 +202,6 @@ public class UserSetting {
204 this.pushAuthority = pushAuthority; 202 this.pushAuthority = pushAuthority;
205 } 203 }
206 204
207 - public Boolean getGbSendStreamStrict() {  
208 - return gbSendStreamStrict;  
209 - }  
210 -  
211 - public void setGbSendStreamStrict(Boolean gbSendStreamStrict) {  
212 - this.gbSendStreamStrict = gbSendStreamStrict;  
213 - }  
214 -  
215 public Boolean getSyncChannelOnDeviceOnline() { 205 public Boolean getSyncChannelOnDeviceOnline() {
216 return syncChannelOnDeviceOnline; 206 return syncChannelOnDeviceOnline;
217 } 207 }
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
@@ -163,15 +163,9 @@ public class ZLMRTPServerFactory { @@ -163,15 +163,9 @@ public class ZLMRTPServerFactory {
163 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, 163 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
164 String deviceId, String channelId, boolean tcp, boolean rtcp){ 164 String deviceId, String channelId, boolean tcp, boolean rtcp){
165 165
166 - // 默认为随机端口  
167 - int localPort = 0;  
168 - if (userSetting.getGbSendStreamStrict()) {  
169 - if (userSetting.getGbSendStreamStrict()) {  
170 - localPort = sendRtpPortManager.getNextPort(serverItem);  
171 - if (localPort == 0) {  
172 - return null;  
173 - }  
174 - } 166 + int localPort = sendRtpPortManager.getNextPort(serverItem);
  167 + if (localPort == 0) {
  168 + return null;
175 } 169 }
176 SendRtpItem sendRtpItem = new SendRtpItem(); 170 SendRtpItem sendRtpItem = new SendRtpItem();
177 sendRtpItem.setIp(ip); 171 sendRtpItem.setIp(ip);
@@ -201,13 +195,10 @@ public class ZLMRTPServerFactory { @@ -201,13 +195,10 @@ public class ZLMRTPServerFactory {
201 */ 195 */
202 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, 196 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
203 String app, String stream, String channelId, boolean tcp, boolean rtcp){ 197 String app, String stream, String channelId, boolean tcp, boolean rtcp){
204 - // 默认为随机端口  
205 - int localPort = 0;  
206 - if (userSetting.getGbSendStreamStrict()) {  
207 - localPort = sendRtpPortManager.getNextPort(serverItem);  
208 - if (localPort == 0) {  
209 - return null;  
210 - } 198 +
  199 + int localPort = sendRtpPortManager.getNextPort(serverItem);
  200 + if (localPort == 0) {
  201 + return null;
211 } 202 }
212 SendRtpItem sendRtpItem = new SendRtpItem(); 203 SendRtpItem sendRtpItem = new SendRtpItem();
213 sendRtpItem.setIp(ip); 204 sendRtpItem.setIp(ip);
src/main/resources/all-application.yml
@@ -170,9 +170,6 @@ user-settings: @@ -170,9 +170,6 @@ user-settings:
170 stream-on-demand: true 170 stream-on-demand: true
171 # 推流鉴权, 默认开启 171 # 推流鉴权, 默认开启
172 push-authority: true 172 push-authority: true
173 - # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能,  
174 - # 非严格模式使用随机端口发流,性能更好, 默认关闭  
175 - gb-send-stream-strict: false  
176 # 设备上线时是否自动同步通道 173 # 设备上线时是否自动同步通道
177 sync-channel-on-device-online: false 174 sync-channel-on-device-online: false
178 # 是否使用设备来源Ip作为回复IP, 不设置则为 false 175 # 是否使用设备来源Ip作为回复IP, 不设置则为 false