Commit 3de49d1c2a4385eba7c4a05952d7c9356a9bb603
1 parent
17ea3750
优化发流逻辑
Showing
3 changed files
with
7 additions
and
29 deletions
src/main/java/com/genersoft/iot/vmp/conf/UserSetting.java
| ... | ... | @@ -43,8 +43,6 @@ public class UserSetting { |
| 43 | 43 | |
| 44 | 44 | private Boolean pushAuthority = Boolean.TRUE; |
| 45 | 45 | |
| 46 | - private Boolean gbSendStreamStrict = Boolean.FALSE; | |
| 47 | - | |
| 48 | 46 | private Boolean syncChannelOnDeviceOnline = Boolean.FALSE; |
| 49 | 47 | |
| 50 | 48 | private Boolean sipLog = Boolean.FALSE; |
| ... | ... | @@ -204,14 +202,6 @@ public class UserSetting { |
| 204 | 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 | 205 | public Boolean getSyncChannelOnDeviceOnline() { |
| 216 | 206 | return syncChannelOnDeviceOnline; |
| 217 | 207 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java
| ... | ... | @@ -163,15 +163,9 @@ public class ZLMRTPServerFactory { |
| 163 | 163 | public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, |
| 164 | 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 | 170 | SendRtpItem sendRtpItem = new SendRtpItem(); |
| 177 | 171 | sendRtpItem.setIp(ip); |
| ... | ... | @@ -201,13 +195,10 @@ public class ZLMRTPServerFactory { |
| 201 | 195 | */ |
| 202 | 196 | public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, |
| 203 | 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 | 203 | SendRtpItem sendRtpItem = new SendRtpItem(); |
| 213 | 204 | sendRtpItem.setIp(ip); | ... | ... |
src/main/resources/all-application.yml
| ... | ... | @@ -170,9 +170,6 @@ user-settings: |
| 170 | 170 | stream-on-demand: true |
| 171 | 171 | # 推流鉴权, 默认开启 |
| 172 | 172 | push-authority: true |
| 173 | - # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能, | |
| 174 | - # 非严格模式使用随机端口发流,性能更好, 默认关闭 | |
| 175 | - gb-send-stream-strict: false | |
| 176 | 173 | # 设备上线时是否自动同步通道 |
| 177 | 174 | sync-channel-on-device-online: false |
| 178 | 175 | # 是否使用设备来源Ip作为回复IP, 不设置则为 false | ... | ... |