1 /* 2 * Copyright (c) 2023 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 OHOS_VDI_CAMERA_V1_0_ICAMERAHOSTVDI_H 17 #define OHOS_VDI_CAMERA_V1_0_ICAMERAHOSTVDI_H 18 19 #include <stdint.h> 20 #include <string> 21 #include <vector> 22 #include <hdf_base.h> 23 #include <hdi_base.h> 24 #include "v1_0/icamera_device_vdi.h" 25 #include "v1_0/icamera_device_vdi_callback.h" 26 #include "v1_0/icamera_host_vdi_callback.h" 27 #include "hdf_load_vdi.h" 28 29 30 namespace OHOS { 31 namespace VDI { 32 namespace Camera { 33 namespace V1_0 { 34 using namespace OHOS; 35 using namespace OHOS::HDI; 36 37 class ICameraHostVdi : public HdiBase { 38 public: 39 virtual ~ICameraHostVdi() = default; 40 41 static sptr<ICameraHostVdi> Get(bool isStub = false); 42 static sptr<ICameraHostVdi> Get(const std::string &serviceName, bool isStub = false); 43 44 virtual int32_t SetCallback(const sptr<ICameraHostVdiCallback> &callbackObj) = 0; 45 46 virtual int32_t GetCameraIds(std::vector<std::string> &cameraIds) = 0; 47 48 virtual int32_t GetCameraAbility(const std::string &cameraId, std::vector<uint8_t> &cameraAbility) = 0; 49 50 virtual int32_t OpenCamera(const std::string &cameraId, const sptr<ICameraDeviceVdiCallback> &callbackObj, 51 sptr<ICameraDeviceVdi> &device) = 0; 52 53 virtual int32_t SetFlashlight(const std::string &cameraId, bool isEnable) = 0; 54 }; 55 56 57 struct VdiWrapperCameraHost { 58 struct HdfVdiBase base; 59 ICameraHostVdi *module; 60 }; 61 } // V1_0 62 } // Camera 63 } // VDI 64 } // OHOS 65 #endif // OHOS_VDI_CAMERA_V1_0_ICAMERAHOSTVDI_H 66