1 /*
2 * Copyright (c) 2021-2023 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 #include "camera_metadata_info.h"
17
18 namespace OHOS::Camera {
GetMetadataData(const common_metadata_header_t * metadataHeader)19 uint8_t *GetMetadataData(const common_metadata_header_t *metadataHeader)
20 {
21 return CameraMetadata::GetMetadataData(metadataHeader);
22 }
23
GetMetadataItems(const common_metadata_header_t * metadataHeader)24 camera_metadata_item_entry_t *GetMetadataItems(const common_metadata_header_t *metadataHeader)
25 {
26 return CameraMetadata::GetMetadataItems(metadataHeader);
27 }
28
FillCameraMetadata(common_metadata_header_t * buffer,size_t memoryRequired,uint32_t itemCapacity,uint32_t dataCapacity)29 common_metadata_header_t *FillCameraMetadata(common_metadata_header_t *buffer, size_t memoryRequired,
30 uint32_t itemCapacity, uint32_t dataCapacity)
31 {
32 return CameraMetadata::FillCameraMetadata(buffer, memoryRequired, itemCapacity, dataCapacity);
33 }
34
AllocateCameraMetadataBuffer(uint32_t item_capacity,uint32_t data_capacity)35 common_metadata_header_t *AllocateCameraMetadataBuffer(uint32_t item_capacity, uint32_t data_capacity)
36 {
37 return CameraMetadata::AllocateCameraMetadataBuffer(item_capacity, data_capacity);
38 }
39
GetMetadataSection(uint32_t itemSection,uint32_t * section)40 int32_t GetMetadataSection(uint32_t itemSection, uint32_t *section)
41 {
42 return CameraMetadata::GetMetadataSection(itemSection, section);
43 }
44
GetCameraMetadataItemType(uint32_t item,uint32_t * dataType)45 int32_t GetCameraMetadataItemType(uint32_t item, uint32_t *dataType)
46 {
47 return CameraMetadata::GetCameraMetadataItemType(item, dataType);
48 }
49
GetCameraMetadataItemName(uint32_t item)50 const char *GetCameraMetadataItemName(uint32_t item)
51 {
52 return CameraMetadata::GetCameraMetadataItemName(item);
53 }
54
CalculateCameraMetadataItemDataSize(uint32_t type,size_t dataCount)55 size_t CalculateCameraMetadataItemDataSize(uint32_t type, size_t dataCount)
56 {
57 return CameraMetadata::CalculateCameraMetadataItemDataSize(type, dataCount);
58 }
59
AddCameraMetadataItem(common_metadata_header_t * dst,uint32_t item,const void * data,size_t dataCount)60 int AddCameraMetadataItem(common_metadata_header_t *dst, uint32_t item, const void *data, size_t dataCount)
61 {
62 return CameraMetadata::AddCameraMetadataItem(dst, item, data, dataCount);
63 }
64
GetCameraMetadataItem(const common_metadata_header_t * src,uint32_t index,camera_metadata_item_t * item)65 int GetCameraMetadataItem(const common_metadata_header_t *src, uint32_t index, camera_metadata_item_t *item)
66 {
67 return CameraMetadata::GetCameraMetadataItem(src, index, item);
68 }
69
FindCameraMetadataItemIndex(const common_metadata_header_t * src,uint32_t item,uint32_t * idx)70 int FindCameraMetadataItemIndex(const common_metadata_header_t *src, uint32_t item, uint32_t *idx)
71 {
72 return CameraMetadata::FindCameraMetadataItemIndex(src, item, idx);
73 }
74
FindCameraMetadataItem(const common_metadata_header_t * src,uint32_t item,camera_metadata_item_t * metadataItem)75 int FindCameraMetadataItem(const common_metadata_header_t *src, uint32_t item, camera_metadata_item_t *metadataItem)
76 {
77 return CameraMetadata::FindCameraMetadataItem(src, item, metadataItem);
78 }
79
IsCameraMetadataItemExist(const common_metadata_header_t * src,uint32_t item)80 bool IsCameraMetadataItemExist(const common_metadata_header_t *src, uint32_t item)
81 {
82 return CameraMetadata::IsCameraMetadataItemExist(src, item);
83 }
84
MetadataExpandItemMem(common_metadata_header_t * dst,camera_metadata_item_entry_t * item,size_t oldItemSize)85 int MetadataExpandItemMem(common_metadata_header_t *dst, camera_metadata_item_entry_t *item,
86 size_t oldItemSize)
87 {
88 return CameraMetadata::MetadataExpandItemMem(dst, item, oldItemSize);
89 }
90
UpdateCameraMetadataItemByIndex(common_metadata_header_t * dst,uint32_t index,const void * data,uint32_t dataCount,camera_metadata_item_t * updatedItem)91 int UpdateCameraMetadataItemByIndex(common_metadata_header_t *dst, uint32_t index, const void *data, uint32_t dataCount,
92 camera_metadata_item_t *updatedItem)
93 {
94 return CameraMetadata::UpdateCameraMetadataItemByIndex(dst, index, data, dataCount, updatedItem);
95 }
96
UpdateCameraMetadataItem(common_metadata_header_t * dst,uint32_t item,const void * data,uint32_t dataCount,camera_metadata_item_t * updatedItem)97 int UpdateCameraMetadataItem(common_metadata_header_t *dst, uint32_t item, const void *data,
98 uint32_t dataCount, camera_metadata_item_t *updatedItem)
99 {
100 return CameraMetadata::UpdateCameraMetadataItem(dst, item, data, dataCount, updatedItem);
101 }
102
DeleteCameraMetadataItemByIndex(common_metadata_header_t * dst,uint32_t index)103 int DeleteCameraMetadataItemByIndex(common_metadata_header_t *dst, uint32_t index)
104 {
105 return CameraMetadata::DeleteCameraMetadataItemByIndex(dst, index);
106 }
107
DeleteCameraMetadataItem(common_metadata_header_t * dst,uint32_t item)108 int DeleteCameraMetadataItem(common_metadata_header_t *dst, uint32_t item)
109 {
110 return CameraMetadata::DeleteCameraMetadataItem(dst, item);
111 }
112
FreeCameraMetadataBuffer(common_metadata_header_t * dst)113 void FreeCameraMetadataBuffer(common_metadata_header_t *dst)
114 {
115 CameraMetadata::FreeCameraMetadataBuffer(dst);
116 }
117
GetCameraMetadataItemCount(const common_metadata_header_t * metadataHeader)118 uint32_t GetCameraMetadataItemCount(const common_metadata_header_t *metadataHeader)
119 {
120 return CameraMetadata::GetCameraMetadataItemCount(metadataHeader);
121 }
122
GetCameraMetadataItemCapacity(const common_metadata_header_t * metadataHeader)123 uint32_t GetCameraMetadataItemCapacity(const common_metadata_header_t *metadataHeader)
124 {
125 return CameraMetadata::GetCameraMetadataItemCapacity(metadataHeader);
126 }
127
GetCameraMetadataDataSize(const common_metadata_header_t * metadataHeader)128 uint32_t GetCameraMetadataDataSize(const common_metadata_header_t *metadataHeader)
129 {
130 return CameraMetadata::GetCameraMetadataDataSize(metadataHeader);
131 }
132
CopyCameraMetadataItems(common_metadata_header_t * newMetadata,const common_metadata_header_t * oldMetadata)133 int32_t CopyCameraMetadataItems(common_metadata_header_t *newMetadata, const common_metadata_header_t *oldMetadata)
134 {
135 return CameraMetadata::CopyCameraMetadataItems(newMetadata, oldMetadata);
136 }
137
MetadataItemDump(const common_metadata_header_t * metadataHeader,uint32_t item)138 std::string MetadataItemDump(const common_metadata_header_t *metadataHeader, uint32_t item)
139 {
140 return CameraMetadata::MetadataItemDump(metadataHeader, item);
141 }
142
FormatCameraMetadataToString(const common_metadata_header_t * metadataHeader)143 std::string FormatCameraMetadataToString(const common_metadata_header_t *metadataHeader)
144 {
145 return CameraMetadata::FormatCameraMetadataToString(metadataHeader);
146 }
147
GetAllVendorTags(std::vector<vendorTag_t> & tagVec)148 int32_t GetAllVendorTags(std::vector<vendorTag_t>& tagVec)
149 {
150 return CameraMetadata::GetAllVendorTags(tagVec);
151 }
152 } // Camera
153