瀏覽代碼

修复合并后的问题

648540858 2 年之前
父節點
當前提交
d295f3c512

+ 2 - 2
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java

@@ -237,11 +237,11 @@ public class StreamInfo implements Serializable, Cloneable{
         }
     }
 
-    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);
         }

+ 2 - 3
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java

@@ -36,7 +36,6 @@ import com.genersoft.iot.vmp.service.redisMsg.RedisGbPlayMsgListener;
 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.Logger;
 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 @@ public class PlayServiceImpl implements IPlayService {
                                     // 关闭rtp server
                                     mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream());
                                     // 重新开启ssrc server
-                                    mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort());
+                                    mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort(), false);
                                 }
                             }
                         }

+ 1 - 2
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java

@@ -18,7 +18,6 @@ import org.slf4j.Logger;
 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 @@ public class ApiDeviceController {
 //        }
         List<DeviceChannelExtend> deviceChannels;
         List<String> channelIds = null;
-        if (!StringUtils.isEmpty(code)) {
+        if (!ObjectUtils.isEmpty(code)) {
             String[] split = code.trim().split(",");
             channelIds = Arrays.asList(split);
         }

+ 12 - 0
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
+  # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能,
+  # 非严格模式使用随机端口发流,性能更好, 默认关闭
+  gb-send-stream-strict: false

+ 1 - 11
src/main/resources/application.yml

@@ -3,14 +3,4 @@ spring:
     name: wvp
   profiles:
     active: local
-  # flayway相关配置
-  flyway:
-    enabled: true   #是否启用flyway(默认true)
-    locations: classpath:db/migration   #这个路径指的是fly版本控制的sql语句存放的路径,可以多个,可以给每个环境使用不同位置,比如classpath:db/migration,classpath:test/db/migration
-    baseline-on-migrate: true   #开启自动创建flyway元数据表标识 默认: 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}  #用于记录所有的版本变化记录
+    include: device-compatible

+ 0 - 0
src/main/resources/device-compatible.yml