优化发流逻辑

pull/981/head
648540858 2023-07-31 16:42:12 +08:00
parent 17ea37506e
commit 3de49d1c2a
3 changed files with 7 additions and 29 deletions

View File

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

View File

@ -163,16 +163,10 @@ public class ZLMRTPServerFactory {
public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
String deviceId, String channelId, boolean tcp, boolean rtcp){
// 默认为随机端口
int localPort = 0;
if (userSetting.getGbSendStreamStrict()) {
if (userSetting.getGbSendStreamStrict()) {
localPort = sendRtpPortManager.getNextPort(serverItem);
int localPort = sendRtpPortManager.getNextPort(serverItem);
if (localPort == 0) {
return null;
}
}
}
SendRtpItem sendRtpItem = new SendRtpItem();
sendRtpItem.setIp(ip);
sendRtpItem.setPort(port);
@ -201,14 +195,11 @@ public class ZLMRTPServerFactory {
*/
public SendRtpItem createSendRtpItem(MediaServerItem serverItem, String ip, int port, String ssrc, String platformId,
String app, String stream, String channelId, boolean tcp, boolean rtcp){
// 默认为随机端口
int localPort = 0;
if (userSetting.getGbSendStreamStrict()) {
localPort = sendRtpPortManager.getNextPort(serverItem);
int localPort = sendRtpPortManager.getNextPort(serverItem);
if (localPort == 0) {
return null;
}
}
SendRtpItem sendRtpItem = new SendRtpItem();
sendRtpItem.setIp(ip);
sendRtpItem.setPort(port);

View File

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