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

View File

@ -125,11 +125,13 @@ public class ByeRequestProcessor extends SIPRequestProcessorParent implements In
}else {
MediaServer mediaServer = mediaServerService.getOne(sendRtpItem.getMediaServerId());
sendRtpServerService.deleteByCallId(callIdHeader.getCallId());
if (mediaServer != null) {
mediaServerService.stopSendRtp(mediaServer, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getSsrc());
if (userSetting.getUseCustomSsrcForParentInvite()) {
mediaServerService.releaseSsrc(mediaServer.getId(), sendRtpItem.getSsrc());
}
}
}
}else {
log.info("[上级平台停止观看] 未找到平台{}的信息发送redis消息失败", sendRtpItem.getTargetId());
}

View File

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

View File

@ -61,7 +61,7 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService {
callId = streamAuthorityInfo.getCallId();
}
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;
}
Assert.isTrue(streamPush.isStartOfflinePush(), "通道未推流");