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