old mode 100644
new mode 100755
 |  |  | 
 |  |  | package com.genersoft.iot.vmp.media.zlm.dto; | 
 |  |  |  | 
 |  |  |  | 
 |  |  | import com.genersoft.iot.vmp.gb28181.session.SsrcConfig; | 
 |  |  | import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig; | 
 |  |  | import io.swagger.v3.oas.annotations.media.Schema; | 
 |  |  | import org.springframework.util.StringUtils; | 
 |  |  |  | 
 |  |  | import java.util.HashMap; | 
 |  |  | import org.springframework.util.ObjectUtils; | 
 |  |  |  | 
 |  |  | @Schema(description = "流媒体服务信息") | 
 |  |  | public class MediaServerItem{ | 
 |  |  | 
 |  |  |     @Schema(description = "ZLM鉴权参数") | 
 |  |  |     private String secret; | 
 |  |  |  | 
 |  |  |     @Schema(description = "某个流无人观看时,触发hook.on_stream_none_reader事件的最大等待时间,单位毫秒") | 
 |  |  |     private int streamNoneReaderDelayMS; | 
 |  |  |  | 
 |  |  |     @Schema(description = "keepalive hook触发间隔,单位秒") | 
 |  |  |     private int hookAliveInterval; | 
 |  |  |     private Float hookAliveInterval; | 
 |  |  |  | 
 |  |  |     @Schema(description = "是否使用多端口模式") | 
 |  |  |     private boolean rtpEnable; | 
 |  |  | 
 |  |  |     @Schema(description = "是否是默认ZLM") | 
 |  |  |     private boolean defaultServer; | 
 |  |  |  | 
 |  |  |     @Schema(description = "SSRC信息") | 
 |  |  |     private SsrcConfig ssrcConfig; | 
 |  |  |     @Schema(description = "录像存储时长") | 
 |  |  |     private int recordDay; | 
 |  |  |  | 
 |  |  |     @Schema(description = "当前使用到的端口") | 
 |  |  |     private int currentPort; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 每一台ZLM都有一套独立的SSRC列表 | 
 |  |  |      * 在ApplicationCheckRunner里对mediaServerSsrcMap进行初始化 | 
 |  |  |      */ | 
 |  |  |     @Schema(description = "ID") | 
 |  |  |     private HashMap<String, SsrcConfig> mediaServerSsrcMap; | 
 |  |  |     @Schema(description = "录像存储路径") | 
 |  |  |     private String recordPath; | 
 |  |  |  | 
 |  |  |     public MediaServerItem() { | 
 |  |  |     } | 
 |  |  | 
 |  |  |     public MediaServerItem(ZLMServerConfig zlmServerConfig, String sipIp) { | 
 |  |  |         id = zlmServerConfig.getGeneralMediaServerId(); | 
 |  |  |         ip = zlmServerConfig.getIp(); | 
 |  |  |         hookIp = StringUtils.isEmpty(zlmServerConfig.getHookIp())? sipIp: zlmServerConfig.getHookIp(); | 
 |  |  |         sdpIp = StringUtils.isEmpty(zlmServerConfig.getSdpIp())? zlmServerConfig.getIp(): zlmServerConfig.getSdpIp(); | 
 |  |  |         streamIp = StringUtils.isEmpty(zlmServerConfig.getStreamIp())? zlmServerConfig.getIp(): zlmServerConfig.getStreamIp(); | 
 |  |  |         hookIp = ObjectUtils.isEmpty(zlmServerConfig.getHookIp())? sipIp: zlmServerConfig.getHookIp(); | 
 |  |  |         sdpIp = ObjectUtils.isEmpty(zlmServerConfig.getSdpIp())? zlmServerConfig.getIp(): zlmServerConfig.getSdpIp(); | 
 |  |  |         streamIp = ObjectUtils.isEmpty(zlmServerConfig.getStreamIp())? zlmServerConfig.getIp(): zlmServerConfig.getStreamIp(); | 
 |  |  |         httpPort = zlmServerConfig.getHttpPort(); | 
 |  |  |         httpSSlPort = zlmServerConfig.getHttpSSLport(); | 
 |  |  |         rtmpPort = zlmServerConfig.getRtmpPort(); | 
 |  |  | 
 |  |  |         rtspSSLPort = zlmServerConfig.getRtspSSlport(); | 
 |  |  |         autoConfig = true; // 默认值true; | 
 |  |  |         secret = zlmServerConfig.getApiSecret(); | 
 |  |  |         streamNoneReaderDelayMS = zlmServerConfig.getGeneralStreamNoneReaderDelayMS(); | 
 |  |  |         hookAliveInterval = zlmServerConfig.getHookAliveInterval(); | 
 |  |  |         rtpEnable = false; // 默认使用单端口;直到用户自己设置开启多端口 | 
 |  |  |         rtpPortRange = zlmServerConfig.getPortRange().replace("_",","); // 默认使用30000,30500作为级联时发送流的端口号 | 
 |  |  |         sendRtpPortRange = "30000,30500"; // 默认使用30000,30500作为级联时发送流的端口号 | 
 |  |  |         recordAssistPort = 0; // 默认关闭 | 
 |  |  |  | 
 |  |  |     } | 
 |  |  | 
 |  |  |         this.secret = secret; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public int getStreamNoneReaderDelayMS() { | 
 |  |  |         return streamNoneReaderDelayMS; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setStreamNoneReaderDelayMS(int streamNoneReaderDelayMS) { | 
 |  |  |         this.streamNoneReaderDelayMS = streamNoneReaderDelayMS; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public boolean isRtpEnable() { | 
 |  |  |         return rtpEnable; | 
 |  |  |     } | 
 |  |  | 
 |  |  |         this.updateTime = updateTime; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public HashMap<String, SsrcConfig> getMediaServerSsrcMap() { | 
 |  |  |         return mediaServerSsrcMap; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setMediaServerSsrcMap(HashMap<String, SsrcConfig> mediaServerSsrcMap) { | 
 |  |  |         this.mediaServerSsrcMap = mediaServerSsrcMap; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public SsrcConfig getSsrcConfig() { | 
 |  |  |         return ssrcConfig; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setSsrcConfig(SsrcConfig ssrcConfig) { | 
 |  |  |         this.ssrcConfig = ssrcConfig; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public int getCurrentPort() { | 
 |  |  |         return currentPort; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setCurrentPort(int currentPort) { | 
 |  |  |         this.currentPort = currentPort; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public boolean isStatus() { | 
 |  |  |         return status; | 
 |  |  |     } | 
 |  |  | 
 |  |  |         this.lastKeepaliveTime = lastKeepaliveTime; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public Float getHookAliveInterval() { | 
 |  |  |         return hookAliveInterval; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setHookAliveInterval(Float hookAliveInterval) { | 
 |  |  |         this.hookAliveInterval = hookAliveInterval; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getSendRtpPortRange() { | 
 |  |  |         return sendRtpPortRange; | 
 |  |  |     } | 
 |  |  | 
 |  |  |         this.sendRtpPortRange = sendRtpPortRange; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public int getHookAliveInterval() { | 
 |  |  |         return hookAliveInterval; | 
 |  |  |     public int getRecordDay() { | 
 |  |  |         return recordDay; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setHookAliveInterval(int hookAliveInterval) { | 
 |  |  |         this.hookAliveInterval = hookAliveInterval; | 
 |  |  |     public void setRecordDay(int recordDay) { | 
 |  |  |         this.recordDay = recordDay; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public String getRecordPath() { | 
 |  |  |         return recordPath; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void setRecordPath(String recordPath) { | 
 |  |  |         this.recordPath = recordPath; | 
 |  |  |     } | 
 |  |  | } |