OSDN Git Service

Merge "Camera: Add PASSIVE_UNFOCUSED AF state" into klp-dev
[android-x86/system-media.git] / camera / docs / camera_metadata_tags.mako
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 <%!
31   def annotated_type(entry):
32     if entry.enum:
33        type = 'enum'
34     else:
35        type = entry.type
36     if entry.container == 'array':
37        type += '[]'
38
39     return type
40 %>\
41 \
42 /** TODO: Nearly every enum in this file needs a description */
43
44 /**
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.
49  */
50 typedef enum camera_metadata_section {
51   % for i in find_all_sections(metadata):
52     ${path_name(i) | csym},
53   % endfor
54     ANDROID_SECTION_COUNT,
55
56     VENDOR_SECTION = 0x8000
57 } camera_metadata_section_t;
58
59 /**
60  * Hierarchy positions in enum space. All vendor extension tags must be
61  * defined with tag >= VENDOR_SECTION_START
62  */
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,
66   % endfor
67     VENDOR_SECTION_START           = VENDOR_SECTION            << 16
68 } camera_metadata_section_start_t;
69
70 /**
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
75  */
76 typedef enum camera_metadata_tag {
77     % for sec in find_all_sections(metadata):
78       % for idx,entry in enumerate(find_unique_entries(sec)):
79         % if idx == 0:
80     ${entry.name + " = " | csym,ljust(50)}// ${annotated_type(entry) | ljust(12)} | ${entry.applied_visibility}
81             ${path_name(find_parent_section(entry)) | csym}_START,
82         % else:
83     ${entry.name + "," | csym,ljust(50)}// ${annotated_type(entry) | ljust(12)} | ${entry.applied_visibility}
84         % endif
85       % endfor
86     ${path_name(sec) | csym}_END,
87
88     %endfor
89 } camera_metadata_tag_t;
90
91 /**
92  * Enumeration definitions for the various entries that need them
93  */
94
95 % for sec in find_all_sections(metadata):
96   % for entry in find_unique_entries(sec):
97     % if entry.enum:
98 // ${entry.name | csym}
99 typedef enum camera_metadata_enum_${csym(entry.name).lower()} {
100       % for val in entry.enum.values:
101         % if val.id is None:
102     ${entry.name | csym}_${val.name},
103         % else:
104     ${'%s_%s'%(csym(entry.name), val.name) | pad(65)} = ${val.id},
105         % endif
106       % endfor
107 } camera_metadata_enum_${csym(entry.name).lower()}_t;
108
109     % endif
110   % endfor
111
112 %endfor