ソースを参照

摄像头 修改

gaodd 3 ヶ月 前
コミット
cbc6dd4861

+ 61 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/hk/constant/HkProtocolEnum.java

@@ -0,0 +1,61 @@
1
+package com.unis.equipmentOnlineRateAssessment.modular.hk.constant;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Getter;
5
+
6
+/**
7
+ * 取流协议(应用层协议)
8
+ * hik”:HIK私有协议,使用视频SDK进行播放时,传入此类型;
9
+ * “rtsp”:RTSP协议;
10
+ * “rtmp”:RTMP协议(RTMP协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
11
+ * “hls”:HLS协议(HLS协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
12
+ * “ws”:Websocket协议(一般用于H5视频播放器取流播放)。
13
+ * 参数不填,默认为HIK协议
14
+ *
15
+ * @author ybw
16
+ * @version V1.0
17
+ * @className HkProtocolEnum
18
+ * @date 2024/7/24
19
+ **/
20
+@AllArgsConstructor
21
+@Getter
22
+public enum HkProtocolEnum {
23
+
24
+    /**
25
+     * hik”:HIK私有协议,使用视频SDK进行播放时,传入此类型;
26
+     *
27
+     * @author: ybw
28
+     * @date: 2024/7/24
29
+     **/
30
+    HIK("hik"),
31
+    /**
32
+     * “rtsp”:RTSP协议;
33
+     *
34
+     * @author: ybw
35
+     * @date: 2024/7/24
36
+     **/
37
+    RTSP("rtsp"),
38
+    /**
39
+     * “rtmp”:RTMP协议(RTMP协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
40
+     *
41
+     * @author: ybw
42
+     * @date: 2024/7/24
43
+     **/
44
+    RTMP("rtmp"),
45
+    /**
46
+     * “hls”:HLS协议(HLS协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
47
+     *
48
+     * @author: ybw
49
+     * @date: 2024/7/24
50
+     **/
51
+    HLS("hls"),
52
+    /**
53
+     * “ws”:Websocket协议(一般用于H5视频播放器取流播放)。
54
+     *
55
+     * @author: ybw
56
+     * @date: 2024/7/24
57
+     **/
58
+    WS("ws");
59
+
60
+    private String name;
61
+}

+ 6 - 4
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/hk/controller/PreviewPlaybackController.java

@@ -5,6 +5,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
5 5
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
6 6
 import com.unis.common.pojo.CommonResult;
7 7
 import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req.*;
8
+import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res.CaptureResDTO;
8 9
 import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res.PlaybackResDTO;
9 10
 import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res.PreviewResDTO;
10 11
 import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res.RecordStartResDTO;
