1 /* 2 * Copyright 2014 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 SYSTEM_MEDIA_PRIVATE_INCLUDE_CAMERA_METADATA_HIDDEN_H 18 #define SYSTEM_MEDIA_PRIVATE_INCLUDE_CAMERA_METADATA_HIDDEN_H 19 20 #include <stdint.h> 21 #include <cutils/compiler.h> 22 #include <system/camera_metadata.h> 23 #include <system/camera_vendor_tags.h> 24 25 /** 26 * Error codes returned by vendor tags ops operations. These are intended 27 * to be used by all framework code that uses the return values from the 28 * vendor operations object. 29 */ 30 #define VENDOR_SECTION_NAME_ERR NULL 31 #define VENDOR_TAG_NAME_ERR NULL 32 #define VENDOR_TAG_COUNT_ERR (-1) 33 #define VENDOR_TAG_TYPE_ERR (-1) 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 /** **These are private functions for use only by the camera framework.** **/ 39 40 /** 41 * Set the global vendor tag operations object used to define vendor tag 42 * structure when parsing camera metadata with functions defined in 43 * system/media/camera/include/camera_metadata.h. 44 */ 45 ANDROID_API 46 int set_camera_metadata_vendor_ops(const vendor_tag_ops_t *query_ops); 47 48 /** 49 * Set the global vendor tag cache operations object used to define vendor tag 50 * structure when parsing camera metadata with functions defined in 51 * system/media/camera/include/camera_metadata.h. 52 */ 53 ANDROID_API 54 int set_camera_metadata_vendor_cache_ops( 55 const struct vendor_tag_cache_ops *query_cache_ops); 56 57 /** 58 * Set the vendor id for a particular metadata buffer. 59 */ 60 ANDROID_API 61 void set_camera_metadata_vendor_id(camera_metadata_t *meta, 62 metadata_vendor_id_t id); 63 64 /** 65 * Retrieve the vendor id for a particular metadata buffer. 66 */ 67 ANDROID_API 68 metadata_vendor_id_t get_camera_metadata_vendor_id( 69 const camera_metadata_t *meta); 70 71 /** 72 * Retrieve the type of a tag. Returns -1 if no such tag is defined. 73 */ 74 ANDROID_API 75 int get_local_camera_metadata_tag_type_vendor_id(uint32_t tag, 76 metadata_vendor_id_t id); 77 78 /** 79 * Retrieve the name of a tag. Returns NULL if no such tag is defined. 80 */ 81 ANDROID_API 82 const char *get_local_camera_metadata_tag_name_vendor_id(uint32_t tag, 83 metadata_vendor_id_t id); 84 85 /** 86 * Retrieve the name of a tag section. Returns NULL if no such tag is defined. 87 */ 88 ANDROID_API 89 const char *get_local_camera_metadata_section_name_vendor_id(uint32_t tag, 90 metadata_vendor_id_t id); 91 92 /** 93 * Retrieve the type of a tag. Returns -1 if no such tag is defined. 94 */ 95 ANDROID_API 96 int get_local_camera_metadata_tag_type_vendor_id(uint32_t tag, 97 metadata_vendor_id_t id); 98 99 #ifdef __cplusplus 100 } /* extern "C" */ 101 #endif 102 103 #endif /* SYSTEM_MEDIA_PRIVATE_INCLUDE_CAMERA_METADATA_HIDDEN_H */ 104