1 /* 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_PARTIAL_METADATA_INTERFACE_H_ 18 #define V4L2_CAMERA_HAL_METADATA_PARTIAL_METADATA_INTERFACE_H_ 19 20 #include <array> 21 #include <vector> 22 23 #include <camera/CameraMetadata.h> 24 25 #include "../common.h" 26 #include "array_vector.h" 27 28 namespace v4l2_camera_hal { 29 30 // A subset of metadata. 31 class PartialMetadataInterface { 32 public: 33 virtual ~PartialMetadataInterface(){}; 34 35 // The metadata tags this partial metadata is responsible for. 36 // See system/media/camera/docs/docs.html for descriptions of each tag. 37 virtual std::vector<int32_t> StaticTags() const = 0; 38 virtual std::vector<int32_t> ControlTags() const = 0; 39 virtual std::vector<int32_t> DynamicTags() const = 0; 40 41 // Add all the static properties this partial metadata 42 // is responsible for to |metadata|. 43 virtual int PopulateStaticFields(android::CameraMetadata* metadata) const = 0; 44 // Add all the dynamic states this partial metadata 45 // is responsible for to |metadata|. 46 virtual int PopulateDynamicFields( 47 android::CameraMetadata* metadata) const = 0; 48 // Add default request values for a given template type for all the controls 49 // this partial metadata owns. 50 virtual int PopulateTemplateRequest( 51 int template_type, android::CameraMetadata* metadata) const = 0; 52 // Check if the requested control values from |metadata| (for controls 53 // this partial metadata owns) are supported. Empty/null values for owned 54 // control tags indicate no change, and are thus inherently supported. 55 // If |metadata| is empty all controls are implicitly supported. 56 virtual bool SupportsRequestValues( 57 const android::CameraMetadata& metadata) const = 0; 58 // Set all the controls this partial metadata 59 // is responsible for from |metadata|. Empty/null values for owned control 60 // tags indicate no change. If |metadata| is empty no controls should 61 // be changed. 62 virtual int SetRequestValues(const android::CameraMetadata& metadata) = 0; 63 }; 64 65 } // namespace v4l2_camera_hal 66 67 #endif // V4L2_CAMERA_HAL_METADATA_PARTIAL_METADATA_INTERFACE_H_ 68