| | |
| | | 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.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | |
| | | @Schema(description = "ZLM鉴权参数") |
| | | private String secret; |
| | | |
| | | @Schema(description = "某个流无人观看时,触发hook.on_stream_none_reader事件的最大等待时间,单位毫秒") |
| | | private int streamNoneReaderDelayMS; |
| | | |
| | | @Schema(description = "keepalive hook触发间隔,单位秒") |
| | | private int hookAliveInterval; |
| | |
| | | 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作为级联时发送流的端口号 |
| | |
| | | |
| | | public void setSecret(String secret) { |
| | | this.secret = secret; |
| | | } |
| | | |
| | | public int getStreamNoneReaderDelayMS() { |
| | | return streamNoneReaderDelayMS; |
| | | } |
| | | |
| | | public void setStreamNoneReaderDelayMS(int streamNoneReaderDelayMS) { |
| | | this.streamNoneReaderDelayMS = streamNoneReaderDelayMS; |
| | | } |
| | | |
| | | public boolean isRtpEnable() { |