• 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 CAMERA_HOST_CONFIG_MANAGER_H
17 #define CAMERA_HOST_CONFIG_MANAGER_H
18 
19 #include <vector>
20 #include <map>
21 #include <list>
22 #include "utils.h"
23 
24 namespace OHOS::Camera {
25 class ConfigManager {
26 public:
27     CamRetCode ReadConfigFile();
28     CamRetCode GetCameraIds(std::vector<std::string> &cameraIds);
29     CamRetCode GetPhysicCameraIds(const std::string &lCameraId, std::vector<std::string> &pCameraIds);
30     CamRetCode GetCameraAbility(const std::string &cameraId, std::shared_ptr<CameraAbility> &ability);
31 
32 public:
33     ConfigManager();
34     virtual ~ConfigManager();
35     ConfigManager(const ConfigManager &other) = delete;
36     ConfigManager(ConfigManager &&other) = delete;
37     ConfigManager& operator=(const ConfigManager &other) = delete;
38     ConfigManager& operator=(ConfigManager &&other) = delete;
39 
40 public:
41     // key: config cameraId; value: DeviceManager cameraId enum
42     static std::map<std::string, CameraId> enumCameraIdMap_;
43 
44 private:
45     // key: cameraId, value: CameraAbility
46     using CameraAbilityMap = std::map<std::string, std::shared_ptr<CameraAbility>>;
47     CameraAbilityMap cameraAbilityMap_;
48     // key: logicCameraId, value: physicsCameraIds
49     using CameraIdMap = std::map<std::string, std::vector<std::string>>;
50     CameraIdMap cameraIdMap_;
51 };
52 } // end namespace OHOS::Camera
53 #endif // CAMERA_HOST_CONFIG_MANAGER_H
54