| | |
| | | import com.ard.common.core.domain.R; |
| | | import com.ard.common.core.enums.LiveStreamType; |
| | | import com.ard.common.core.utils.DateUtils; |
| | | import com.ard.qs.api.RemoteQsDeviceService; |
| | | import com.ard.qs.api.domain.QsDevice; |
| | | import com.ard.zlm.service.ZlmStreamService; |
| | | import com.ard.zlm.domain.StreamChannel; |
| | | import com.ard.zlm.api.domain.MediaInfo; |
| | | import com.ard.zlm.api.domain.RTPServerParam; |
| | | import com.ard.zlm.api.domain.StreamInfo; |
| | |
| | | private ZlmRecordPlanItemMapper zlmRecordPlanItemMapper; |
| | | |
| | | @Resource |
| | | private RemoteQsDeviceService remoteQsDeviceService; |
| | | private ZlmStreamService zlmStreamService; |
| | | @Resource |
| | | private RemoteChannelService remoteChannelService; |
| | | @Resource |
| | |
| | | } |
| | | // 重新拉起 |
| | | R<ArdChannel> r = remoteChannelService.getInfo(deviceId, SecurityConstants.INNER); |
| | | // R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(deviceId, SecurityConstants.INNER); |
| | | // R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(deviceId, SecurityConstants.INNER); |
| | | if (r.getCode() != HttpStatus.SUCCESS) { |
| | | throw new RuntimeException("根据设备id查询设备信息失败"); |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | // if ("OFFLINE".equals(device.getDeviceStatus())) { |
| | | // if (!Boolean.TRUE.equals(device.getDeviceOnLine())) { |
| | | // log.warn("[录制计划] 流离开时拉起需要录像的流时, 发现设备不在线, id: {}", deviceId); |
| | | // return; |
| | | // } |
| | |
| | | public List<ZlmRecordPlan> selectZlmRecordPlanList(ZlmRecordPlan zlmRecordPlan) { |
| | | List<ZlmRecordPlan> zlmRecordPlans = zlmRecordPlanMapper.selectZlmRecordPlanList(zlmRecordPlan); |
| | | for (ZlmRecordPlan recordPlan : zlmRecordPlans) { |
| | | R<Integer> r = remoteQsDeviceService.countRecordPlanDevice(recordPlan.getId(), SecurityConstants.INNER); |
| | | R<Integer> r = zlmStreamService.countRecordPlanDevice(recordPlan.getId(), SecurityConstants.INNER); |
| | | if (r.getCode() != HttpStatus.SUCCESS) { |
| | | throw new RuntimeException("删除录像计划失败"); |
| | | } |
| | |
| | | public int deleteZlmRecordPlanByIds(Long[] ids) { |
| | | for (Long id : ids) { |
| | | zlmRecordPlanItemMapper.cleanItems(id); |
| | | R<Void> r = remoteQsDeviceService.cleanRecordPlanId(id, SecurityConstants.INNER); |
| | | R<Void> r = zlmStreamService.cleanRecordPlanId(id, SecurityConstants.INNER); |
| | | if (r.getCode() != HttpStatus.SUCCESS) { |
| | | throw new RuntimeException("删除录像计划失败"); |
| | | } |
| | |
| | | // recordStreamMap.keySet().forEach(startDeviceIdList::remove); |
| | | // if (!startDeviceIdList.isEmpty()) { |
| | | // // 获取所有的关联的设备 |
| | | // // R<List<QsDevice>> r = remoteQsDeviceService.queryByIds(startDeviceIdList, SecurityConstants.INNER); |
| | | // // R<List<StreamChannel>> r = zlmStreamService.queryByIds(startDeviceIdList, SecurityConstants.INNER); |
| | | // R<List<ArdChannel>> r = remoteChannelService.queryByIds(startDeviceIdList, SecurityConstants.INNER); |
| | | // if (r.getCode() != HttpStatus.SUCCESS) { |
| | | // throw new RuntimeException("根据设备id集合查询设备信息失败"); |
| | |
| | | // if (!deviceList.isEmpty()) { |
| | | // // 查找是否已经开启录像, 如果没有则开启录像 |
| | | // for (ArdChannel device : deviceList) { |
| | | //// if ("OFFLINE".equals(device.getDeviceStatus())) { |
| | | //// if (!Boolean.TRUE.equals(device.getDeviceOnLine())) { |
| | | //// log.warn("[录制计划] 流离开时拉起需要录像的流时, 发现设备不在线, id: {}", device.getId()); |
| | | //// return; |
| | | //// } |
| | |
| | | streamInfo.getApp(), streamInfo.getStream()); |
| | | if (mediaInfo.getReaderCount() == null || mediaInfo.getReaderCount() == 0) { |
| | | R<ArdChannel> r = remoteChannelService.getInfo(deviceId, SecurityConstants.INNER); |
| | | // R<QsDevice> r = remoteQsDeviceService.getQsDeviceInfo(deviceId, SecurityConstants.INNER); |
| | | // R<StreamChannel> r = zlmStreamService.getQsDeviceInfo(deviceId, SecurityConstants.INNER); |
| | | if (r.getCode() != HttpStatus.SUCCESS) { |
| | | throw new RuntimeException("根据通道id查询设备信息失败"); |
| | | } |