1 ## -*- coding: utf-8 -*-
3 * Copyright (C) 2012 The Android Open Source Project
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 * !! Do not include this file directly !!
21 * Include camera_metadata.h instead.
25 * ! Do not edit this file directly !
27 * Generated automatically from camera_metadata_tags.mako
31 def annotated_type(entry):
36 if entry.container == 'array':
42 /** TODO: Nearly every enum in this file needs a description */
45 * Top level hierarchy definitions for camera metadata. *_INFO sections are for
46 * the static metadata that can be retrived without opening the camera device.
47 * New sections must be added right before ANDROID_SECTION_COUNT to maintain
48 * existing enumerations.
50 typedef enum camera_metadata_section {
51 % for i in find_all_sections(metadata):
52 ${path_name(i) | csym},
54 ANDROID_SECTION_COUNT,
56 VENDOR_SECTION = 0x8000
57 } camera_metadata_section_t;
60 * Hierarchy positions in enum space. All vendor extension tags must be
61 * defined with tag >= VENDOR_SECTION_START
63 typedef enum camera_metadata_section_start {
64 % for i in find_all_sections(metadata):
65 ${path_name(i) + '.start' | csym,ljust(30)} = ${path_name(i) | csym,pad(64)} << 16,
67 VENDOR_SECTION_START = VENDOR_SECTION << 16
68 } camera_metadata_section_start_t;
71 * Main enum for defining camera metadata tags. New entries must always go
72 * before the section _END tag to preserve existing enumeration values. In
73 * addition, the name and type of the tag needs to be added to
74 * system/media/camera/src/camera_metadata_tag_info.c
76 typedef enum camera_metadata_tag {
77 % for sec in find_all_sections(metadata):
78 % for idx,entry in enumerate(find_unique_entries(sec)):
80 ${entry.name + " = " | csym,ljust(50)}// ${annotated_type(entry) | ljust(12)} | ${entry.applied_visibility}
81 ${path_name(find_parent_section(entry)) | csym}_START,
83 ${entry.name + "," | csym,ljust(50)}// ${annotated_type(entry) | ljust(12)} | ${entry.applied_visibility}
86 ${path_name(sec) | csym}_END,
89 } camera_metadata_tag_t;
92 * Enumeration definitions for the various entries that need them
95 % for sec in find_all_sections(metadata):
96 % for entry in find_unique_entries(sec):
98 // ${entry.name | csym}
99 typedef enum camera_metadata_enum_${csym(entry.name).lower()} {
100 % for val in entry.enum.values:
102 ${entry.name | csym}_${val.name},
104 ${'%s_%s'%(csym(entry.name), val.name) | pad(65)} = ${val.id},
107 } camera_metadata_enum_${csym(entry.name).lower()}_t;