1c5e268c6Sopenharmony_ci/* 2c5e268c6Sopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3c5e268c6Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4c5e268c6Sopenharmony_ci * you may not use this file except in compliance with the License. 5c5e268c6Sopenharmony_ci * You may obtain a copy of the License at 6c5e268c6Sopenharmony_ci * 7c5e268c6Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8c5e268c6Sopenharmony_ci * 9c5e268c6Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10c5e268c6Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11c5e268c6Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12c5e268c6Sopenharmony_ci * See the License for the specific language governing permissions and 13c5e268c6Sopenharmony_ci * limitations under the License. 14c5e268c6Sopenharmony_ci */ 15c5e268c6Sopenharmony_ci 16c5e268c6Sopenharmony_ci#include "camera_metadata_info.h" 17c5e268c6Sopenharmony_ci 18c5e268c6Sopenharmony_cinamespace OHOS::Camera { 19c5e268c6Sopenharmony_ciuint8_t *GetMetadataData(const common_metadata_header_t *metadataHeader) 20c5e268c6Sopenharmony_ci{ 21c5e268c6Sopenharmony_ci return CameraMetadata::GetMetadataData(metadataHeader); 22c5e268c6Sopenharmony_ci} 23c5e268c6Sopenharmony_ci 24c5e268c6Sopenharmony_cicamera_metadata_item_entry_t *GetMetadataItems(const common_metadata_header_t *metadataHeader) 25c5e268c6Sopenharmony_ci{ 26c5e268c6Sopenharmony_ci return CameraMetadata::GetMetadataItems(metadataHeader); 27c5e268c6Sopenharmony_ci} 28c5e268c6Sopenharmony_ci 29c5e268c6Sopenharmony_cicommon_metadata_header_t *FillCameraMetadata(common_metadata_header_t *buffer, size_t memoryRequired, 30c5e268c6Sopenharmony_ci uint32_t itemCapacity, uint32_t dataCapacity) 31c5e268c6Sopenharmony_ci{ 32c5e268c6Sopenharmony_ci return CameraMetadata::FillCameraMetadata(buffer, memoryRequired, itemCapacity, dataCapacity); 33c5e268c6Sopenharmony_ci} 34c5e268c6Sopenharmony_ci 35c5e268c6Sopenharmony_cicommon_metadata_header_t *AllocateCameraMetadataBuffer(uint32_t item_capacity, uint32_t data_capacity) 36c5e268c6Sopenharmony_ci{ 37c5e268c6Sopenharmony_ci return CameraMetadata::AllocateCameraMetadataBuffer(item_capacity, data_capacity); 38c5e268c6Sopenharmony_ci} 39c5e268c6Sopenharmony_ci 40c5e268c6Sopenharmony_ciint32_t GetMetadataSection(uint32_t itemSection, uint32_t *section) 41c5e268c6Sopenharmony_ci{ 42c5e268c6Sopenharmony_ci return CameraMetadata::GetMetadataSection(itemSection, section); 43c5e268c6Sopenharmony_ci} 44c5e268c6Sopenharmony_ci 45c5e268c6Sopenharmony_ciint32_t GetCameraMetadataItemType(uint32_t item, uint32_t *dataType) 46c5e268c6Sopenharmony_ci{ 47c5e268c6Sopenharmony_ci return CameraMetadata::GetCameraMetadataItemType(item, dataType); 48c5e268c6Sopenharmony_ci} 49c5e268c6Sopenharmony_ci 50c5e268c6Sopenharmony_ciconst char *GetCameraMetadataItemName(uint32_t item) 51c5e268c6Sopenharmony_ci{ 52c5e268c6Sopenharmony_ci return CameraMetadata::GetCameraMetadataItemName(item); 53c5e268c6Sopenharmony_ci} 54c5e268c6Sopenharmony_ci 55c5e268c6Sopenharmony_ciint32_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t dataCount) 56c5e268c6Sopenharmony_ci{ 57c5e268c6Sopenharmony_ci return CameraMetadata::CalculateCameraMetadataItemDataSize(type, dataCount); 58c5e268c6Sopenharmony_ci} 59c5e268c6Sopenharmony_ci 60c5e268c6Sopenharmony_ciint AddCameraMetadataItem(common_metadata_header_t *dst, uint32_t item, const void *data, size_t dataCount) 61c5e268c6Sopenharmony_ci{ 62c5e268c6Sopenharmony_ci return CameraMetadata::AddCameraMetadataItem(dst, item, data, dataCount); 63c5e268c6Sopenharmony_ci} 64c5e268c6Sopenharmony_ci 65c5e268c6Sopenharmony_ciint GetCameraMetadataItem(const common_metadata_header_t *src, uint32_t index, camera_metadata_item_t *item) 66c5e268c6Sopenharmony_ci{ 67c5e268c6Sopenharmony_ci return CameraMetadata::GetCameraMetadataItem(src, index, item); 68c5e268c6Sopenharmony_ci} 69c5e268c6Sopenharmony_ci 70c5e268c6Sopenharmony_ciint FindCameraMetadataItemIndex(const common_metadata_header_t *src, uint32_t item, uint32_t *idx) 71c5e268c6Sopenharmony_ci{ 72c5e268c6Sopenharmony_ci return CameraMetadata::FindCameraMetadataItemIndex(src, item, idx); 73c5e268c6Sopenharmony_ci} 74c5e268c6Sopenharmony_ci 75c5e268c6Sopenharmony_ciint FindCameraMetadataItem(const common_metadata_header_t *src, uint32_t item, camera_metadata_item_t *metadataItem) 76c5e268c6Sopenharmony_ci{ 77c5e268c6Sopenharmony_ci return CameraMetadata::FindCameraMetadataItem(src, item, metadataItem); 78c5e268c6Sopenharmony_ci} 79c5e268c6Sopenharmony_ci 80c5e268c6Sopenharmony_cibool IsCameraMetadataItemExist(const common_metadata_header_t *src, uint32_t item) 81c5e268c6Sopenharmony_ci{ 82c5e268c6Sopenharmony_ci return CameraMetadata::IsCameraMetadataItemExist(src, item); 83c5e268c6Sopenharmony_ci} 84c5e268c6Sopenharmony_ci 85c5e268c6Sopenharmony_ciint MetadataExpandItemMem(common_metadata_header_t *dst, camera_metadata_item_entry_t *item, 86c5e268c6Sopenharmony_ci size_t oldItemSize) 87c5e268c6Sopenharmony_ci{ 88c5e268c6Sopenharmony_ci return CameraMetadata::MetadataExpandItemMem(dst, item, oldItemSize); 89c5e268c6Sopenharmony_ci} 90c5e268c6Sopenharmony_ci 91c5e268c6Sopenharmony_ciint UpdateCameraMetadataItemByIndex(common_metadata_header_t *dst, uint32_t index, const void *data, uint32_t dataCount, 92c5e268c6Sopenharmony_ci camera_metadata_item_t *updatedItem) 93c5e268c6Sopenharmony_ci{ 94c5e268c6Sopenharmony_ci return CameraMetadata::UpdateCameraMetadataItemByIndex(dst, index, data, dataCount, updatedItem); 95c5e268c6Sopenharmony_ci} 96c5e268c6Sopenharmony_ci 97c5e268c6Sopenharmony_ciint UpdateCameraMetadataItem(common_metadata_header_t *dst, uint32_t item, const void *data, 98c5e268c6Sopenharmony_ci uint32_t dataCount, camera_metadata_item_t *updatedItem) 99c5e268c6Sopenharmony_ci{ 100c5e268c6Sopenharmony_ci return CameraMetadata::UpdateCameraMetadataItem(dst, item, data, dataCount, updatedItem); 101c5e268c6Sopenharmony_ci} 102c5e268c6Sopenharmony_ci 103c5e268c6Sopenharmony_ciint DeleteCameraMetadataItemByIndex(common_metadata_header_t *dst, uint32_t index) 104c5e268c6Sopenharmony_ci{ 105c5e268c6Sopenharmony_ci return CameraMetadata::DeleteCameraMetadataItemByIndex(dst, index); 106c5e268c6Sopenharmony_ci} 107c5e268c6Sopenharmony_ci 108c5e268c6Sopenharmony_ciint DeleteCameraMetadataItem(common_metadata_header_t *dst, uint32_t item) 109c5e268c6Sopenharmony_ci{ 110c5e268c6Sopenharmony_ci return CameraMetadata::DeleteCameraMetadataItem(dst, item); 111c5e268c6Sopenharmony_ci} 112c5e268c6Sopenharmony_ci 113c5e268c6Sopenharmony_civoid FreeCameraMetadataBuffer(common_metadata_header_t *dst) 114c5e268c6Sopenharmony_ci{ 115c5e268c6Sopenharmony_ci CameraMetadata::FreeCameraMetadataBuffer(dst); 116c5e268c6Sopenharmony_ci} 117c5e268c6Sopenharmony_ci 118c5e268c6Sopenharmony_ciuint32_t GetCameraMetadataItemCount(const common_metadata_header_t *metadataHeader) 119c5e268c6Sopenharmony_ci{ 120c5e268c6Sopenharmony_ci return CameraMetadata::GetCameraMetadataItemCount(metadataHeader); 121c5e268c6Sopenharmony_ci} 122c5e268c6Sopenharmony_ci 123c5e268c6Sopenharmony_ciuint32_t GetCameraMetadataItemCapacity(const common_metadata_header_t *metadataHeader) 124c5e268c6Sopenharmony_ci{ 125c5e268c6Sopenharmony_ci return CameraMetadata::GetCameraMetadataItemCapacity(metadataHeader); 126c5e268c6Sopenharmony_ci} 127c5e268c6Sopenharmony_ci 128c5e268c6Sopenharmony_ciuint32_t GetCameraMetadataDataSize(const common_metadata_header_t *metadataHeader) 129c5e268c6Sopenharmony_ci{ 130c5e268c6Sopenharmony_ci return CameraMetadata::GetCameraMetadataDataSize(metadataHeader); 131c5e268c6Sopenharmony_ci} 132c5e268c6Sopenharmony_ci 133c5e268c6Sopenharmony_ciint32_t CopyCameraMetadataItems(common_metadata_header_t *newMetadata, const common_metadata_header_t *oldMetadata) 134c5e268c6Sopenharmony_ci{ 135c5e268c6Sopenharmony_ci return CameraMetadata::CopyCameraMetadataItems(newMetadata, oldMetadata); 136c5e268c6Sopenharmony_ci} 137c5e268c6Sopenharmony_ci 138c5e268c6Sopenharmony_cistd::string MetadataItemDump(const common_metadata_header_t *metadataHeader, uint32_t item) 139c5e268c6Sopenharmony_ci{ 140c5e268c6Sopenharmony_ci return CameraMetadata::MetadataItemDump(metadataHeader, item); 141c5e268c6Sopenharmony_ci} 142c5e268c6Sopenharmony_ci 143c5e268c6Sopenharmony_cistd::string FormatCameraMetadataToString(const common_metadata_header_t *metadataHeader) 144c5e268c6Sopenharmony_ci{ 145c5e268c6Sopenharmony_ci return CameraMetadata::FormatCameraMetadataToString(metadataHeader); 146c5e268c6Sopenharmony_ci} 147c5e268c6Sopenharmony_ci 148c5e268c6Sopenharmony_ciint32_t GetAllVendorTags(std::vector<vendorTag_t>& tagVec) 149c5e268c6Sopenharmony_ci{ 150c5e268c6Sopenharmony_ci return CameraMetadata::GetAllVendorTags(tagVec); 151c5e268c6Sopenharmony_ci} 152c5e268c6Sopenharmony_ci} // Camera 153