| | |
| | | }, userSetting.getPlayTimeout()); |
| | | |
| | | try { |
| | | mediaServerService.startSendRtpPassive(mediaServerItem, null, sendRtpItem, userSetting.getPlayTimeout() * 1000); |
| | | mediaServerService.startSendRtpPassive(mediaServerItem, sendRtpItem, userSetting.getPlayTimeout() * 1000); |
| | | }catch (ControllerException e) { |
| | | mediaServerService.releaseSsrc(mediaServerItem.getId(), sendRtpItem.getSsrc()); |
| | | logger.info("[语音对讲]失败 deviceId: {}, channelId: {}", device.getDeviceId(), channelId); |
| | |
| | | return null; |
| | | } |
| | | String app = "rtp"; |
| | | MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServerItem, app, stream); |
| | | if (mediaInfo == null) { |
| | | logger.warn("[获取下载进度] 查询进度失败, 节点Id: {}, {}/{}", mediaServerId, app, stream); |
| | | return null; |
| | | } |
| | | if (mediaInfo.getDuration() == 0) { |
| | | Long duration = mediaServerService.updateDownloadProcess(mediaServerItem, app, stream); |
| | | if (duration == null || duration == 0) { |
| | | inviteInfo.getStreamInfo().setProgress(0); |
| | | } else { |
| | | String startTime = inviteInfo.getStreamInfo().getStartTime(); |
| | |
| | | long start = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(startTime); |
| | | long end = DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(endTime); |
| | | |
| | | BigDecimal currentCount = new BigDecimal(mediaInfo.getDuration()); |
| | | BigDecimal currentCount = new BigDecimal(duration); |
| | | BigDecimal totalCount = new BigDecimal((end - start) * 1000); |
| | | BigDecimal divide = currentCount.divide(totalCount, 2, RoundingMode.HALF_UP); |
| | | double process = divide.doubleValue(); |
| | |
| | | // 开始发流 |
| | | MediaServer mediaInfo = mediaServerService.getOne(sendRtpItem.getMediaServerId()); |
| | | |
| | | if (mediaInfo == null) { |
| | | RequestPushStreamMsg requestPushStreamMsg = RequestPushStreamMsg.getInstance(sendRtpItem); |
| | | redisGbPlayMsgListener.sendMsgForStartSendRtpStream(sendRtpItem.getServerId(), requestPushStreamMsg, () -> { |
| | | startSendRtpStreamFailHand(sendRtpItem, platform, callIdHeader); |
| | | }); |
| | | } else { |
| | | if (mediaInfo != null) { |
| | | try { |
| | | if (sendRtpItem.isTcpActive()) { |
| | | mediaServerService.startSendRtpPassive(mediaInfo, platform, sendRtpItem, null); |
| | | mediaServerService.startSendRtpPassive(mediaInfo, sendRtpItem, null); |
| | | } else { |
| | | mediaServerService.startSendRtp(mediaInfo, platform, sendRtpItem); |
| | | mediaServerService.startSendRtp(mediaInfo, sendRtpItem); |
| | | } |
| | | redisCatchStorage.sendPlatformStartPlayMsg(sendRtpItem, platform); |
| | | }catch (ControllerException e) { |
| | | logger.error("RTP推流失败: {}", e.getMessage()); |
| | | startSendRtpStreamFailHand(sendRtpItem, platform, callIdHeader); |