panlinlin
4 years ago
23 changed files with 367 additions and 175 deletions
@ -0,0 +1,177 @@ |
|||
package com.genersoft.iot.vmp.conf; |
|||
|
|||
import org.springframework.beans.factory.annotation.Value; |
|||
import org.springframework.context.annotation.Configuration; |
|||
|
|||
@Configuration("mediaConfig") |
|||
public class MediaConfig { |
|||
|
|||
@Value("${media.ip}") |
|||
private String ip; |
|||
|
|||
@Value("${media.wanIp}") |
|||
private String wanIp; |
|||
|
|||
@Value("${media.hookIp}") |
|||
private String hookIp; |
|||
|
|||
@Value("${media.httpPort}") |
|||
private String httpPort; |
|||
|
|||
@Value("${media.httpSSlPort}") |
|||
private String httpSSlPort; |
|||
|
|||
@Value("${media.rtmpPort}") |
|||
private String rtmpPort; |
|||
|
|||
@Value("${media.rtmpSSlPort}") |
|||
private String rtmpSSlPort; |
|||
|
|||
@Value("${media.rtpProxyPort}") |
|||
private String rtpProxyPort; |
|||
|
|||
@Value("${media.rtspPort}") |
|||
private String rtspPort; |
|||
|
|||
@Value("${media.rtspSSLPort}") |
|||
private String rtspSSLPort; |
|||
|
|||
@Value("${media.autoConfig}") |
|||
private boolean autoConfig; |
|||
|
|||
@Value("${media.secret}") |
|||
private String secret; |
|||
|
|||
@Value("${media.streamNoneReaderDelayMS}") |
|||
private String streamNoneReaderDelayMS; |
|||
|
|||
@Value("${media.rtp.enable}") |
|||
private boolean rtpEnable; |
|||
|
|||
@Value("${media.rtp.portRange}") |
|||
private String rtpPortRange; |
|||
|
|||
public String getIp() { |
|||
return ip; |
|||
} |
|||
|
|||
public void setIp(String ip) { |
|||
this.ip = ip; |
|||
} |
|||
|
|||
public String getWanIp() { |
|||
return wanIp; |
|||
} |
|||
|
|||
public void setWanIp(String wanIp) { |
|||
this.wanIp = wanIp; |
|||
} |
|||
|
|||
public String getHookIp() { |
|||
return hookIp; |
|||
} |
|||
|
|||
public void setHookIp(String hookIp) { |
|||
this.hookIp = hookIp; |
|||
} |
|||
|
|||
public String getHttpPort() { |
|||
return httpPort; |
|||
} |
|||
|
|||
public void setHttpPort(String httpPort) { |
|||
this.httpPort = httpPort; |
|||
} |
|||
|
|||
public boolean isAutoConfig() { |
|||
return autoConfig; |
|||
} |
|||
|
|||
public boolean getAutoConfig() { |
|||
return autoConfig; |
|||
} |
|||
|
|||
public void setAutoConfig(boolean autoConfig) { |
|||
this.autoConfig = autoConfig; |
|||
} |
|||
|
|||
public String getSecret() { |
|||
return secret; |
|||
} |
|||
|
|||
public void setSecret(String secret) { |
|||
this.secret = secret; |
|||
} |
|||
|
|||
public String getStreamNoneReaderDelayMS() { |
|||
return streamNoneReaderDelayMS; |
|||
} |
|||
|
|||
public void setStreamNoneReaderDelayMS(String streamNoneReaderDelayMS) { |
|||
this.streamNoneReaderDelayMS = streamNoneReaderDelayMS; |
|||
} |
|||
|
|||
public boolean isRtpEnable() { |
|||
return rtpEnable; |
|||
} |
|||
|
|||
public void setRtpEnable(boolean rtpEnable) { |
|||
this.rtpEnable = rtpEnable; |
|||
} |
|||
|
|||
public String getRtpPortRange() { |
|||
return rtpPortRange; |
|||
} |
|||
|
|||
public void setRtpPortRange(String rtpPortRange) { |
|||
this.rtpPortRange = rtpPortRange; |
|||
} |
|||
|
|||
public String getHttpSSlPort() { |
|||
return httpSSlPort; |
|||
} |
|||
|
|||
public void setHttpSSlPort(String httpSSlPort) { |
|||
this.httpSSlPort = httpSSlPort; |
|||
} |
|||
|
|||
public String getRtmpPort() { |
|||
return rtmpPort; |
|||
} |
|||
|
|||
public void setRtmpPort(String rtmpPort) { |
|||
this.rtmpPort = rtmpPort; |
|||
} |
|||
|
|||
public String getRtmpSSlPort() { |
|||
return rtmpSSlPort; |
|||
} |
|||
|
|||
public void setRtmpSSlPort(String rtmpSSlPort) { |
|||
this.rtmpSSlPort = rtmpSSlPort; |
|||
} |
|||
|
|||
public String getRtpProxyPort() { |
|||
return rtpProxyPort; |
|||
} |
|||
|
|||
public void setRtpProxyPort(String rtpProxyPort) { |
|||
this.rtpProxyPort = rtpProxyPort; |
|||
} |
|||
|
|||
public String getRtspPort() { |
|||
return rtspPort; |
|||
} |
|||
|
|||
public void setRtspPort(String rtspPort) { |
|||
this.rtspPort = rtspPort; |
|||
} |
|||
|
|||
public String getRtspSSLPort() { |
|||
return rtspSSLPort; |
|||
} |
|||
|
|||
public void setRtspSSLPort(String rtspSSLPort) { |
|||
this.rtspSSLPort = rtspSSLPort; |
|||
} |
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.genersoft.iot.vmp.media.zlm; |
|||
|
|||
import com.alibaba.fastjson.annotation.JSONField; |
|||
import com.genersoft.iot.vmp.conf.MediaConfig; |
|||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.util.StringUtils; |
|||
|
|||
@Component |
|||
public class ZLMServerManger { |
|||
|
|||
@Autowired |
|||
private IRedisCatchStorage redisCatchStorage; |
|||
|
|||
@Autowired |
|||
private MediaConfig mediaConfig; |
|||
|
|||
public void updateServerCatch(ZLMServerConfig zlmServerConfig) { |
|||
|
|||
zlmServerConfig.setLocalIP(mediaConfig.getIp()); |
|||
zlmServerConfig.setWanIp(StringUtils.isEmpty(mediaConfig.getWanIp())? mediaConfig.getIp(): mediaConfig.getWanIp()); |
|||
zlmServerConfig.setHttpPort(mediaConfig.getHttpPort()); |
|||
|
|||
if(!StringUtils.isEmpty(mediaConfig.getHttpSSlPort())) |
|||
zlmServerConfig.setHttpSSLport(mediaConfig.getHttpSSlPort()); |
|||
|
|||
if(!StringUtils.isEmpty(mediaConfig.getRtspPort())) |
|||
zlmServerConfig.setRtspPort(mediaConfig.getRtspPort()); |
|||
|
|||
if(!StringUtils.isEmpty(mediaConfig.getRtspSSLPort())) |
|||
zlmServerConfig.setRtspSSlport(mediaConfig.getRtspSSLPort()); |
|||
|
|||
if(!StringUtils.isEmpty(mediaConfig.getRtmpPort())) |
|||
zlmServerConfig.setRtmpPort(mediaConfig.getRtmpPort()); |
|||
|
|||
if(!StringUtils.isEmpty(mediaConfig.getRtmpSSlPort())) |
|||
zlmServerConfig.setRtmpSslPort(mediaConfig.getRtmpSSlPort()); |
|||
|
|||
if(!StringUtils.isEmpty(mediaConfig.getRtpProxyPort())) |
|||
zlmServerConfig.setRtpProxyPort(mediaConfig.getRtpProxyPort()); |
|||
|
|||
redisCatchStorage.updateMediaInfo(zlmServerConfig); |
|||
} |
|||
} |
Loading…
Reference in new issue