1 ## -*- coding: utf-8 -*- 2 /* 3 * Copyright (C) 2012 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 /** 19 * !! Do not include this file directly !! 20 * 21 * Include camera_metadata.h instead. 22 */ 23 24 /** 25 * ! Do not edit this file directly ! 26 * 27 * Generated automatically from camera_metadata_tags.mako 28 */ 29 30 /** TODO: Nearly every enum in this file needs a description */ 31 32 /** 33 * Top level hierarchy definitions for camera metadata. *_INFO sections are for 34 * the static metadata that can be retrived without opening the camera device. 35 * New sections must be added right before ANDROID_SECTION_COUNT to maintain 36 * existing enumerations. 37 */ 38 typedef enum camera_metadata_section { 39 % for i in find_all_sections(metadata): 40 ${path_name(i) | csym}, 41 % endfor 42 ANDROID_SECTION_COUNT, 43 44 VENDOR_SECTION = 0x8000 45 } camera_metadata_section_t; 46 47 /** 48 * Hierarchy positions in enum space. All vendor extension tags must be 49 * defined with tag >= VENDOR_SECTION_START 50 */ 51 typedef enum camera_metadata_section_start { 52 % for i in find_all_sections(metadata): 53 ${path_name(i) + '.start' | csym,ljust(30)} = ${path_name(i) | csym,pad(64)} << 16, 54 % endfor 55 VENDOR_SECTION_START = VENDOR_SECTION << 16 56 } camera_metadata_section_start_t; 57 58 /** 59 * Main enum for defining camera metadata tags. New entries must always go 60 * before the section _END tag to preserve existing enumeration values. In 61 * addition, the name and type of the tag needs to be added to 62 * system/media/camera/src/camera_metadata_tag_info.c 63 */ 64 typedef enum camera_metadata_tag { 65 % for sec in find_all_sections(metadata): 66 % for idx,entry in enumerate(find_unique_entries(sec)): 67 % if idx == 0: 68 ${entry.name | csym,ljust(30)} = ${path_name(find_parent_section(entry)) | csym}_START, 69 % else: 70 ${entry.name | csym}, 71 % endif 72 % endfor 73 ${path_name(sec) | csym}_END, 74 75 %endfor 76 } camera_metadata_tag_t; 77 78 /** 79 * Enumeration definitions for the various entries that need them 80 */ 81 82 % for sec in find_all_sections(metadata): 83 % for entry in find_unique_entries(sec): 84 % if entry.enum: 85 // ${entry.name | csym} 86 typedef enum camera_metadata_enum_${csym(entry.name).lower()} { 87 % for val in entry.enum.values: 88 % if val.id is None: 89 ${entry.name | csym}_${val.name}, 90 % else: 91 ${'%s_%s'%(csym(entry.name), val.name) | pad(65)} = ${val.id}, 92 % endif 93 % endfor 94 } camera_metadata_enum_${csym(entry.name).lower()}_t; 95 96 % endif 97 % endfor 98 99 %endfor 100