• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef CAMERA_METADATA_INFO_H
17 #define CAMERA_METADATA_INFO_H
18 
19 #include <cstdio>
20 #include <cstdint>
21 #include "camera_metadata_operator.h"
22 
23 namespace OHOS::Camera {
24 class CameraMetadata {
25 public:
26     CameraMetadata(size_t itemCapacity, size_t dataCapacity);
27     ~CameraMetadata();
28 
29     bool addEntry(uint32_t item, const void *data, size_t data_count);
30     bool updateEntry(uint32_t tag, const void *data, size_t data_count);
31     common_metadata_header_t *get();
32     const common_metadata_header_t *get() const;
33     bool isValid() const;
34 
35 private:
36     common_metadata_header_t *metadata_;
37 
38     bool resize_add_metadata(uint32_t item, const void *data, size_t data_count);
39     void replace_metadata(common_metadata_header_t *newMetadata);
40 };
41 } // namespace Camera
42 #endif /* CAMERA_METADATA_INFO_H */
43