| | |
| | | import com.ruoyi.alarm.global.domain.GuideTask; |
| | | import com.ruoyi.alarm.global.service.impl.QueueHandler; |
| | | import com.ruoyi.common.annotation.SdkOperate; |
| | | import com.ruoyi.common.config.ARDConfig; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.file.FileUtils; |
| | | import com.ruoyi.common.utils.file.MimeTypeUtils; |
| | | import com.ruoyi.common.utils.spring.SpringUtils; |
| | |
| | | return AjaxResult.warn("设备未登录"); |
| | | } |
| | | LLong loginId = (LLong) GlobalVariable.loginMap.get(cameraId); |
| | | String imagePath = FileUtils.createFile("D:/LocalCaptureTemp/" + cameraId + ".jpeg"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String imagePath = FileUtils.createFile(tempPath + "/" + cameraId + ".jpeg"); |
| | | fCaptureReceiveCB1 m_CaptureReceiveCB = new fCaptureReceiveCB1(imagePath); |
| | | CapturePictureModule.setSnapRevCallBack(m_CaptureReceiveCB); |
| | | boolean b = CapturePictureModule.remoteCapturePicture(loginId, chanNo - 1); |
| | |
| | | @Override |
| | | public AjaxResult localRecordStart(CameraCmd cmd) { |
| | | try { |
| | | String operator = cmd.getOperator(); |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer chanNo = cmd.getChanNo(); |
| | | |
| | |
| | | // GlobalVariable.previewMap.remove(cameraId); |
| | | // log.debug("停止当前录像"); |
| | | //} |
| | | String path = FileUtils.createFile("D:/LocalRecordTemp/" + cameraId + ".mp4"); |
| | | |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + operator + "/" + cameraId + ".mp4"); |
| | | LLong lRealHandle = RealPlayModule.startRealPlay(loginId, chanNo - 1, path); |
| | | if (lRealHandle.longValue() <= 0) { |
| | | log.error("取流失败" + getErrorCodePrint()); |
| | |
| | | @Override |
| | | public AjaxResult localRecordStop(CameraCmd cmd) { |
| | | try { |
| | | String operator = cmd.getOperator(); |
| | | String cameraId = cmd.getCameraId(); |
| | | LLong lRealHandle = new LLong(cmd.getRecordId()); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return AjaxResult.warn("设备未登录"); |
| | | } |
| | | |
| | | RealPlayModule.stopRealPlay(lRealHandle); |
| | | log.debug("本地录像停止"); |
| | | String recordPath = FileUtils.createFile("D:/LocalRecordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String recordPath = FileUtils.createFile(tempPath + "/" + operator + "/" + cameraId + ".mp4"); |
| | | byte[] imageBytes = Files.readAllBytes(Paths.get(recordPath)); |
| | | // OutputStream outputStream = response.getOutputStream(); |
| | | // outputStream.write(imageBytes); |
| | | return AjaxResult.success(imageBytes); |
| | | //if (GlobalVariable.previewMap.containsKey(cameraId)) { |
| | | // lRealHandle = new LLong(GlobalVariable.previewMap.get(cameraId)); |
| | | // RealPlayModule.stopRealPlay(lRealHandle); |
| | | // GlobalVariable.previewMap.remove(cameraId); |
| | | // log.debug("本地录像停止"); |
| | | // String recordPath = FileUtils.createFile("D:/LocalRecordTemp/" + cameraId + ".mp4"); |
| | | // byte[] imageBytes = Files.readAllBytes(Paths.get(recordPath)); |
| | | // // OutputStream outputStream = response.getOutputStream(); |
| | | // // outputStream.write(imageBytes); |
| | | // return AjaxResult.success(imageBytes); |
| | | //} |
| | | //else { |
| | | // return AjaxResult.error("设备未开始录像"); |
| | | //} |
| | | } catch (Exception ex) { |
| | | log.error("本地录像停止异常" + ex.getMessage()); |
| | | return AjaxResult.error("本地录像停止异常" + ex.getMessage()); |
| | |
| | | String url = ""; |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer chanNo = cmd.getChanNo(); |
| | | String path = FileUtils.createFile("D:/recordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | boolean enable = cmd.isEnable(); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return ""; |
| | |
| | | try { |
| | | String cameraId = cmd.getCameraId(); |
| | | Integer chanNo = cmd.getChanNo(); |
| | | String path = FileUtils.createFile("D:/recordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return false; |
| | | } |
| | |
| | | String url = ""; |
| | | try { |
| | | String cameraId = cmd.getCameraId(); |
| | | String path = FileUtils.createFile("D:/recordTemp/" + cameraId + ".mp4"); |
| | | // 本地临时录像地址 |
| | | String tempPath = ARDConfig.getProfile() + Constants.LOCAL_RECORD_TEMP_PREFIX; |
| | | String path = FileUtils.createFile(tempPath + "/" + cameraId + ".mp4"); |
| | | if (!GlobalVariable.loginMap.containsKey(cameraId)) { |
| | | return ""; |
| | | } |