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