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_IMANAGER_H 17 #define HOS_CAMERA_IMANAGER_H 18 19 #include "icontroller.h" 20 #include "device_manager_adapter.h" 21 22 namespace OHOS::Camera { 23 class IManager { 24 public: 25 IManager(); 26 explicit IManager(ManagerId managerId); 27 virtual ~IManager(); 28 virtual void Configure(std::shared_ptr<CameraStandard::CameraMetadata> meta) = 0; GetManagerId()29 ManagerId GetManagerId() 30 { 31 return managerID_; 32 }; GetController(ControllerId controllerId,std::string hardwareName)33 virtual std::shared_ptr<IController> GetController(ControllerId controllerId, std::string hardwareName) 34 { 35 return nullptr; 36 }; GetController(ControllerId controllerId)37 virtual std::shared_ptr<IController> GetController(ControllerId controllerId) 38 { 39 return nullptr; 40 }; CreateController(CameraId cameraId,ControllerId controllerId,std::string hardwareName)41 virtual RetCode CreateController(CameraId cameraId, ControllerId controllerId, std::string hardwareName) 42 { 43 return RC_OK; 44 }; CreateController(ControllerId controllerId,std::string hardwareName)45 virtual RetCode CreateController(ControllerId controllerId, std::string hardwareName) 46 { 47 return RC_OK; 48 }; PowerUp(CameraId cameraId)49 virtual RetCode PowerUp(CameraId cameraId) 50 { 51 return RC_OK; 52 }; PowerDown(CameraId cameraId)53 virtual RetCode PowerDown(CameraId cameraId) 54 { 55 return RC_OK; 56 }; PowerUp(std::string hardwareName)57 virtual RetCode PowerUp(std::string hardwareName) 58 { 59 return RC_OK; 60 }; PowerDown(std::string hardwareName)61 virtual RetCode PowerDown(std::string hardwareName) 62 { 63 return RC_OK; 64 }; SetAbilityMetaDataTag(std::vector<int32_t> abilityMetaDataTag)65 virtual void SetAbilityMetaDataTag(std::vector<int32_t> abilityMetaDataTag) {}; SetAbilityMetaDataTag(std::vector<int32_t> abilityMetaDataTag,std::string hardwareName)66 virtual void SetAbilityMetaDataTag(std::vector<int32_t> abilityMetaDataTag, std::string hardwareName) {}; GetAbilityMetaData(std::shared_ptr<CameraStandard::CameraMetadata> meta)67 virtual RetCode GetAbilityMetaData(std::shared_ptr<CameraStandard::CameraMetadata> meta) 68 { 69 return RC_OK; 70 }; GetAbilityMetaData(std::shared_ptr<CameraStandard::CameraMetadata> meta,std::string hardwareName)71 virtual RetCode GetAbilityMetaData(std::shared_ptr<CameraStandard::CameraMetadata> meta, std::string hardwareName) 72 { 73 return RC_OK; 74 }; GetMetaDataFlag()75 virtual bool GetMetaDataFlag() 76 { 77 return false; 78 }; SetMetaDataFlag(bool metaDataFlag)79 virtual void SetMetaDataFlag(bool metaDataFlag) {}; 80 81 private: 82 ManagerId managerID_; 83 }; 84 } // namespace OHOS::Camera 85 #endif