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_VI_MANAGER_H 17 #define HOS_CAMERA_VI_MANAGER_H 18 19 #include "imanager.h" 20 #include "device_manager_adapter.h" 21 #include "vi_controller.h" 22 23 namespace OHOS { 24 namespace Camera { 25 class ViManager : public IManager { 26 public: 27 ViManager(); 28 explicit ViManager(ManagerId managerId); 29 virtual ~ViManager(); 30 RetCode CreateController(ControllerId controllerId, std::string hardwareName); 31 std::shared_ptr<IController> GetController(ControllerId controllerId); 32 std::shared_ptr<ISensor> GetSensor(std::string sensorName); Configure(std::shared_ptr<CameraMetadata> meta)33 void Configure(std::shared_ptr<CameraMetadata> meta) 34 { 35 vi_->Configure(meta); 36 }; ConfigVi()37 RetCode ConfigVi() 38 { 39 return vi_->ConfigVi(); 40 }; StartVi()41 RetCode StartVi() 42 { 43 return vi_->StartVi(); 44 }; StopVi()45 RetCode StopVi() 46 { 47 return vi_->StopVi(); 48 }; GetFrameRateBySensor(int32_t CameraId,int32_t * pu32FrameRate)49 RetCode GetFrameRateBySensor(int32_t CameraId, int32_t* pu32FrameRate) 50 { 51 (void)CameraId; 52 (void)pu32FrameRate; 53 return RC_OK; 54 }; 55 CameraMetadata GetSensorInfo(CameraId cameraIdt); StartCapture(int32_t snapCnt)56 RetCode StartCapture(int32_t snapCnt) 57 { 58 (void)snapCnt; 59 return RC_OK; 60 }; 61 RetCode PowerUp(CameraId cameraId); 62 RetCode PowerDown(CameraId cameraId); SetAbilityMetaDataTag(std::vector<int32_t> abilityMetaDataTag)63 void SetAbilityMetaDataTag(std::vector<int32_t> abilityMetaDataTag) 64 { 65 vi_->SetAbilityMetaDataTag(abilityMetaDataTag); 66 }; GetAbilityMetaData(std::shared_ptr<CameraMetadata> meta)67 RetCode GetAbilityMetaData(std::shared_ptr<CameraMetadata> meta) 68 { 69 return vi_->GetAbilityMetaData(meta); 70 }; GetMetaDataFlag()71 bool GetMetaDataFlag() 72 { 73 return vi_->GetMetaDataFlag(); 74 }; SetMetaDataFlag(bool metaDataFlag)75 void SetMetaDataFlag(bool metaDataFlag) 76 { 77 vi_->SetMetaDataFlag(metaDataFlag); 78 }; SetFlashlight(FlashMode flashMode,bool enable)79 RetCode SetFlashlight(FlashMode flashMode, bool enable) 80 { 81 return vi_->SetFlashlight(flashMode, enable); 82 }; 83 84 private: 85 std::shared_ptr<ViController> vi_ = nullptr; 86 }; 87 } // namespace Camera 88 } // namespace OHOS 89 #endif 90