Commit d295f3c51271c26a5f65c0184bfa27fe1af80f54

Authored by 648540858
1 parent 66ab0939

修复合并后的问题

src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
@@ -237,11 +237,11 @@ public class StreamInfo implements Serializable, Cloneable{ @@ -237,11 +237,11 @@ public class StreamInfo implements Serializable, Cloneable{
237 } 237 }
238 } 238 }
239 239
240 - public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam) { 240 + public void setRtc(String host, int port, int sslPort, String app, String stream, String callIdParam, boolean isPlay) {
241 if (callIdParam != null) { 241 if (callIdParam != null) {
242 callIdParam = Objects.equals(callIdParam, "") ? callIdParam : callIdParam.replace("?", "&"); 242 callIdParam = Objects.equals(callIdParam, "") ? callIdParam : callIdParam.replace("?", "&");
243 } 243 }
244 - String file = String.format("index/api/webrtc?app=%s&stream=%s&type=play%s", app, stream, callIdParam); 244 + String file = String.format("index/api/webrtc?app=%s&stream=%s&type=%s%s", app, stream, isPlay?"play":"push", callIdParam);
245 if (port > 0) { 245 if (port > 0) {
246 this.rtc = new StreamURL("http", host, port, file); 246 this.rtc = new StreamURL("http", host, port, file);
247 } 247 }
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
@@ -36,7 +36,6 @@ import com.genersoft.iot.vmp.service.redisMsg.RedisGbPlayMsgListener; @@ -36,7 +36,6 @@ import com.genersoft.iot.vmp.service.redisMsg.RedisGbPlayMsgListener;
36 import com.genersoft.iot.vmp.storager.IRedisCatchStorage; 36 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
37 import com.genersoft.iot.vmp.storager.IVideoManagerStorage; 37 import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
38 import com.genersoft.iot.vmp.utils.DateUtil; 38 import com.genersoft.iot.vmp.utils.DateUtil;
39 -import com.genersoft.iot.vmp.utils.redis.RedisUtil;  
40 import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult; 39 import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult;
41 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; 40 import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
42 import com.genersoft.iot.vmp.vmanager.bean.StreamContent; 41 import com.genersoft.iot.vmp.vmanager.bean.StreamContent;
@@ -47,8 +46,8 @@ import org.slf4j.Logger; @@ -47,8 +46,8 @@ import org.slf4j.Logger;
47 import org.slf4j.LoggerFactory; 46 import org.slf4j.LoggerFactory;
48 import org.springframework.beans.factory.annotation.Autowired; 47 import org.springframework.beans.factory.annotation.Autowired;
49 import org.springframework.beans.factory.annotation.Qualifier; 48 import org.springframework.beans.factory.annotation.Qualifier;
50 -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;  
51 import org.springframework.data.redis.core.RedisTemplate; 49 import org.springframework.data.redis.core.RedisTemplate;
  50 +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
52 import org.springframework.stereotype.Service; 51 import org.springframework.stereotype.Service;
53 import org.springframework.util.ObjectUtils; 52 import org.springframework.util.ObjectUtils;
54 53
@@ -878,7 +877,7 @@ public class PlayServiceImpl implements IPlayService { @@ -878,7 +877,7 @@ public class PlayServiceImpl implements IPlayService {
878 // 关闭rtp server 877 // 关闭rtp server
879 mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); 878 mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream());
880 // 重新开启ssrc server 879 // 重新开启ssrc server
881 - mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort()); 880 + mediaServerService.openRTPServer(mediaServerItem, ssrcInfo.getStream(), ssrcInResponse, device.isSsrcCheck(), true, ssrcInfo.getPort(), false);
882 } 881 }
883 } 882 }
884 } 883 }
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
@@ -18,7 +18,6 @@ import org.slf4j.Logger; @@ -18,7 +18,6 @@ import org.slf4j.Logger;
18 import org.slf4j.LoggerFactory; 18 import org.slf4j.LoggerFactory;
19 import org.springframework.beans.factory.annotation.Autowired; 19 import org.springframework.beans.factory.annotation.Autowired;
20 import org.springframework.util.ObjectUtils; 20 import org.springframework.util.ObjectUtils;
21 -import org.springframework.util.StringUtils;  
22 import org.springframework.web.bind.annotation.RequestMapping; 21 import org.springframework.web.bind.annotation.RequestMapping;
23 import org.springframework.web.bind.annotation.RequestParam; 22 import org.springframework.web.bind.annotation.RequestParam;
24 import org.springframework.web.bind.annotation.RestController; 23 import org.springframework.web.bind.annotation.RestController;
@@ -128,7 +127,7 @@ public class ApiDeviceController { @@ -128,7 +127,7 @@ public class ApiDeviceController {
128 // } 127 // }
129 List<DeviceChannelExtend> deviceChannels; 128 List<DeviceChannelExtend> deviceChannels;
130 List<String> channelIds = null; 129 List<String> channelIds = null;
131 - if (!StringUtils.isEmpty(code)) { 130 + if (!ObjectUtils.isEmpty(code)) {
132 String[] split = code.trim().split(","); 131 String[] split = code.trim().split(",");
133 channelIds = Arrays.asList(split); 132 channelIds = Arrays.asList(split);
134 } 133 }
src/main/resources/all-device-compatible.yml 0 → 100644
  1 +# 设备列表
  2 + # 国标编号, 标识哪些设备使用这套兼容配置,优先级 id > model > manufacturer
  3 +- id: 88880000013200000888
  4 + # 型号
  5 + model: DH-P40A2-PV
  6 + # 生产商
  7 + manufacturer: Dahua
  8 + # 收到ack消息后开始发流,默认false, 回复200ok后直接开始发流
  9 + push-stream-after-ack: false
  10 + # 国标级联发流严格模式,严格模式会使用与sdp信息中一致的端口发流,端口共享media.rtp.port-range,这会损失一些性能,
  11 + # 非严格模式使用随机端口发流,性能更好, 默认关闭
  12 + gb-send-stream-strict: false
src/main/resources/application.yml
@@ -3,14 +3,4 @@ spring: @@ -3,14 +3,4 @@ spring:
3 name: wvp 3 name: wvp
4 profiles: 4 profiles:
5 active: local 5 active: local
6 - # flayway相关配置  
7 - flyway:  
8 - enabled: true #是否启用flyway(默认true)  
9 - locations: classpath:db/migration #这个路径指的是fly版本控制的sql语句存放的路径,可以多个,可以给每个环境使用不同位置,比如classpath:db/migration,classpath:test/db/migration  
10 - baseline-on-migrate: true #开启自动创建flyway元数据表标识 默认: false  
11 - # 与 baseline-on-migrate: true 搭配使用,将当前数据库初始版本设置为0  
12 - baseline-version: 0  
13 - clean-disabled: true #禁止flyway执行清理  
14 - # 假如已经执行了版本1和版本3,如果增加了一个版本2,下面这个选项将会允许执行版本2的脚本  
15 - out-of-order: true  
16 - table: flyway_schema_history_${spring.application.name} #用于记录所有的版本变化记录  
17 \ No newline at end of file 6 \ No newline at end of file
  7 + include: device-compatible
18 \ No newline at end of file 8 \ No newline at end of file
src/main/resources/device-compatible.yml 0 → 100644