Merge branch 'wvp-28181-2.0'
# Conflicts: # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/ISIPCommander.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommanderFroPlatform.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/SIPRequestProcessorParent.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/InviteRequestProcessor.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/SubscribeRequestProcessor.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/message/response/cmd/BroadcastResponseMessageHandler.java # src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java # src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRTPServerFactory.java # src/main/java/com/genersoft/iot/vmp/media/zlm/dto/HookSubscribeFactory.java # src/main/java/com/genersoft/iot/vmp/service/IMediaServerService.java # src/main/java/com/genersoft/iot/vmp/service/impl/MediaServerServiceImpl.java # src/main/java/com/genersoft/iot/vmp/service/impl/MediaServiceImpl.java # src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java # src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java # web_src/src/components/dialog/devicePlayer.vue
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
package com.genersoft.iot.vmp.conf;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -101,12 +98,14 @@ public class DynamicTask {
|
||||
}
|
||||
}
|
||||
|
||||
public void stop(String key) {
|
||||
if (futureMap.get(key) != null && !futureMap.get(key).isCancelled()) {
|
||||
futureMap.get(key).cancel(false);
|
||||
public boolean stop(String key) {
|
||||
boolean result = false;
|
||||
if (futureMap.get(key) != null && !futureMap.get(key).isCancelled() && !futureMap.get(key).isDone()) {
|
||||
result = futureMap.get(key).cancel(false);
|
||||
futureMap.remove(key);
|
||||
runnableMap.remove(key);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean contains(String key) {
|
||||
@@ -128,11 +127,15 @@ public class DynamicTask {
|
||||
public void execute(){
|
||||
if (futureMap.size() > 0) {
|
||||
for (String key : futureMap.keySet()) {
|
||||
if (futureMap.get(key).isDone()) {
|
||||
if (futureMap.get(key).isDone() || futureMap.get(key).isCancelled()) {
|
||||
futureMap.remove(key);
|
||||
runnableMap.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isAlive(String key) {
|
||||
return futureMap.get(key) != null && !futureMap.get(key).isDone() && !futureMap.get(key).isCancelled();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.genersoft.iot.vmp.conf;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.support.spring.http.converter.FastJsonHttpMessageConverter;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -2,13 +2,11 @@ package com.genersoft.iot.vmp.conf;
|
||||
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||
import com.genersoft.iot.vmp.utils.DateUtil;
|
||||
import com.genersoft.iot.vmp.vmanager.gb28181.device.DeviceQuery;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
@@ -27,7 +25,7 @@ public class MediaConfig{
|
||||
@Value("${media.ip}")
|
||||
private String ip;
|
||||
|
||||
@Value("${media.hook-ip:${sip.ip}}")
|
||||
@Value("${media.hook-ip:}")
|
||||
private String hookIp;
|
||||
|
||||
@Value("${sip.ip}")
|
||||
@@ -75,10 +73,6 @@ public class MediaConfig{
|
||||
@Value("${media.rtp.port-range}")
|
||||
private String rtpPortRange;
|
||||
|
||||
|
||||
@Value("${media.rtp.send-port-range}")
|
||||
private String sendRtpPortRange;
|
||||
|
||||
@Value("${media.record-assist-port:0}")
|
||||
private Integer recordAssistPort = 0;
|
||||
|
||||
@@ -92,7 +86,7 @@ public class MediaConfig{
|
||||
|
||||
public String getHookIp() {
|
||||
if (ObjectUtils.isEmpty(hookIp)){
|
||||
return sipIp;
|
||||
return sipIp.split(",")[0];
|
||||
}else {
|
||||
return hookIp;
|
||||
}
|
||||
@@ -191,10 +185,6 @@ public class MediaConfig{
|
||||
return sipDomain;
|
||||
}
|
||||
|
||||
public String getSendRtpPortRange() {
|
||||
return sendRtpPortRange;
|
||||
}
|
||||
|
||||
public MediaServerItem getMediaSerItem(){
|
||||
MediaServerItem mediaServerItem = new MediaServerItem();
|
||||
mediaServerItem.setId(id);
|
||||
@@ -214,9 +204,8 @@ public class MediaConfig{
|
||||
mediaServerItem.setSecret(secret);
|
||||
mediaServerItem.setRtpEnable(rtpEnable);
|
||||
mediaServerItem.setRtpPortRange(rtpPortRange);
|
||||
mediaServerItem.setSendRtpPortRange(sendRtpPortRange);
|
||||
mediaServerItem.setRecordAssistPort(recordAssistPort);
|
||||
mediaServerItem.setHookAliveInterval(120);
|
||||
mediaServerItem.setHookAliveInterval(30.00f);
|
||||
|
||||
mediaServerItem.setCreateTime(DateUtil.getNow());
|
||||
mediaServerItem.setUpdateTime(DateUtil.getNow());
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.genersoft.iot.vmp.conf;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.genersoft.iot.vmp.conf;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "sip", ignoreInvalidFields = true)
|
||||
@@ -10,11 +11,6 @@ public class SipConfig {
|
||||
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 默认使用 0.0.0.0
|
||||
*/
|
||||
private String monitorIp = "0.0.0.0";
|
||||
|
||||
private Integer port;
|
||||
|
||||
private String domain;
|
||||
@@ -25,8 +21,6 @@ public class SipConfig {
|
||||
|
||||
Integer ptzSpeed = 50;
|
||||
|
||||
Integer keepaliveTimeOut = 255;
|
||||
|
||||
Integer registerTimeInterval = 120;
|
||||
|
||||
private boolean alarm;
|
||||
@@ -35,10 +29,6 @@ public class SipConfig {
|
||||
this.ip = ip;
|
||||
}
|
||||
|
||||
public void setMonitorIp(String monitorIp) {
|
||||
this.monitorIp = monitorIp;
|
||||
}
|
||||
|
||||
public void setPort(Integer port) {
|
||||
this.port = port;
|
||||
}
|
||||
@@ -59,18 +49,11 @@ public class SipConfig {
|
||||
this.ptzSpeed = ptzSpeed;
|
||||
}
|
||||
|
||||
public void setKeepaliveTimeOut(Integer keepaliveTimeOut) {
|
||||
this.keepaliveTimeOut = keepaliveTimeOut;
|
||||
}
|
||||
|
||||
public void setRegisterTimeInterval(Integer registerTimeInterval) {
|
||||
this.registerTimeInterval = registerTimeInterval;
|
||||
}
|
||||
|
||||
public String getMonitorIp() {
|
||||
return monitorIp;
|
||||
}
|
||||
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
@@ -99,10 +82,6 @@ public class SipConfig {
|
||||
return ptzSpeed;
|
||||
}
|
||||
|
||||
public Integer getKeepaliveTimeOut() {
|
||||
return keepaliveTimeOut;
|
||||
}
|
||||
|
||||
public Integer getRegisterTimeInterval() {
|
||||
return registerTimeInterval;
|
||||
}
|
||||
@@ -114,4 +93,10 @@ public class SipConfig {
|
||||
public void setAlarm(boolean alarm) {
|
||||
this.alarm = alarm;
|
||||
}
|
||||
|
||||
public void getLocalIp(String deviceLocalIp) {
|
||||
if (ObjectUtils.isEmpty(deviceLocalIp)) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.genersoft.iot.vmp.conf;
|
||||
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatformCatch;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
||||
import com.genersoft.iot.vmp.service.IPlatformService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
@@ -47,7 +46,7 @@ public class SipPlatformRunner implements CommandLineRunner {
|
||||
parentPlatformCatch.setId(parentPlatform.getServerGBId());
|
||||
redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch);
|
||||
// 设置所有平台离线
|
||||
platformService.offline(parentPlatform);
|
||||
platformService.offline(parentPlatform, true);
|
||||
// 取消订阅
|
||||
sipCommanderForPlatform.unregister(parentPlatform, null, (eventResult)->{
|
||||
platformService.login(parentPlatform);
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -22,15 +23,17 @@ public class SystemInfoTimerTask {
|
||||
@Autowired
|
||||
private IRedisCatchStorage redisCatchStorage;
|
||||
|
||||
@Scheduled(fixedRate = 1000) //每1秒执行一次
|
||||
@Scheduled(fixedRate = 2000) //每1秒执行一次
|
||||
public void execute(){
|
||||
try {
|
||||
double cpuInfo = SystemInfoUtils.getCpuInfo();
|
||||
redisCatchStorage.addCpuInfo(cpuInfo);
|
||||
double memInfo = SystemInfoUtils.getMemInfo();
|
||||
redisCatchStorage.addMemInfo(memInfo);
|
||||
Map<String, String> networkInterfaces = SystemInfoUtils.getNetworkInterfaces();
|
||||
Map<String, Double> networkInterfaces = SystemInfoUtils.getNetworkInterfaces();
|
||||
redisCatchStorage.addNetInfo(networkInterfaces);
|
||||
List<Map<String, Object>> diskInfo =SystemInfoUtils.getDiskInfo();
|
||||
redisCatchStorage.addDiskInfo(diskInfo);
|
||||
} catch (InterruptedException e) {
|
||||
logger.error("[获取系统信息失败] {}", e.getMessage());
|
||||
}
|
||||
|
||||
@@ -33,8 +33,14 @@ public class UserSetting {
|
||||
|
||||
private Boolean usePushingAsStatus = Boolean.TRUE;
|
||||
|
||||
private Boolean useSourceIpAsStreamIp = Boolean.FALSE;
|
||||
|
||||
private Boolean streamOnDemand = Boolean.TRUE;
|
||||
|
||||
private Boolean pushAuthority = Boolean.TRUE;
|
||||
|
||||
private Boolean gbSendStreamStrict = Boolean.FALSE;
|
||||
|
||||
private String serverId = "000000";
|
||||
|
||||
private String thirdPartyGBIdReg = "[\\s\\S]*";
|
||||
@@ -156,4 +162,28 @@ public class UserSetting {
|
||||
public void setStreamOnDemand(Boolean streamOnDemand) {
|
||||
this.streamOnDemand = streamOnDemand;
|
||||
}
|
||||
|
||||
public Boolean getUseSourceIpAsStreamIp() {
|
||||
return useSourceIpAsStreamIp;
|
||||
}
|
||||
|
||||
public void setUseSourceIpAsStreamIp(Boolean useSourceIpAsStreamIp) {
|
||||
this.useSourceIpAsStreamIp = useSourceIpAsStreamIp;
|
||||
}
|
||||
|
||||
public Boolean getPushAuthority() {
|
||||
return pushAuthority;
|
||||
}
|
||||
|
||||
public void setPushAuthority(Boolean pushAuthority) {
|
||||
this.pushAuthority = pushAuthority;
|
||||
}
|
||||
|
||||
public Boolean getGbSendStreamStrict() {
|
||||
return gbSendStreamStrict;
|
||||
}
|
||||
|
||||
public void setGbSendStreamStrict(Boolean gbSendStreamStrict) {
|
||||
this.gbSendStreamStrict = gbSendStreamStrict;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public class VersionInfo {
|
||||
versionPo.setBUILD_DATE(gitUtil.getBuildDate());
|
||||
versionPo.setGIT_Revision_SHORT(gitUtil.getCommitIdShort());
|
||||
versionPo.setVersion(gitUtil.getBuildVersion());
|
||||
versionPo.setGIT_DATE(gitUtil.getCommitTime());
|
||||
|
||||
return versionPo;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.genersoft.iot.vmp.conf;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.genersoft.iot.vmp.conf.redis;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.parser.ParserConfig;
|
||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||
import com.genersoft.iot.vmp.service.redisMsg.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -55,8 +54,7 @@ public class RedisConfig extends CachingConfigurerSupport {
|
||||
// value值的序列化采用fastJsonRedisSerializer
|
||||
redisTemplate.setValueSerializer(fastJsonRedisSerializer);
|
||||
redisTemplate.setHashValueSerializer(fastJsonRedisSerializer);
|
||||
// 全局开启AutoType,不建议使用
|
||||
ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
|
||||
|
||||
// key的序列化采用StringRedisSerializer
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.genersoft.iot.vmp.conf.security;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
|
||||
import org.apache.poi.hssf.eventmodel.ERFListener;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
Reference in New Issue
Block a user