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 { 32 namespace Camera { 33 enum ManagerId { 34 DM_M_ISP, 35 DM_M_SENSOR, 36 DM_M_FLASH, 37 DM_M_VENC, 38 DM_M_VI, 39 DM_M_VO, 40 DM_M_VPSS, 41 DM_M_MAX 42 }; 43 44 enum ControllerId : uint32_t { 45 DM_C_ISP, 46 DM_C_SENSOR, 47 DM_C_FLASH, 48 DM_C_VCM, 49 DM_C_OIS, 50 DM_C_VENC, 51 DM_C_VI, 52 DM_C_VO, 53 DM_C_VPSS, 54 DM_C_MAX 55 }; 56 57 enum CameraId : int32_t { 58 CAMERA_FIRST = 0, 59 CAMERA_SECOND, 60 CAMERA_THIRD, 61 CAMERA_FOURTH, 62 CAMERA_FIFTH, 63 CAMERA_SIXTH, 64 CAMERA_MAX 65 }; 66 67 using HardwareConfiguration = struct HardwareConfiguration_t { 68 CameraId cameraId; 69 ManagerId managerId; 70 ControllerId controllerId; 71 std::string hardwareName; 72 }; 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<CameraMetadata>)>; 82 using HotplugDevCb = std::function<void(std::shared_ptr<CameraMetadata>, bool, CameraId)>; 83 using DeviceStatusCb = std::function<void()>; 84 85 } // namespace Camera 86 } // namespace OHOS 87 #endif 88