1 /* 2 * Copyright (c) 2022 Rockchip Eletronics Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 * Author: Cody Xie <cody.xie@rock-chips.com> 17 */ 18 19 #ifndef _RK_AIQ_CAM_PROFILES_H_ 20 #define _RK_AIQ_CAM_PROFILES_H_ 21 22 #include <unordered_map> 23 #include <vector> 24 #include <stdint.h> 25 #include <string> 26 27 namespace RkCam { 28 29 class CamProfiles { 30 public: 31 enum AlgoSchedPolicy { 32 kDisabled = 0, 33 kSingleOnly = (1 << 0), 34 kGroupOnly = (1 << 1), 35 kBoth = (kSingleOnly | kGroupOnly), 36 }; 37 38 struct GroupProfile { 39 uint8_t group_id; 40 union { 41 uint16_t cam0 : 1; 42 uint16_t cam1 : 1; 43 uint16_t cam2 : 1; 44 uint16_t cam3 : 1; 45 uint16_t cam4 : 1; 46 uint16_t cam5 : 1; 47 uint16_t cam6 : 1; 48 uint16_t cam7 : 1; 49 uint16_t reserved : 8; 50 uint16_t cams; 51 }; 52 uint8_t master_cam; 53 bool sync; 54 }; 55 56 CamProfiles(); 57 ~CamProfiles(); 58 getAlgoPolicies()59 std::unordered_map<int, int>& getAlgoPolicies() { return algo_policies_; } 60 61 void ParseFromIni(const std::string ini_path); 62 63 private: 64 uint8_t group_count_{0}; 65 std::vector<GroupProfile> group_profiles_{}; 66 std::unordered_map<int, int> algo_policies_{}; 67 }; 68 69 } // namespace RkCam 70 71 #endif //_RK_AIQ_CAM_PROFILES_H_ 72