From d295f3c51271c26a5f65c0184bfa27fe1af80f54 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 18 四月 2023 14:06:07 +0800
Subject: [PATCH] 修复合并后的问题

---
 src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java |    3 +--
 src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java    |    5 ++---
 src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java               |    4 ++--
 src/main/resources/device-compatible.yml                                 |    0 
 src/main/resources/all-device-compatible.yml                             |   12 ++++++++++++
 src/main/resources/application.yml                                       |   12 +-----------
 6 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
index a501daf..80b97f2 100644
--- a/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
+++ b/src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
@@ -237,11 +237,11 @@
         }
     }
 
-    public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam) {
+    public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam, boolean isPlay) {
         if (callIdParam != null) {
             callIdParam = Objects.equals(callIdParam, "") ? callIdParam : callIdParam.replace("?", "&");
         }
-        String file = String.format("index/api/webrtc?app=%s&stream=%s&type=play%s", app, stream, callIdParam);
+        String file = String.format("index/api/webrtc?app=%s&stream=%s&type=%s%s", app, stream, isPlay?"play":"push", callIdParam);
         if (port > 0) {
             this.rtc = new StreamURL("http", host, port, file);
         }
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
index a67b951..ad79c20 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
@@ -36,7 +36,6 @@
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
 import com.genersoft.iot.vmp.utils.DateUtil;
-import com.genersoft.iot.vmp.utils.redis.RedisUtil;
 import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult;
 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
 import com.genersoft.iot.vmp.vmanager.bean.StreamContent;
@@ -47,8 +46,8 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
@@ -878,7 +877,7 @@
                                     // 鍏抽棴rtp server
                                     mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream());
                                     // 閲嶆柊寮�鍚痵src server
-                                    mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort());
+                                    mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort(), false);
                                 }
                             }
                         }
diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
index 08f79bf..3abec02 100644
--- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
@@ -18,7 +18,6 @@
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -128,7 +127,7 @@
 //        }
         List<DeviceChannelExtend> deviceChannels;
         List<String> channelIds = null;
-        if (!StringUtils.isEmpty(code)) {
+        if (!ObjectUtils.isEmpty(code)) {
             String[] split = code.trim().split(",");
             channelIds = Arrays.asList(split);
         }
diff --git a/src/main/resources/all-device-compatible.yml b/src/main/resources/all-device-compatible.yml
new file mode 100644
index 0000000..24d425d
--- /dev/null
+++ b/src/main/resources/all-device-compatible.yml
@@ -0,0 +1,12 @@
+# 璁惧鍒楄〃
+  # 鍥芥爣缂栧彿锛� 鏍囪瘑鍝簺璁惧浣跨敤杩欏鍏煎閰嶇疆锛屼紭鍏堢骇 id > model > manufacturer
+- id: 88880000013200000888
+  # 鍨嬪彿
+  model: DH-P40A2-PV
+  # 鐢熶骇鍟�
+  manufacturer: Dahua
+  # 鏀跺埌ack娑堟伅鍚庡紑濮嬪彂娴侊紝榛樿false锛� 鍥炲200ok鍚庣洿鎺ュ紑濮嬪彂娴�
+  push-stream-after-ack: false
+  # 鍥芥爣绾ц仈鍙戞祦涓ユ牸妯″紡锛屼弗鏍兼ā寮忎細浣跨敤涓巗dp淇℃伅涓竴鑷寸殑绔彛鍙戞祦锛岀鍙e叡浜玬edia.rtp.port-range锛岃繖浼氭崯澶变竴浜涙�ц兘锛�
+  # 闈炰弗鏍兼ā寮忎娇鐢ㄩ殢鏈虹鍙e彂娴侊紝鎬ц兘鏇村ソ锛� 榛樿鍏抽棴
+  gb-send-stream-strict: false
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 4efb527..c0615df 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -3,14 +3,4 @@
     name: wvp
   profiles:
     active: local
-  # flayway鐩稿叧閰嶇疆
-  flyway:
-    enabled: true   #鏄惁鍚敤flyway(榛樿true)
-    locations: classpath:db/migration   #杩欎釜璺緞鎸囩殑鏄痜ly鐗堟湰鎺у埗鐨剆ql璇彞瀛樻斁鐨勮矾寰�,鍙互澶氫釜锛屽彲浠ョ粰姣忎釜鐜浣跨敤涓嶅悓浣嶇疆,姣斿classpath:db/migration,classpath:test/db/migration
-    baseline-on-migrate: true   #寮�鍚嚜鍔ㄥ垱寤篺lyway鍏冩暟鎹〃鏍囪瘑 榛樿: false
-    # 涓� baseline-on-migrate: true 鎼厤浣跨敤,灏嗗綋鍓嶆暟鎹簱鍒濆鐗堟湰璁剧疆涓�0
-    baseline-version: 0
-    clean-disabled: true    #绂佹flyway鎵ц娓呯悊
-    # 鍋囧宸茬粡鎵ц浜嗙増鏈�1鍜岀増鏈�3锛屽鏋滃鍔犱簡涓�涓増鏈�2锛屼笅闈㈣繖涓�夐」灏嗕細鍏佽鎵ц鐗堟湰2鐨勮剼鏈�
-    out-of-order: true
-    table: flyway_schema_history_${spring.application.name}  #鐢ㄤ簬璁板綍鎵�鏈夌殑鐗堟湰鍙樺寲璁板綍
\ No newline at end of file
+    include: device-compatible
\ No newline at end of file
diff --git a/src/main/resources/device-compatible.yml b/src/main/resources/device-compatible.yml
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/main/resources/device-compatible.yml

--
Gitblit v1.8.0