收流时设置re_use_port参数解决端口关闭快速打开造成的端口未释放问题, 支持点播的tcp主动
This commit is contained in:
@@ -247,6 +247,17 @@ public class Device {
|
||||
return streamMode;
|
||||
}
|
||||
|
||||
public Integer getStreamModeForParam() {
|
||||
if (streamMode.equalsIgnoreCase("UDP")) {
|
||||
return 0;
|
||||
}else if (streamMode.equalsIgnoreCase("TCP-PASSIVE")) {
|
||||
return 1;
|
||||
}else if (streamMode.equalsIgnoreCase("TCP-ACTIVE")) {
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setStreamMode(String streamMode) {
|
||||
this.streamMode = streamMode;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
sendRtpItem.setApp("rtp");
|
||||
if ("Playback".equalsIgnoreCase(sessionName)) {
|
||||
sendRtpItem.setPlayType(InviteStreamType.PLAYBACK);
|
||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, null, device.isSsrcCheck(), true);
|
||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, null, null, device.isSsrcCheck(), true, 0, false, device.getStreamModeForParam());
|
||||
sendRtpItem.setStreamId(ssrcInfo.getStream());
|
||||
// 写入redis, 超时时回复
|
||||
redisCatchStorage.updateSendRTPSever(sendRtpItem);
|
||||
@@ -469,7 +469,7 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
||||
if (mediaServerItem.isRtpEnable()) {
|
||||
streamId = String.format("%s_%s", device.getDeviceId(), channelId);
|
||||
}
|
||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, null, device.isSsrcCheck(), false);
|
||||
SSRCInfo ssrcInfo = mediaServerService.openRTPServer(mediaServerItem, streamId, null, device.isSsrcCheck(), false, 0, false, device.getStreamModeForParam());
|
||||
logger.info(JSONObject.toJSONString(ssrcInfo));
|
||||
sendRtpItem.setStreamId(ssrcInfo.getStream());
|
||||
sendRtpItem.setSsrc(ssrc.equals(ssrcDefault) ? ssrcInfo.getSsrc() : ssrc);
|
||||
|
||||
Reference in New Issue
Block a user