| | |
| | | } |
| | | } |
| | | String receiveKey = VideoManagerConstants.WVP_OTHER_RECEIVE_RTP_INFO + userSetting.getServerId() + "_" + callId + "_" + stream; |
| | | int localPortForVideo = zlmServerFactory.createRTPServer(mediaServerItem, stream, ssrcInt, null, false, tcpMode); |
| | | int localPortForAudio = zlmServerFactory.createRTPServer(mediaServerItem, stream + "_a" , ssrcInt, null, false, tcpMode); |
| | | int localPortForVideo = zlmServerFactory.createRTPServer(mediaServerItem, stream, ssrcInt, null, false, false, tcpMode); |
| | | int localPortForAudio = zlmServerFactory.createRTPServer(mediaServerItem, stream + "_a" , ssrcInt, null, false, false, tcpMode); |
| | | if (localPortForVideo == 0 || localPortForAudio == 0) { |
| | | throw new ControllerException(ErrorCode.ERROR100.getCode(), "获取端口失败"); |
| | | } |
| | |
| | | redisTemplate.opsForValue().set(receiveKey, otherRtpSendInfo); |
| | | if (isSend != null && isSend) { |
| | | // 预创建发流信息 |
| | | int portForVideo = sendRtpPortManager.getNextPort(mediaServerItem.getId()); |
| | | int portForAudio = sendRtpPortManager.getNextPort(mediaServerItem.getId()); |
| | | // 将信息写入redis中,以备后用 |
| | | redisTemplate.opsForValue().set(key, otherRtpSendInfo, 300, TimeUnit.SECONDS); |
| | | int portForVideo = sendRtpPortManager.getNextPort(mediaServerItem); |
| | | int portForAudio = sendRtpPortManager.getNextPort(mediaServerItem); |
| | | |
| | | otherRtpSendInfo.setSendLocalIp(mediaServerItem.getSdpIp()); |
| | | otherRtpSendInfo.setSendLocalPortForVideo(portForVideo); |
| | | otherRtpSendInfo.setSendLocalPortForAudio(portForAudio); |
| | | // 将信息写入redis中,以备后用 |
| | | redisTemplate.opsForValue().set(key, otherRtpSendInfo, 300, TimeUnit.SECONDS); |
| | | logger.info("[第三方服务对接->开启收流和获取发流信息] 结果,callId->{}, {}", callId, otherRtpSendInfo); |
| | | } |
| | | // 将信息写入redis中,以备后用 |