blob: eb3e035a2a5e8b6129a4f0c69d060ca7d1b64b62 [file] [log] [blame]
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef V4L2_CAMERA_HAL_METADATA_H_
18#define V4L2_CAMERA_HAL_METADATA_H_
19
Sergii Piatakov2ad591f2018-08-03 11:41:06 +030020#include <android-base/macros.h>
Ari Hausman-Cohenb1af4ff2016-08-04 13:01:05 -070021#include <camera/CameraMetadata.h>
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070022
Ari Hausman-Cohenffdc6282016-08-19 12:54:22 -070023#include "metadata_common.h"
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070024
25namespace v4l2_camera_hal {
26class Metadata {
27 public:
Ari Hausman-Cohenffdc6282016-08-19 12:54:22 -070028 Metadata(PartialMetadataSet components);
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070029 virtual ~Metadata();
30
Ari Hausman-Cohenb1af4ff2016-08-04 13:01:05 -070031 int FillStaticMetadata(android::CameraMetadata* metadata);
32 bool IsValidRequest(const android::CameraMetadata& metadata);
Ari Hausman-Cohen10264772016-08-22 13:49:43 -070033 int GetRequestTemplate(int template_type,
34 android::CameraMetadata* template_metadata);
Ari Hausman-Cohenb1af4ff2016-08-04 13:01:05 -070035 int SetRequestSettings(const android::CameraMetadata& metadata);
36 int FillResultMetadata(android::CameraMetadata* metadata);
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070037
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070038 private:
39 // The overall metadata is broken down into several distinct pieces.
40 // Note: it is undefined behavior if multiple components share tags.
Ari Hausman-Cohenffdc6282016-08-19 12:54:22 -070041 PartialMetadataSet components_;
Ari Hausman-Cohen10481a32016-08-02 10:41:27 -070042
43 DISALLOW_COPY_AND_ASSIGN(Metadata);
44};
45
46} // namespace v4l2_camera_hal
47
48#endif // V4L2_CAMERA_HAL_V4L2_METADATA_H_