• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef HOS_CAMERA_DEVICE_MANAGER_ADAPTER_H
17 #define HOS_CAMERA_DEVICE_MANAGER_ADAPTER_H
18 
19 #include "camera.h"
20 #include "ibuffer.h"
21 #include <memory>
22 #include <stdint.h>
23 #include <stdio.h>
24 #include <string>
25 #include <type_traits>
26 #include <vector>
27 #include "camera_metadata_info.h"
28 #include "stream.h"
29 #include <functional>
30 
31 namespace OHOS::Camera {
32 enum ManagerId {
33     DM_M_ISP,
34     DM_M_SENSOR,
35     DM_M_FLASH,
36     DM_M_VENC,
37     DM_M_VI,
38     DM_M_VO,
39     DM_M_VPSS,
40     DM_M_MAX
41 };
42 
43 enum ControllerId : uint32_t{
44     DM_C_ISP,
45     DM_C_SENSOR,
46     DM_C_FLASH,
47     DM_C_VCM,
48     DM_C_OIS,
49     DM_C_VENC,
50     DM_C_VI,
51     DM_C_VO,
52     DM_C_VPSS,
53     DM_C_MAX
54 };
55 
56 enum CameraId : int32_t {
57     CAMERA_FIRST = 0,
58     CAMERA_SECOND,
59     CAMERA_THIRD,
60     CAMERA_FOURTH,
61     CAMERA_FIFTH,
62     CAMERA_SIXTH,
63     CAMERA_MAX
64 };
65 
66 struct HardwareConfiguration {
67     CameraId cameraId;
68     ManagerId managerId;
69     ControllerId controllerId;
70     std::string hardwareName;
71 };
72 using HardwareConfiguration = struct HardwareConfiguration;
73 
74 struct camera_metadata_rational {
75     int32_t numerator;
76     int32_t denominator;
77 };
78 using camera_rational_t = struct camera_metadata_rational;
79 
80 using NodeBufferCb = std::function<void(std::shared_ptr<FrameSpec>)>;
81 using MetaDataCb = std::function<void(std::shared_ptr<CameraStandard::CameraMetadata>)>;
82 using UvcMetaDataCb = std::function<void(std::shared_ptr<CameraStandard::CameraMetadata>, bool, CameraId)>;
83 using DeviceStatusCb = std::function<void()>;
84 
85 } // namespace OHOS::Camera
86 #endif
87