From 4ad711f61a1a760a0f8f7f8475b75ec93e31d8ae Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期四, 13 六月 2024 16:21:34 +0800
Subject: [PATCH] 去除调试日志日志

---
 src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
index 190d665..7620baa 100755
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
@@ -25,7 +25,6 @@
 import com.genersoft.iot.vmp.utils.JsonUtil;
 import com.genersoft.iot.vmp.utils.redis.RedisUtil;
 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
-import com.genersoft.iot.vmp.vmanager.bean.RecordFile;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
 import okhttp3.Response;
@@ -36,19 +35,15 @@
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.jdbc.datasource.DataSourceTransactionManager;
-import org.springframework.scheduling.annotation.Async;
 import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.TransactionDefinition;
 import org.springframework.transaction.TransactionStatus;
-import org.springframework.util.Assert;
 import org.springframework.util.ObjectUtils;
 
 import java.io.File;
 import java.time.LocalDateTime;
 import java.util.*;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutionException;
 
 /**
  * 濯掍綋鏈嶅姟鍣ㄨ妭鐐圭鐞�
@@ -415,6 +410,7 @@
         if (serverItem.getRtpProxyPort() == 0) {
             serverItem.setRtpProxyPort(zlmServerConfig.getRtpProxyPort());
         }
+        serverItem.setTranscodeSuffix(zlmServerConfig.getTranscodeSuffix());
         serverItem.setStatus(true);
 
         if (ObjectUtils.isEmpty(serverItem.getId())) {
@@ -428,7 +424,6 @@
         }
         redisTemplate.opsForValue().set(key, serverItem);
         resetOnlineServerItem(serverItem);
-
 
         if (serverItem.isAutoConfig()) {
             setZLMConfig(serverItem, "0".equals(zlmServerConfig.getHookEnable()));
@@ -751,6 +746,22 @@
 
     @Override
     public List<MediaServerItem> getAllWithAssistPort() {
+
         return mediaServerMapper.queryAllWithAssistPort();
     }
+
+    @Override
+    public MediaServerItem getMediaServerByAppAndStream(String app, String stream) {
+        List<MediaServerItem> mediaServerItemList = getAllOnline();
+        if (mediaServerItemList.isEmpty()) {
+            return null;
+        }
+        for (MediaServerItem mediaServerItem : mediaServerItemList) {
+            Boolean streamReady = zlmServerFactory.isStreamReady(mediaServerItem, app, stream);
+            if (streamReady) {
+                return mediaServerItem;
+            }
+        }
+        return null;
+    }
 }

--
Gitblit v1.8.0