Commit 0e9cb5ceb6baeed953bd64a4b71d9d6bacb1798c
Committed by
GitHub
Merge pull request #1048 from lunasaw/wvp-dev-0901
bugfix:这里应该不存在key才初始化一次
Showing
3 changed files
with
16 additions
and
16 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java
| ... | ... | @@ -128,7 +128,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 128 | 128 | continue; |
| 129 | 129 | } |
| 130 | 130 | // 更新 |
| 131 | - if (ssrcFactory.hasMediaServerSSRC(mediaServerItem.getId())) { | |
| 131 | + if (!ssrcFactory.hasMediaServerSSRC(mediaServerItem.getId())) { | |
| 132 | 132 | ssrcFactory.initMediaServerSSRC(mediaServerItem.getId(), null); |
| 133 | 133 | } |
| 134 | 134 | // 查询redis是否存在此mediaServer |
| ... | ... | @@ -229,7 +229,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 229 | 229 | mediaServerMapper.update(mediaSerItem); |
| 230 | 230 | MediaServerItem mediaServerItemInRedis = getOne(mediaSerItem.getId()); |
| 231 | 231 | MediaServerItem mediaServerItemInDataBase = mediaServerMapper.queryOne(mediaSerItem.getId()); |
| 232 | - if (mediaServerItemInRedis == null || ssrcFactory.hasMediaServerSSRC(mediaSerItem.getId())) { | |
| 232 | + if (mediaServerItemInRedis == null || !ssrcFactory.hasMediaServerSSRC(mediaSerItem.getId())) { | |
| 233 | 233 | ssrcFactory.initMediaServerSSRC(mediaServerItemInDataBase.getId(),null); |
| 234 | 234 | } |
| 235 | 235 | String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + mediaServerItemInDataBase.getId(); |
| ... | ... | @@ -411,7 +411,7 @@ public class MediaServerServiceImpl implements IMediaServerService { |
| 411 | 411 | } |
| 412 | 412 | mediaServerMapper.update(serverItem); |
| 413 | 413 | String key = VideoManagerConstants.MEDIA_SERVER_PREFIX + userSetting.getServerId() + "_" + zlmServerConfig.getGeneralMediaServerId(); |
| 414 | - if (ssrcFactory.hasMediaServerSSRC(serverItem.getId())) { | |
| 414 | + if (!ssrcFactory.hasMediaServerSSRC(serverItem.getId())) { | |
| 415 | 415 | ssrcFactory.initMediaServerSSRC(zlmServerConfig.getGeneralMediaServerId(), null); |
| 416 | 416 | } |
| 417 | 417 | redisTemplate.opsForValue().set(key, serverItem); | ... | ... |
src/main/resources/application-dev.yml
| ... | ... | @@ -19,14 +19,14 @@ spring: |
| 19 | 19 | # [可选] 数据库 DB |
| 20 | 20 | database: 7 |
| 21 | 21 | # [可选] 访问密码,若你的redis服务器没有设置密码,就不需要用密码去连接 |
| 22 | - password: | |
| 22 | + password: luna | |
| 23 | 23 | # [可选] 超时时间 |
| 24 | 24 | timeout: 10000 |
| 25 | 25 | # mysql数据源 |
| 26 | 26 | datasource: |
| 27 | 27 | type: com.zaxxer.hikari.HikariDataSource |
| 28 | 28 | driver-class-name: com.mysql.cj.jdbc.Driver |
| 29 | - url: jdbc:mysql://127.0.0.1:3306/test_gb-89wulian?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true | |
| 29 | + url: jdbc:mysql://127.0.0.1:3306/wvp?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true&serverTimezone=PRC&useSSL=false&allowMultiQueries=true | |
| 30 | 30 | username: root |
| 31 | 31 | password: root |
| 32 | 32 | hikari: |
| ... | ... | @@ -38,7 +38,7 @@ spring: |
| 38 | 38 | max-lifetime: 1200000 # 是池中连接关闭后的最长生命周期(以毫秒为单位) |
| 39 | 39 | #[可选] WVP监听的HTTP端口, 网页和接口调用都是这个端口 |
| 40 | 40 | server: |
| 41 | - port: 18978 | |
| 41 | + port: 8080 | |
| 42 | 42 | # [可选] HTTPS配置, 默认不开启 |
| 43 | 43 | ssl: |
| 44 | 44 | # [可选] 是否开启HTTPS访问 |
| ... | ... | @@ -56,7 +56,7 @@ sip: |
| 56 | 56 | # 如果要监听多张网卡,可以使用逗号分隔多个IP, 例如: 192.168.1.4,10.0.0.4 |
| 57 | 57 | # 如果不明白,就使用0.0.0.0,大部分情况都是可以的 |
| 58 | 58 | # 请不要使用127.0.0.1,任何包括localhost在内的域名都是不可以的。 |
| 59 | - ip: 192.168.1.18 | |
| 59 | + ip: 172.19.128.50 | |
| 60 | 60 | # [可选] 28181服务监听的端口 |
| 61 | 61 | port: 8116 |
| 62 | 62 | # 根据国标6.1.2中规定,domain宜采用ID统一编码的前十位编码。国标附录D中定义前8位为中心编码(由省级、市级、区级、基层编号组成,参照GB/T 2260-2007) |
| ... | ... | @@ -73,21 +73,21 @@ sip: |
| 73 | 73 | |
| 74 | 74 | #zlm 默认服务器配置 |
| 75 | 75 | media: |
| 76 | - id: 89wulian-one | |
| 76 | + id: zlmediakit-local | |
| 77 | 77 | # [必须修改] zlm服务器的内网IP |
| 78 | - ip: 192.168.1.18 | |
| 78 | + ip: 172.19.128.50 | |
| 79 | 79 | # [必须修改] zlm服务器的http.port |
| 80 | - http-port: 80 | |
| 80 | + http-port: 9092 | |
| 81 | 81 | # [可选] 返回流地址时的ip,置空使用 media.ip |
| 82 | - stream-ip: 192.168.1.18 | |
| 82 | + stream-ip: 172.19.128.50 | |
| 83 | 83 | # [可选] wvp在国标信令中使用的ip,此ip为摄像机可以访问到的ip, 置空使用 media.ip |
| 84 | - sdp-ip: 192.168.1.18 | |
| 84 | + sdp-ip: 172.19.128.50 | |
| 85 | 85 | # [可选] zlm服务器的hook所使用的IP, 默认使用sip.ip |
| 86 | - hook-ip: 192.168.1.18 | |
| 86 | + hook-ip: 172.19.128.50 | |
| 87 | 87 | # [可选] zlm服务器的http.sslport, 置空使用zlm配置文件配置 |
| 88 | - http-ssl-port: 443 | |
| 88 | + http-ssl-port: 1443 | |
| 89 | 89 | # [可选] zlm服务器的hook.admin_params=secret |
| 90 | - secret: 035c73f7-bb6b-4889-a715-d9eb2d1925cc | |
| 90 | + secret: 10000 | |
| 91 | 91 | # 启用多端口模式, 多端口模式使用端口区分每路流,兼容性更好。 单端口使用流的ssrc区分, 点播超时建议使用多端口测试 |
| 92 | 92 | rtp: |
| 93 | 93 | # [可选] 是否启用多端口模式, 开启后会在portRange范围内选择端口用于媒体流传输 | ... | ... |