Commit e5cba6022fa49747eecba79d4490bc10187befd7

Authored by 648540858
2 parents 095a3e13 3de49d1c

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
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;
@@ -206,14 +204,6 @@ public class UserSetting { @@ -206,14 +204,6 @@ public class UserSetting {
206 this.pushAuthority = pushAuthority; 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 public Boolean getSyncChannelOnDeviceOnline() { 207 public Boolean getSyncChannelOnDeviceOnline() {
218 return syncChannelOnDeviceOnline; 208 return syncChannelOnDeviceOnline;
219 } 209 }
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMServerFactory.java
@@ -164,13 +164,9 @@ public class ZLMServerFactory { @@ -164,13 +164,9 @@ public class ZLMServerFactory {
164 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, 164 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
165 String deviceId, String channelId, boolean tcp, boolean rtcp){ 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 SendRtpItem sendRtpItem = new SendRtpItem(); 171 SendRtpItem sendRtpItem = new SendRtpItem();
176 sendRtpItem.setIp(ip); 172 sendRtpItem.setIp(ip);
@@ -200,13 +196,10 @@ public class ZLMServerFactory { @@ -200,13 +196,10 @@ public class ZLMServerFactory {
200 */ 196 */
201 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, 197 public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
202 String app, String stream, String channelId, boolean tcp, boolean rtcp){ 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 SendRtpItem sendRtpItem = new SendRtpItem(); 204 SendRtpItem sendRtpItem = new SendRtpItem();
212 sendRtpItem.setIp(ip); 205 sendRtpItem.setIp(ip);
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiStreamController.java
@@ -133,17 +133,29 @@ public class ApiStreamController { @@ -133,17 +133,29 @@ public class ApiStreamController {
133 result.put("ChannelName", deviceChannel.getName()); 133 result.put("ChannelName", deviceChannel.getName());
134 result.put("ChannelCustomName", ""); 134 result.put("ChannelCustomName", "");
135 result.put("FLV", inviteInfo.getStreamInfo().getFlv().getUrl()); 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 result.put("WS_FLV", inviteInfo.getStreamInfo().getWs_flv().getUrl()); 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 result.put("RTMP", inviteInfo.getStreamInfo().getRtmp().getUrl()); 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 result.put("HLS", inviteInfo.getStreamInfo().getHls().getUrl()); 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 result.put("RTSP", inviteInfo.getStreamInfo().getRtsp().getUrl()); 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 result.put("WEBRTC", inviteInfo.getStreamInfo().getRtc().getUrl()); 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 result.put("CDN", ""); 159 result.put("CDN", "");
148 result.put("SnapURL", ""); 160 result.put("SnapURL", "");
149 result.put("Transport", device.getTransport()); 161 result.put("Transport", device.getTransport());
src/main/resources/all-application.yml
@@ -187,9 +187,6 @@ user-settings: @@ -187,9 +187,6 @@ user-settings:
187 stream-on-demand: true 187 stream-on-demand: true
188 # 推流鉴权, 默认开启 188 # 推流鉴权, 默认开启
189 push-authority: true 189 push-authority: true
190 - # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能,  
191 - # 非严格模式使用随机端口发流,性能更好, 默认关闭  
192 - gb-send-stream-strict: false  
193 # 设备上线时是否自动同步通道 190 # 设备上线时是否自动同步通道
194 sync-channel-on-device-online: false 191 sync-channel-on-device-online: false
195 # 是否使用设备来源Ip作为回复IP, 不设置则为 false 192 # 是否使用设备来源Ip作为回复IP, 不设置则为 false