• 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_ICONTROLLER_H
17 #define HOS_CAMERA_ICONTROLLER_H
18 
19 #include "device_manager_adapter.h"
20 #include <mutex>
21 #include <string>
22 
23 namespace OHOS::Camera {
24 class IController {
25 public:
26     IController();
27     explicit IController(std::string hardwareName);
28     virtual ~IController();
29     virtual RetCode Init() = 0;
GetName()30     std::string GetName()
31     {
32         return hardwareName_;
33     };
34     bool GetPowerOnState();
35     void SetPowerOnState(bool powerOnState);
36     virtual void SetAbilityMetaDataTag(std::vector<int32_t> abilityMetaDataTag) = 0;
37     virtual RetCode GetAbilityMetaData(std::shared_ptr<CameraStandard::CameraMetadata> meta) = 0;
GetMetaDataFlag()38     virtual bool GetMetaDataFlag()
39     {
40         return false;
41     };
SetMetaDataFlag(bool metaDataFlag)42     virtual void SetMetaDataFlag(bool metaDataFlag) {};
43     virtual RetCode Configure(std::shared_ptr<CameraStandard::CameraMetadata> meta) = 0;
44 
45 private:
46     std::mutex powerOnStatelock_;
47     std::string hardwareName_;
48     bool powerOnState_ = false;
49 };
50 } // namespace OHOS::Camera
51 #endif