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/service/impl/InviteStreamServiceImpl.java | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java
index 6e00960..e5847f6 100755
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java
@@ -24,6 +24,7 @@
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.TimeUnit;
@Service
@DS("master")
@@ -64,9 +65,13 @@
}
}
}
-
@Override
public void updateInviteInfo(InviteInfo inviteInfo) {
+ updateInviteInfo(inviteInfo, null);
+ }
+
+ @Override
+ public void updateInviteInfo(InviteInfo inviteInfo, Long time) {
if (inviteInfo == null || (inviteInfo.getDeviceId() == null || inviteInfo.getChannelId() == null)) {
logger.warn("[鏇存柊Invite淇℃伅]锛屽弬鏁颁笉鍏細 {}", JSON.toJSON(inviteInfo));
return;
@@ -118,7 +123,11 @@
":" + inviteInfoForUpdate.getChannelId() +
":" + inviteInfoForUpdate.getStream()+
":" + inviteInfoForUpdate.getSsrcInfo().getSsrc();
- redisTemplate.opsForValue().set(key, inviteInfoForUpdate);
+ if (time != null && time > 0) {
+ redisTemplate.opsForValue().set(key, inviteInfoForUpdate, time, TimeUnit.SECONDS);
+ }else {
+ redisTemplate.opsForValue().set(key, inviteInfoForUpdate);
+ }
}
@Override
@@ -243,6 +252,9 @@
String keyStr = (String) keyObj;
InviteInfo inviteInfo = (InviteInfo) redisTemplate.opsForValue().get(keyStr);
if (inviteInfo != null && inviteInfo.getStreamInfo() != null && inviteInfo.getStreamInfo().getMediaServerId().equals(mediaServerId)) {
+ if (inviteInfo.getType().equals(InviteSessionType.DOWNLOAD) && inviteInfo.getStreamInfo().getProgress() == 1) {
+ continue;
+ }
count++;
}
}
--
Gitblit v1.8.0