修复多个wvp推流是国标级联的点播

pull/1642/head
648540858 2024-09-25 16:05:04 +08:00
parent af7873a62c
commit 9a9caed0a6
4 changed files with 14 additions and 11 deletions

View File

@ -102,7 +102,7 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
log.info("收到ACKrtp/{} TCP主动方式后续处理", sendRtpItem.getStream()); log.info("收到ACKrtp/{} TCP主动方式后续处理", sendRtpItem.getStream());
return; return;
} }
MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId());
log.info("收到ACKrtp/{}开始向上级推流, 目标={}:{}SSRC={}, 协议:{}", log.info("收到ACKrtp/{}开始向上级推流, 目标={}:{}SSRC={}, 协议:{}",
sendRtpItem.getStream(), sendRtpItem.getStream(),
sendRtpItem.getIp(), sendRtpItem.getIp(),
@ -121,11 +121,11 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
} }
} else { } else {
try { try {
if (mediaInfo != null) { if (mediaServer != null) {
if (sendRtpItem.isTcpActive()) { if (sendRtpItem.isTcpActive()) {
mediaServerService.startSendRtpPassive(mediaInfo,sendRtpItem, null); mediaServerService.startSendRtpPassive(mediaServer,sendRtpItem, null);
} else { } else {
mediaServerService.startSendRtp(mediaInfo, sendRtpItem); mediaServerService.startSendRtp(mediaServer, sendRtpItem);
} }
}else { }else {
// mediaInfo 在集群的其他wvp里 // mediaInfo 在集群的其他wvp里
@ -148,15 +148,15 @@ public class AckRequestProcessor extends SIPRequestProcessorParent implements In
if (!device.isBroadcastPushAfterAck()) { if (!device.isBroadcastPushAfterAck()) {
return; return;
} }
if (mediaInfo == null) { if (mediaServer == null) {
log.warn("[收到ACK]:来自{},目标为({})的推流信息为找到流体服务[{}]信息",fromUserId, toUserId, sendRtpItem.getMediaServerId()); log.warn("[收到ACK]:来自{},目标为({})的推流信息为找到流体服务[{}]信息",fromUserId, toUserId, sendRtpItem.getMediaServerId());
return; return;
} }
try { try {
if (sendRtpItem.isTcpActive()) { if (sendRtpItem.isTcpActive()) {
mediaServerService.startSendRtpPassive(mediaInfo, sendRtpItem, null); mediaServerService.startSendRtpPassive(mediaServer, sendRtpItem, null);
} else { } else {
mediaServerService.startSendRtp(mediaInfo, sendRtpItem); mediaServerService.startSendRtp(mediaServer, sendRtpItem);
} }
}catch (ControllerException e) { }catch (ControllerException e) {
log.error("RTP推流失败: {}", e.getMessage()); log.error("RTP推流失败: {}", e.getMessage());

View File

@ -125,9 +125,11 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
}else { }else {
MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId()); MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId());
sendRtpServerService.deleteByCallId(callIdHeader.getCallId()); sendRtpServerService.deleteByCallId(callIdHeader.getCallId());
mediaServerService.stopSendRtp(mediaServer, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc()); if (mediaServer != null) {
if (userSetting.getUseCustomSsrcForParentInvite()) { mediaServerService.stopSendRtp(mediaServer, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc());
mediaServerService.releaseSsrc(mediaServer.getId(), sendRtpItem.getSsrc()); if (userSetting.getUseCustomSsrcForParentInvite()) {
mediaServerService.releaseSsrc(mediaServer.getId(), sendRtpItem.getSsrc());
}
} }
} }
}else { }else {

View File

@ -795,6 +795,7 @@ public class MediaServerServiceImpl implements IMediaServerService {
} }
streamInfoResult.setIp(addr); streamInfoResult.setIp(addr);
streamInfoResult.setServerId(mediaInfo.getServerId());
streamInfoResult.setMediaServer(mediaServer); streamInfoResult.setMediaServer(mediaServer);
String callIdParam = ObjectUtils.isEmpty(callId)?"":"?callId=" + callId; String callIdParam = ObjectUtils.isEmpty(callId)?"":"?callId=" + callId;
streamInfoResult.setRtmp(addr, mediaServer.getRtmpPort(),mediaServer.getRtmpSSlPort(), app, stream, callIdParam); streamInfoResult.setRtmp(addr, mediaServer.getRtmpPort(),mediaServer.getRtmpSSlPort(), app, stream, callIdParam);

View File

@ -61,7 +61,7 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService {
callId = streamAuthorityInfo.getCallId(); callId = streamAuthorityInfo.getCallId();
} }
callback.run(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), mediaServerService.getStreamInfoByAppAndStream(mediaInfo.getMediaServer(), callback.run(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), mediaServerService.getStreamInfoByAppAndStream(mediaInfo.getMediaServer(),
streamPush.getApp(), streamPush.getStream(), null, callId)); streamPush.getApp(), streamPush.getStream(), mediaInfo, callId));
return; return;
} }
Assert.isTrue(streamPush.isStartOfflinePush(), "通道未推流"); Assert.isTrue(streamPush.isStartOfflinePush(), "通道未推流");