@@ -61,8 +62,8 @@ public class PreviewPlaybackController {
61 62
      */
62 63
     @ApiOperation(value="*开始手动录像", notes = "开始手动录像")
63 64
     @GetMapping("/previewPlayback/recordStart")
64
-    public RecordStartResDTO recordStart(RecordStartReqDTO recordStartReqDTO) {
65
-        return hkService.recordStart(recordStartReqDTO);
65
+    public CommonResult<RecordStartResDTO> recordStart(RecordStartReqDTO recordStartReqDTO) {
66
+        return CommonResult.data(hkService.recordStart(recordStartReqDTO));
66 67
     }
67 68
 
68 69
     /**
@@ -82,8 +83,9 @@ public class PreviewPlaybackController {
82 83
      */
83 84
     @ApiOperation(value="*手动抓图", notes = "手动抓图")
84 85
     @GetMapping("/previewPlayback/manualCapture")
85
-    public void manualCapture(CaptureReqDTO captureReqDTO) {
86
-        hkService.manualCapture(captureReqDTO);
86
+    public CommonResult<String> manualCapture(CaptureReqDTO captureReqDTO) {
87
+        CaptureResDTO captureResDTO = hkService.manualCapture(captureReqDTO);
88
+        return CommonResult.data(captureResDTO.getPicUrl());
87 89
     }
88 90
 
89 91
     @ApiOperation(value="*云台控制", notes = "云台控制")

+ 2 - 1
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/hk/dto/req/CaptureReqDTO.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req;
2 2
 
3
+
3 4
 import lombok.AllArgsConstructor;
4 5
 import lombok.Data;
5 6
 
@@ -12,7 +13,7 @@ import lombok.Data;
12 13
  * @date 2024/6/22
13 14
  **/
14 15
 @Data
15
-@AllArgsConstructor
16
+//@AllArgsConstructor
16 17
 public class CaptureReqDTO {
17 18
     /**
18 19
      * 监控点编号

+ 38 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/hk/dto/req/Preview2ReqDTO.java

@@ -0,0 +1,38 @@
1
+package com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * 获取监控点预览取流 获取监控点预览取流  URLv2
7
+ *
8
+ * @author ybw
9
+ * @version V1.0
10
+ * @className PreviewReqVO
11
+ * @date 2024/6/20
12
+ **/
13
+@Data
14
+public class Preview2ReqDTO {
15
+    /**
16
+     * 监控点编号
17
+     *
18
+     * @author: ybw
19
+     * @date: 2024/6/19
20
+     **/
21
+    private String cameraIndexCode;
22
+
23
+    /**
24
+     * 取流协议(应用层协议),
25
+     * “hik”:HIK私有协议,使用视频SDK进行播放时,传入此类型;
26
+     * “rtsp”:RTSP协议;
27
+     * “rtmp”:RTMP协议(RTMP协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
28
+     * “hls”:HLS协议(HLS协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
29
+     * “ws”:Websocket协议(一般用于H5视频播放器取流播放)。
30
+     * 参数不填,默认为HIK协议
31
+     */
32
+    private String protocol;
33
+
34
+    public Preview2ReqDTO(PreviewReqDTO previewReqDTO) {
35
+        this.cameraIndexCode = previewReqDTO.getCameraIndexCode();
36
+        this.protocol = previewReqDTO.getProtocol().getName();
37
+    }
38
+}

+ 12 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/hk/dto/req/PreviewReqDTO.java

@@ -1,5 +1,6 @@
1 1
 package com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req;
2 2
 
3
+import com.unis.equipmentOnlineRateAssessment.modular.hk.constant.HkProtocolEnum;
3 4
 import lombok.AllArgsConstructor;
4 5
 import lombok.Data;
5 6
 
@@ -21,4 +22,15 @@ public class PreviewReqDTO {
21 22
      * @date: 2024/6/19
22 23
      **/
23 24
     private String cameraIndexCode;
25
+
26
+    /**
27
+     * 取流协议(应用层协议),
28
+     * “hik”:HIK私有协议,使用视频SDK进行播放时,传入此类型;
29
+     * “rtsp”:RTSP协议;
30
+     * “rtmp”:RTMP协议(RTMP协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
31
+     * “hls”:HLS协议(HLS协议只支持海康SDK协议、EHOME协议、ONVIF协议接入的设备;只支持H264视频编码和AAC音频编码);
32
+     * “ws”:Websocket协议(一般用于H5视频播放器取流播放)。
33
+     * 参数不填,默认为HIK协议
34
+     */
35
+    private HkProtocolEnum protocol;
24 36
 }

+ 4 - 2
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/hk/dto/req/RecordStartReqDTO.java

@@ -1,6 +1,6 @@
1 1
 package com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req;
2 2
 
3
-import lombok.AllArgsConstructor;
3
+
4 4
 import lombok.Data;
5 5
 
6 6
 /**
@@ -12,7 +12,7 @@ import lombok.Data;
12 12
  * @date 2024/6/20
13 13
  **/
14 14
 @Data
15
-@AllArgsConstructor
15
+//@AllArgsConstructor
16 16
 public class RecordStartReqDTO {
17 17
 
18 18
     /**
@@ -29,5 +29,7 @@ public class RecordStartReqDTO {
29 29
      * 存储类型,0-中心存储,1-设备存储,默认为0-中心存储,如果不指定则默认采用中心存储方式
30 30
      */
31 31
     private Integer type;
32
+
33
+    
32 34
 }
33 35
 

+ 62 - 0
unis-plugin/unis-plugin-biz/src/main/java/com/unis/equipmentOnlineRateAssessment/modular/hk/dto/res/CamerasResDTO.java

@@ -0,0 +1,62 @@
1
+package com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @author ybw
7
+ * @version V1.0
8
+ * @className CamerasResDTO
9
+ * @date 2024/7/23
10
+ **/
11
+@Data
12
+public class CamerasResDTO {
13
+    /**
14
+     * 海拔
15
+     *
16
+     * @author: ybw
17
+     * @date: 2024/7/23
18
+     **/
19
+    private String altitude;
20
+    /**
21
+     * 监控点唯一标识
22
+     *
23
+     * @author: ybw
24
+     * @date: 2024/7/23
25
+     **/
26
+    private String cameraIndexCode;
27
+    private String cameraName;
28
+    private int cameraType;
29
+    private String cameraTypeName;
30
+    private String capabilitySet;
31
+    private String capabilitySetName;
32
+    private String intelligentSet;
33
+    private String intelligentSetName;
34
+    private String channelNo;
35
+    private String channelType;
36
+    private String channelTypeName;
37
+    private String createTime;
38
+    private String encodeDevIndexCode;
39
+    private String encodeDevResourceType;
40
+    private String encodeDevResourceTypeName;
41
+    private String gbIndexCode;
42
+    private String installLocation;
43
+    private String keyBoardCode;
44
+    private String latitude;
45
+    private String longitude;
46
+    private int pixel;
47
+    private int ptz;
48
+    private int ptzController;
49
+    private String ptzControllerName;
50
+    private String ptzName;
51
+    private String recordLocation;
52
+    private String recordLocationName;
53
+    private String regionIndexCode;
54
+    private int status;
55
+    private String statusName;
56
+    private int transType;
57
+    private String transTypeName;
58
+    private String treatyType;
59
+    private String treatyTypeName;
60
+    private String viewshed;
61
+    private String updateTime;
62
+}

+ 2 - 1
unis-plugin/unis-plugin-biz/src/main/java/com/unis/mobileInfo/modular/videoSurveillance/controller/MobileEndPreviewController.java

@@ -4,6 +4,7 @@ package com.unis.mobileInfo.modular.videoSurveillance.controller;
4 4
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
5 5
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
6 6
 import com.unis.common.pojo.CommonResult;
7
+import com.unis.equipmentOnlineRateAssessment.modular.hk.constant.HkProtocolEnum;
7 8
 import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.req.PreviewReqDTO;
8 9
 import com.unis.equipmentOnlineRateAssessment.modular.hk.dto.res.PreviewResDTO;
9 10
 import com.unis.equipmentOnlineRateAssessment.modular.hk.service.HkService;
@@ -55,7 +56,7 @@ public class MobileEndPreviewController {
55 56
         List<MonitorCamera> monitorCameraList = monitorCameraService.getlistByOrgId(orgId);
56 57
 
57 58
         for (MonitorCamera monitorCamera:monitorCameraList){
58
-            PreviewReqDTO previewReqDTO = new PreviewReqDTO(monitorCamera.getCameraIndexCode());
59
+            PreviewReqDTO previewReqDTO = new PreviewReqDTO(monitorCamera.getCameraIndexCode(), HkProtocolEnum.WS);
59 60
             PreviewResDTO previewResDTO = hkService.previewURLs(previewReqDTO);
60 61
             returnList.add(previewResDTO);
61 62
         }