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
pull/981/head
648540858 2023-08-01 10:28:41 +08:00
commit e5cba6022f
4 changed files with 25 additions and 33 deletions

View File

@ -43,8 +43,6 @@ public class UserSetting {
private Boolean pushAuthority = Boolean.TRUE; private Boolean pushAuthority = Boolean.TRUE;
private Boolean gbSendStreamStrict = Boolean.FALSE;
private Boolean syncChannelOnDeviceOnline = Boolean.FALSE; private Boolean syncChannelOnDeviceOnline = Boolean.FALSE;
private Boolean sipLog = Boolean.FALSE; private Boolean sipLog = Boolean.FALSE;
@ -206,14 +204,6 @@ public class UserSetting {
this.pushAuthority = pushAuthority; this.pushAuthority = pushAuthority;
} }
public Boolean getGbSendStreamStrict() {
return gbSendStreamStrict;
}
public void setGbSendStreamStrict(Boolean gbSendStreamStrict) {
this.gbSendStreamStrict = gbSendStreamStrict;
}
public Boolean getSyncChannelOnDeviceOnline() { public Boolean getSyncChannelOnDeviceOnline() {
return syncChannelOnDeviceOnline; return syncChannelOnDeviceOnline;
} }

View File

@ -164,13 +164,9 @@ public class ZLMServerFactory {
public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
String deviceId, String channelId, boolean tcp, boolean rtcp){ String deviceId, String channelId, boolean tcp, boolean rtcp){
// 默认为随机端口 int localPort = sendRtpPortManager.getNextPort(serverItem);
int localPort = 0; if (localPort == 0) {
if (userSetting.getGbSendStreamStrict()) { return null;
localPort = sendRtpPortManager.getNextPort(serverItem);
if (localPort == 0) {
return null;
}
} }
SendRtpItem sendRtpItem = new SendRtpItem(); SendRtpItem sendRtpItem = new SendRtpItem();
sendRtpItem.setIp(ip); sendRtpItem.setIp(ip);
@ -200,13 +196,10 @@ public class ZLMServerFactory {
*/ */
public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId, public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
String app, String stream, String channelId, boolean tcp, boolean rtcp){ String app, String stream, String channelId, boolean tcp, boolean rtcp){
// 默认为随机端口
int localPort = 0; int localPort = sendRtpPortManager.getNextPort(serverItem);
if (userSetting.getGbSendStreamStrict()) { if (localPort == 0) {
localPort = sendRtpPortManager.getNextPort(serverItem); return null;
if (localPort == 0) {
return null;
}
} }
SendRtpItem sendRtpItem = new SendRtpItem(); SendRtpItem sendRtpItem = new SendRtpItem();
sendRtpItem.setIp(ip); sendRtpItem.setIp(ip);

View File

@ -133,17 +133,29 @@ public class ApiStreamController {
result.put("ChannelName", deviceChannel.getName()); result.put("ChannelName", deviceChannel.getName());
result.put("ChannelCustomName", ""); result.put("ChannelCustomName", "");
result.put("FLV", inviteInfo.getStreamInfo().getFlv().getUrl()); result.put("FLV", inviteInfo.getStreamInfo().getFlv().getUrl());
result.put("HTTPS_FLV", inviteInfo.getStreamInfo().getHttps_flv().getUrl()); if(inviteInfo.getStreamInfo().getHttps_flv() != null) {
result.put("HTTPS_FLV", inviteInfo.getStreamInfo().getHttps_flv().getUrl());
}
result.put("WS_FLV", inviteInfo.getStreamInfo().getWs_flv().getUrl()); result.put("WS_FLV", inviteInfo.getStreamInfo().getWs_flv().getUrl());
result.put("WSS_FLV", inviteInfo.getStreamInfo().getWss_flv().getUrl()); if(inviteInfo.getStreamInfo().getWss_flv() != null) {
result.put("WSS_FLV", inviteInfo.getStreamInfo().getWss_flv().getUrl());
}
result.put("RTMP", inviteInfo.getStreamInfo().getRtmp().getUrl()); result.put("RTMP", inviteInfo.getStreamInfo().getRtmp().getUrl());
result.put("RTMPS", inviteInfo.getStreamInfo().getRtmps().getUrl()); if (inviteInfo.getStreamInfo().getRtmps() != null) {
result.put("RTMPS", inviteInfo.getStreamInfo().getRtmps().getUrl());
}
result.put("HLS", inviteInfo.getStreamInfo().getHls().getUrl()); result.put("HLS", inviteInfo.getStreamInfo().getHls().getUrl());
result.put("HTTPS_HLS", inviteInfo.getStreamInfo().getHttps_hls().getUrl()); if (inviteInfo.getStreamInfo().getHttps_hls() != null) {
result.put("HTTPS_HLS", inviteInfo.getStreamInfo().getHttps_hls().getUrl());
}
result.put("RTSP", inviteInfo.getStreamInfo().getRtsp().getUrl()); result.put("RTSP", inviteInfo.getStreamInfo().getRtsp().getUrl());
result.put("RTSPS", inviteInfo.getStreamInfo().getRtsps().getUrl()); if (inviteInfo.getStreamInfo().getRtsps() != null) {
result.put("RTSPS", inviteInfo.getStreamInfo().getRtsps().getUrl());
}
result.put("WEBRTC", inviteInfo.getStreamInfo().getRtc().getUrl()); result.put("WEBRTC", inviteInfo.getStreamInfo().getRtc().getUrl());
result.put("HTTPS_WEBRTC", inviteInfo.getStreamInfo().getRtcs().getUrl()); if (inviteInfo.getStreamInfo().getRtcs() != null) {
result.put("HTTPS_WEBRTC", inviteInfo.getStreamInfo().getRtcs().getUrl());
}
result.put("CDN", ""); result.put("CDN", "");
result.put("SnapURL", ""); result.put("SnapURL", "");
result.put("Transport", device.getTransport()); result.put("Transport", device.getTransport());

View File

@ -187,9 +187,6 @@ user-settings:
stream-on-demand: true stream-on-demand: true
# 推流鉴权, 默认开启 # 推流鉴权, 默认开启
push-authority: true push-authority: true
# 国标级联发流严格模式严格模式会使用与sdp信息中一致的端口发流端口共享media.rtp.port-range这会损失一些性能
# 非严格模式使用随机端口发流,性能更好, 默认关闭
gb-send-stream-strict: false
# 设备上线时是否自动同步通道 # 设备上线时是否自动同步通道
sync-channel-on-device-online: false sync-channel-on-device-online: false
# 是否使用设备来源Ip作为回复IP 不设置则为 false # 是否使用设备来源Ip作为回复IP 不设置则为 false