From 5e82aa5f39981e6ba0909a493f091954cebd24c8 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 20 六月 2024 20:04:48 +0800
Subject: [PATCH] 优化拉流代理国标级联点播
---
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java | 36 ++++++++++++++++++++++++++----------
1 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
index 0a45552..9f09e8a 100755
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
@@ -82,12 +82,8 @@
@Override
public void resetAllCSEQ() {
- String scanKey = VideoManagerConstants.SIP_CSEQ_PREFIX + userSetting.getServerId() + "_*";
- List<Object> keys = RedisUtil.scan(redisTemplate, scanKey);
- for (Object o : keys) {
- String key = (String) o;
- redisTemplate.opsForValue().set(key, 1);
- }
+ String key = VideoManagerConstants.SIP_CSEQ_PREFIX + userSetting.getServerId();
+ redisTemplate.opsForValue().set(key, 1);
}
@Override
@@ -501,6 +497,20 @@
}
@Override
+ public MediaInfo getProxyStream(String app, String streamId) {
+ String scanKey = VideoManagerConstants.WVP_SERVER_STREAM_PREFIX + userSetting.getServerId() + "_PULL_" + app + "_" + streamId + "_*";
+
+ MediaInfo result = null;
+ List<Object> keys = RedisUtil.scan(redisTemplate, scanKey);
+ if (keys.size() > 0) {
+ String key = (String) keys.get(0);
+ result = JsonUtil.redisJsonToObject(redisTemplate, key, MediaInfo.class);
+ }
+
+ return result;
+ }
+
+ @Override
public void addCpuInfo(double cpuInfo) {
String key = VideoManagerConstants.SYSTEM_INFO_CPU_PREFIX + userSetting.getServerId();
Map<String, String> infoMap = new HashMap<>();
@@ -660,10 +670,16 @@
}
@Override
- public void sendPlatformStartPlayMsg(MessageForPushChannel msg) {
- String key = VideoManagerConstants.VM_MSG_STREAM_START_PLAY_NOTIFY;
- logger.info("[redis鍙戦�侀�氱煡] 鍙戦�� 鎺ㄦ祦琚笂绾у钩鍙拌鐪� {}: {}/{}->{}", key, msg.getApp(), msg.getStream(), msg.getPlatFormId());
- redisTemplate.convertAndSend(key, JSON.toJSON(msg));
+ public void sendPlatformStartPlayMsg(SendRtpItem sendRtpItem, ParentPlatform platform) {
+ if (sendRtpItem.getPlayType() == InviteStreamType.PUSH && platform != null) {
+ MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, sendRtpItem.getApp(), sendRtpItem.getStream(),
+ sendRtpItem.getChannelId(), platform.getServerGBId(), platform.getName(), userSetting.getServerId(),
+ sendRtpItem.getMediaServerId());
+ messageForPushChannel.setPlatFormIndex(platform.getId());
+ String key = VideoManagerConstants.VM_MSG_STREAM_START_PLAY_NOTIFY;
+ logger.info("[redis鍙戦�侀�氱煡] 鍙戦�� 鎺ㄦ祦琚笂绾у钩鍙拌鐪� {}: {}/{}->{}", key, sendRtpItem.getApp(), sendRtpItem.getStream(), platform.getServerGBId());
+ redisTemplate.convertAndSend(key, JSON.toJSON(messageForPushChannel));
+ }
}
@Override
--
Gitblit v1.8.0