1 /* 2 * Copyright (c) 2022 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 METADATA_CONFIG_H 17 #define METADATA_CONFIG_H 18 19 #include "device_manager_adapter.h" 20 #include <map> 21 22 namespace OHOS { 23 namespace Camera { 24 constexpr uint32_t DEVICE_STREAM_ID = 0; 25 constexpr uint32_t ENTRY_CAPACITY = 30; 26 constexpr uint32_t DATA_CAPACITY = 2000; 27 28 class MetadataConfig { 29 using CameraMetadataMap = std::map<int32_t, std::shared_ptr<CameraMetadata>>; 30 31 public: 32 MetadataConfig(); 33 ~MetadataConfig(); 34 35 bool UpdateSettingsConfig(int32_t streamId, bool isNew, const std::vector<int32_t> &updateKeys, 36 const std::shared_ptr<CameraMetadata> &metaData); 37 bool GetMetadata(int32_t streamId, std::shared_ptr<CameraMetadata> &metaData); 38 void GetDeviceDefaultMetadata(std::shared_ptr<CameraMetadata> &metaData); 39 40 private: 41 CameraMetadataMap metadata_; 42 }; 43 } // namespace Camera 44 } // namespace OHOS 45 #endif /* METADATA_CONFIG_H */ 46