优化录像下载。 支持八倍速(设备支持的最高速度)下载

This commit is contained in:
lin
2025-03-13 16:48:15 +08:00
parent 1869945ff1
commit 298fb05378
9 changed files with 65 additions and 29 deletions

View File

@@ -14,7 +14,6 @@ import com.genersoft.iot.vmp.media.event.hook.Hook;
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
import com.genersoft.iot.vmp.media.event.hook.HookType;
import com.genersoft.iot.vmp.service.ISendRtpServerService;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import gov.nist.javax.sip.message.SIPRequest;
import lombok.extern.slf4j.Slf4j;
import org.dom4j.Element;
@@ -101,23 +100,25 @@ public class MediaStatusNotifyMessageHandler extends SIPRequestProcessorParent i
// 去除监听流注销自动停止下载的监听
Hook hook = Hook.getInstance(HookType.on_media_arrival, "rtp", ssrcTransaction.getStream(), ssrcTransaction.getMediaServerId());
subscribe.removeSubscribe(hook);
// 如果级联播放,需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题需要将点播CallId进行上下级绑定
SendRtpInfo sendRtpInfo = sendRtpServerService.queryByChannelId(ssrcTransaction.getChannelId(), ssrcTransaction.getPlatformId());
if (sendRtpInfo != null) {
Platform parentPlatform = platformService.queryPlatformByServerGBId(sendRtpInfo.getTargetId());
if (parentPlatform == null) {
log.warn("[级联消息发送]发送MediaStatus发现上级平台{}不存在", sendRtpInfo.getTargetId());
return;
}
CommonGBChannel channel = platformChannelService.queryChannelByPlatformIdAndChannelId(parentPlatform.getId(), sendRtpInfo.getChannelId());
if (channel == null) {
log.warn("[级联消息发送]发送MediaStatus发现通道{}不存在", sendRtpInfo.getChannelId());
return;
}
try {
sipCommanderFroPlatform.sendMediaStatusNotify(parentPlatform, sendRtpInfo, channel);
} catch (SipException | InvalidArgumentException | ParseException e) {
log.error("[命令发送失败] 国标级联 录像播放完毕: {}", e.getMessage());
if (ssrcTransaction.getPlatformId() != null) {
// 如果级联播放,需要给上级发送此通知 TODO 多个上级同时观看一个下级 可能存在停错的问题需要将点播CallId进行上下级绑定
SendRtpInfo sendRtpInfo = sendRtpServerService.queryByChannelId(ssrcTransaction.getChannelId(), ssrcTransaction.getPlatformId());
if (sendRtpInfo != null) {
Platform parentPlatform = platformService.queryPlatformByServerGBId(sendRtpInfo.getTargetId());
if (parentPlatform == null) {
log.warn("[级联消息发送]发送MediaStatus发现上级平台{}不存在", sendRtpInfo.getTargetId());
return;
}
CommonGBChannel channel = platformChannelService.queryChannelByPlatformIdAndChannelId(parentPlatform.getId(), sendRtpInfo.getChannelId());
if (channel == null) {
log.warn("[级联消息发送]发送MediaStatus发现通道{}不存在", sendRtpInfo.getChannelId());
return;
}
try {
sipCommanderFroPlatform.sendMediaStatusNotify(parentPlatform, sendRtpInfo, channel);
} catch (SipException | InvalidArgumentException | ParseException e) {
log.error("[命令发送失败] 国标级联 录像播放完毕: {}", e.getMessage());
}
}
}
}else {