Commit e5cba6022fa49747eecba79d4490bc10187befd7
Merge branch '2.6.8' into wvp-28181-2.0
# Conflicts: # src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java # src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
Showing
4 changed files
with
25 additions
and
33 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; |
| ... | ... | @@ -206,14 +204,6 @@ public class UserSetting { |
| 206 | 204 | this.pushAuthority = pushAuthority; |
| 207 | 205 | } |
| 208 | 206 | |
| 209 | - public Boolean getGbSendStreamStrict() { | |
| 210 | - return gbSendStreamStrict; | |
| 211 | - } | |
| 212 | - | |
| 213 | - public void setGbSendStreamStrict(Boolean gbSendStreamStrict) { | |
| 214 | - this.gbSendStreamStrict = gbSendStreamStrict; | |
| 215 | - } | |
| 216 | - | |
| 217 | 207 | public Boolean getSyncChannelOnDeviceOnline() { |
| 218 | 208 | return syncChannelOnDeviceOnline; |
| 219 | 209 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java
| ... | ... | @@ -164,13 +164,9 @@ public class ZLMServerFactory { |
| 164 | 164 | public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, |
| 165 | 165 | String deviceId, String channelId, boolean tcp, boolean rtcp){ |
| 166 | 166 | |
| 167 | - // 默认为随机端口 | |
| 168 | - int localPort = 0; | |
| 169 | - if (userSetting.getGbSendStreamStrict()) { | |
| 170 | - localPort = sendRtpPortManager.getNextPort(serverItem); | |
| 171 | - if (localPort == 0) { | |
| 172 | - return null; | |
| 173 | - } | |
| 167 | + int localPort = sendRtpPortManager.getNextPort(serverItem); | |
| 168 | + if (localPort == 0) { | |
| 169 | + return null; | |
| 174 | 170 | } |
| 175 | 171 | SendRtpItem sendRtpItem = new SendRtpItem(); |
| 176 | 172 | sendRtpItem.setIp(ip); |
| ... | ... | @@ -200,13 +196,10 @@ public class ZLMServerFactory { |
| 200 | 196 | */ |
| 201 | 197 | public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, |
| 202 | 198 | String app, String stream, String channelId, boolean tcp, boolean rtcp){ |
| 203 | - // 默认为随机端口 | |
| 204 | - int localPort = 0; | |
| 205 | - if (userSetting.getGbSendStreamStrict()) { | |
| 206 | - localPort = sendRtpPortManager.getNextPort(serverItem); | |
| 207 | - if (localPort == 0) { | |
| 208 | - return null; | |
| 209 | - } | |
| 199 | + | |
| 200 | + int localPort = sendRtpPortManager.getNextPort(serverItem); | |
| 201 | + if (localPort == 0) { | |
| 202 | + return null; | |
| 210 | 203 | } |
| 211 | 204 | SendRtpItem sendRtpItem = new SendRtpItem(); |
| 212 | 205 | sendRtpItem.setIp(ip); | ... | ... |
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
| ... | ... | @@ -133,17 +133,29 @@ public class ApiStreamController { |
| 133 | 133 | result.put("ChannelName", deviceChannel.getName()); |
| 134 | 134 | result.put("ChannelCustomName", ""); |
| 135 | 135 | result.put("FLV", inviteInfo.getStreamInfo().getFlv().getUrl()); |
| 136 | - result.put("HTTPS_FLV", inviteInfo.getStreamInfo().getHttps_flv().getUrl()); | |
| 136 | + if(inviteInfo.getStreamInfo().getHttps_flv() != null) { | |
| 137 | + result.put("HTTPS_FLV", inviteInfo.getStreamInfo().getHttps_flv().getUrl()); | |
| 138 | + } | |
| 137 | 139 | result.put("WS_FLV", inviteInfo.getStreamInfo().getWs_flv().getUrl()); |
| 138 | - result.put("WSS_FLV", inviteInfo.getStreamInfo().getWss_flv().getUrl()); | |
| 140 | + if(inviteInfo.getStreamInfo().getWss_flv() != null) { | |
| 141 | + result.put("WSS_FLV", inviteInfo.getStreamInfo().getWss_flv().getUrl()); | |
| 142 | + } | |
| 139 | 143 | result.put("RTMP", inviteInfo.getStreamInfo().getRtmp().getUrl()); |
| 140 | - result.put("RTMPS", inviteInfo.getStreamInfo().getRtmps().getUrl()); | |
| 144 | + if (inviteInfo.getStreamInfo().getRtmps() != null) { | |
| 145 | + result.put("RTMPS", inviteInfo.getStreamInfo().getRtmps().getUrl()); | |
| 146 | + } | |
| 141 | 147 | result.put("HLS", inviteInfo.getStreamInfo().getHls().getUrl()); |
| 142 | - result.put("HTTPS_HLS", inviteInfo.getStreamInfo().getHttps_hls().getUrl()); | |
| 148 | + if (inviteInfo.getStreamInfo().getHttps_hls() != null) { | |
| 149 | + result.put("HTTPS_HLS", inviteInfo.getStreamInfo().getHttps_hls().getUrl()); | |
| 150 | + } | |
| 143 | 151 | result.put("RTSP", inviteInfo.getStreamInfo().getRtsp().getUrl()); |
| 144 | - result.put("RTSPS", inviteInfo.getStreamInfo().getRtsps().getUrl()); | |
| 152 | + if (inviteInfo.getStreamInfo().getRtsps() != null) { | |
| 153 | + result.put("RTSPS", inviteInfo.getStreamInfo().getRtsps().getUrl()); | |
| 154 | + } | |
| 145 | 155 | result.put("WEBRTC", inviteInfo.getStreamInfo().getRtc().getUrl()); |
| 146 | - result.put("HTTPS_WEBRTC", inviteInfo.getStreamInfo().getRtcs().getUrl()); | |
| 156 | + if (inviteInfo.getStreamInfo().getRtcs() != null) { | |
| 157 | + result.put("HTTPS_WEBRTC", inviteInfo.getStreamInfo().getRtcs().getUrl()); | |
| 158 | + } | |
| 147 | 159 | result.put("CDN", ""); |
| 148 | 160 | result.put("SnapURL", ""); |
| 149 | 161 | result.put("Transport", device.getTransport()); | ... | ... |
src/main/resources/all-application.yml
| ... | ... | @@ -187,9 +187,6 @@ user-settings: |
| 187 | 187 | stream-on-demand: true |
| 188 | 188 | # 推流鉴权, 默认开启 |
| 189 | 189 | push-authority: true |
| 190 | - # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能, | |
| 191 | - # 非严格模式使用随机端口发流,性能更好, 默认关闭 | |
| 192 | - gb-send-stream-strict: false | |
| 193 | 190 | # 设备上线时是否自动同步通道 |
| 194 | 191 | sync-channel-on-device-online: false |
| 195 | 192 | # 是否使用设备来源Ip作为回复IP, 不设置则为 false | ... | ... |