Commit d295f3c51271c26a5f65c0184bfa27fe1af80f54
1 parent
66ab0939
修复合并后的问题
Showing
6 changed files
with
18 additions
and
18 deletions
src/main/java/com/genersoft/iot/vmp/common/StreamInfo.java
| ... | ... | @@ -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 | 241 | if (callIdParam != null) { |
| 242 | 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 | 245 | if (port > 0) { |
| 246 | 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 | 36 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 37 | 37 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 38 | 38 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 39 | -import com.genersoft.iot.vmp.utils.redis.RedisUtil; | |
| 40 | 39 | import com.genersoft.iot.vmp.vmanager.bean.AudioBroadcastResult; |
| 41 | 40 | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| 42 | 41 | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; |
| ... | ... | @@ -47,8 +46,8 @@ import org.slf4j.Logger; |
| 47 | 46 | import org.slf4j.LoggerFactory; |
| 48 | 47 | import org.springframework.beans.factory.annotation.Autowired; |
| 49 | 48 | import org.springframework.beans.factory.annotation.Qualifier; |
| 50 | -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |
| 51 | 49 | import org.springframework.data.redis.core.RedisTemplate; |
| 50 | +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |
| 52 | 51 | import org.springframework.stereotype.Service; |
| 53 | 52 | import org.springframework.util.ObjectUtils; |
| 54 | 53 | |
| ... | ... | @@ -878,7 +877,7 @@ public class PlayServiceImpl implements IPlayService { |
| 878 | 877 | // 关闭rtp server |
| 879 | 878 | mediaServerService.closeRTPServer(mediaServerItem, ssrcInfo.getStream()); |
| 880 | 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 | 18 | import org.slf4j.LoggerFactory; |
| 19 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | 20 | import org.springframework.util.ObjectUtils; |
| 21 | -import org.springframework.util.StringUtils; | |
| 22 | 21 | import org.springframework.web.bind.annotation.RequestMapping; |
| 23 | 22 | import org.springframework.web.bind.annotation.RequestParam; |
| 24 | 23 | import org.springframework.web.bind.annotation.RestController; |
| ... | ... | @@ -128,7 +127,7 @@ public class ApiDeviceController { |
| 128 | 127 | // } |
| 129 | 128 | List<DeviceChannelExtend> deviceChannels; |
| 130 | 129 | List<String> channelIds = null; |
| 131 | - if (!StringUtils.isEmpty(code)) { | |
| 130 | + if (!ObjectUtils.isEmpty(code)) { | |
| 132 | 131 | String[] split = code.trim().split(","); |
| 133 | 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 | 3 | name: wvp |
| 4 | 4 | profiles: |
| 5 | 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 | 6 | \ No newline at end of file |
| 7 | + include: device-compatible | |
| 18 | 8 | \ No newline at end of file | ... | ... |
src/main/resources/device-compatible.yml
0 → 100644