| | |
| | | private ZLMRESTfulUtils zlmresTfulUtils; |
| | | |
| | | @Autowired |
| | | private ZLMServerFactory zlmServerFactory; |
| | | |
| | | @Autowired |
| | | private AssistRESTfulUtils assistRESTfulUtils; |
| | | |
| | | @Autowired |
| | |
| | | sendRtpItem.setReceiveStream(stream + "_talk"); |
| | | |
| | | String callId = SipUtils.getNewCallId(); |
| | | int port = sendRtpPortManager.getNextPort(mediaServerItem.getId()); |
| | | int port = sendRtpPortManager.getNextPort(mediaServerItem); |
| | | //端口获取失败的ssrcInfo 没有必要发送点播指令 |
| | | if (port <= 0) { |
| | | logger.info("[语音对讲] 端口分配异常,deviceId={},channelId={}", device.getDeviceId(), channelId); |
| | |
| | | InviteErrorCode.SUCCESS.getCode(), |
| | | InviteErrorCode.SUCCESS.getMsg(), |
| | | streamInfo); |
| | | logger.info("[点播成功] deviceId: {}, channelId:{}, 码流类型:{}", device.getDeviceId(), |
| | | logger.info("[点播成功] deviceId: {}, channelId:{}, 码流类型:{}", device.getDeviceId(), channelId, |
| | | device.isSwitchPrimarySubStream() ? "辅码流" : "主码流"); |
| | | snapOnPlay(mediaServerItemInuse, device.getDeviceId(), channelId, ssrcInfo.getStream()); |
| | | }, (event) -> { |
| | |
| | | zlmresTfulUtils.getSnap(mediaServerItemInuse, streamUrl, 15, 1, path, fileName); |
| | | } |
| | | |
| | | private StreamInfo onPublishHandlerForPlay(MediaServerItem mediaServerItem, HookParam hookParam, String deviceId, String channelId) { |
| | | public StreamInfo onPublishHandlerForPlay(MediaServerItem mediaServerItem, HookParam hookParam, String deviceId, String channelId) { |
| | | StreamInfo streamInfo = null; |
| | | Device device = redisCatchStorage.getDevice(deviceId); |
| | | OnStreamChangedHookParam streamChangedHookParam = (OnStreamChangedHookParam)hookParam; |
| | |
| | | return; |
| | | } |
| | | MediaServerItem newMediaServerItem = getNewMediaServerItem(device); |
| | | SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, null, null, device.isSsrcCheck(), true, 0, false,false, device.getStreamModeForParam()); |
| | | String stream = null; |
| | | if (newMediaServerItem.isRtpEnable()) { |
| | | String startTimeStr = startTime.replace("-", "") |
| | | .replace(":", "") |
| | | .replace(" ", ""); |
| | | System.out.println(startTimeStr); |
| | | String endTimeTimeStr = endTime.replace("-", "") |
| | | .replace(":", "") |
| | | .replace(" ", ""); |
| | | System.out.println(endTimeTimeStr); |
| | | stream = deviceId + "_" + channelId + "_" + startTimeStr + "_" + endTimeTimeStr; |
| | | } |
| | | SSRCInfo ssrcInfo = mediaServerService.openRTPServer(newMediaServerItem, stream, null, device.isSsrcCheck(), true, 0, false,false, device.getStreamModeForParam()); |
| | | playBack(newMediaServerItem, ssrcInfo, deviceId, channelId, startTime, endTime, callback); |
| | | } |
| | | |