• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
2 *
3 * Redistribution and use in source and binary forms, with or without
4 * modification, are permitted provided that the following conditions are
5 * met:
6 *     * Redistributions of source code must retain the above copyright
7 *       notice, this list of conditions and the following disclaimer.
8 *     * Redistributions in binary form must reproduce the above
9 *       copyright notice, this list of conditions and the following
10 *       disclaimer in the documentation and/or other materials provided
11 *       with the distribution.
12 *     * Neither the name of The Linux Foundation nor the names of its
13 *       contributors may be used to endorse or promote products derived
14 *       from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 */
29 
30 #ifndef __QCAMERA3VENDORTAGS_H__
31 #define __QCAMERA3VENDORTAGS_H__
32 
33 // Camera dependencies
34 #include "camera_metadata.h"
35 
36 namespace qcamera {
37 
38 enum qcamera3_ext_section {
39     QCAMERA3_PRIVATEDATA = VENDOR_SECTION,
40     QCAMERA3_CDS,
41     QCAMERA3_OPAQUE_RAW,
42     QCAMERA3_CROP,
43     QCAMERA3_TUNING_META_DATA,
44     QCAMERA3_TEMPORAL_DENOISE,
45     QCAMERA3_AV_TIMER,
46     QCAMERA3_SENSOR_META_DATA,
47     NEXUS_EXPERIMENTAL_2016,
48     QCAMERA3_DUALCAM_LINK_META_DATA,
49     QCAMERA3_DUALCAM_CALIB_META_DATA,
50     QCAMERA3_SECTIONS_END
51 };
52 
53 enum qcamera3_ext_section_ranges {
54     QCAMERA3_PRIVATEDATA_START = QCAMERA3_PRIVATEDATA << 16,
55     QCAMERA3_CDS_START = QCAMERA3_CDS << 16,
56     QCAMERA3_OPAQUE_RAW_START = QCAMERA3_OPAQUE_RAW << 16,
57     QCAMERA3_CROP_START = QCAMERA3_CROP << 16,
58     QCAMERA3_TUNING_META_DATA_START = QCAMERA3_TUNING_META_DATA << 16,
59     QCAMERA3_TEMPORAL_DENOISE_START = QCAMERA3_TEMPORAL_DENOISE << 16,
60     QCAMERA3_AV_TIMER_START = QCAMERA3_AV_TIMER << 16,
61     QCAMERA3_SENSOR_META_DATA_START = QCAMERA3_SENSOR_META_DATA << 16,
62     NEXUS_EXPERIMENTAL_2016_START = NEXUS_EXPERIMENTAL_2016 << 16,
63     QCAMERA3_DUALCAM_LINK_META_DATA_START = QCAMERA3_DUALCAM_LINK_META_DATA << 16,
64     QCAMERA3_DUALCAM_CALIB_META_DATA_START = QCAMERA3_DUALCAM_CALIB_META_DATA << 16
65 };
66 
67 enum qcamera3_ext_tags {
68     QCAMERA3_PRIVATEDATA_REPROCESS = QCAMERA3_PRIVATEDATA_START,
69     QCAMERA3_PRIVATEDATA_END,
70     QCAMERA3_CDS_MODE = QCAMERA3_CDS_START,
71     QCAMERA3_CDS_INFO,
72     QCAMERA3_CDS_END,
73 
74     //Property Name:  org.codeaurora.qcamera3.opaque_raw.opaque_raw_strides
75     //
76     //Type: int32 * n * 3 [public]
77     //
78     //Description: Distance in bytes from the beginning of one row of opaque
79     //raw image data to the beginning of next row.
80     //
81     //Details: The strides are listed as (raw_width, raw_height, stride)
82     //triplets. For each supported raw size, there will be a stride associated
83     //with it.
84     QCAMERA3_OPAQUE_RAW_STRIDES = QCAMERA3_OPAQUE_RAW_START,
85 
86     //Property Name: org.codeaurora.qcamera3.opaque_raw.opaque_raw_format
87     //
88     //Type: byte(enum) [public]
89     //  * LEGACY - The legacy raw format where 8, 10, or 12-bit
90     //    raw data is packed into a 64-bit word.
91     //  * MIPI - raw format matching the data packing described
92     //    in MIPI CSI-2 specification. In memory, the data
93     //    is constructed by packing sequentially received pixels
94     //    into least significant parts of the words first.
95     //    Within each pixel, the least significant bits are also
96     //    placed towards the least significant part of the word.
97     //
98     //Details: Lay out of opaque raw data in memory is decided by two factors:
99     //         opaque_raw_format and bit depth (implied by whiteLevel). Below
100     //         list illustrates their relationship:
101     //  LEGACY8:  P7(7:0) P6(7:0) P5(7:0) P4(7:0) P3(7:0) P2(7:0) P1(7:0) P0(7:0)
102     //            8 pixels occupy 8 bytes, no padding needed
103     //            min_stride = CEILING8(raw_width)
104     // LEGACY10:  0000 P5(9:0) P4(9:0) P3(9:0) P2(9:0) P1(9:0) P0(9:0)
105     //            6 pixels occupy 8 bytes, 4 bits padding at MSB
106     //            min_stride = (raw_width+5)/6 * 8
107     // LEGACY12:  0000 P4(11:0) P3(11:0) P2(11:0) P1(11:0) P0(11:0)
108     //            5 pixels occupy 8 bytes, 4 bits padding at MSB
109     //            min_stride = (raw_width+4)/5 * 8
110     //    MIPI8:  P0(7:0)
111     //            1 pixel occupy 1 byte
112     //            min_stride = raw_width
113     //   MIPI10:  P3(1:0) P2(1:0) P1(1:0) P0(1:0) P3(9:2) P2(9:2) P1(9:2) P0(9:2)
114     //            4 pixels occupy 5 bytes
115     //            min_stride = (raw_width+3)/4 * 5
116     //   MIPI12:  P1(3:0) P0(3:0) P1(11:4) P0(11:4)
117     //            2 pixels occupy 3 bytes
118     //            min_stride = (raw_width+1)/2 * 3
119     //Note that opaque_raw_stride needs to be at least the required minimum
120     //stride from the table above. ISP hardware may need more generous stride
121     //setting. For example, for LEGACY8, the actual stride may be
122     //CEILING16(raw_width) due to bus burst length requirement.
123     QCAMERA3_OPAQUE_RAW_FORMAT,
124     QCAMERA3_OPAQUE_RAW_END,
125 
126     QCAMERA3_CROP_COUNT_REPROCESS = QCAMERA3_CROP_START,
127     QCAMERA3_CROP_REPROCESS,
128     QCAMERA3_CROP_ROI_MAP_REPROCESS,
129     QCAMERA3_CROP_END,
130 
131     QCAMERA3_TUNING_META_DATA_BLOB = QCAMERA3_TUNING_META_DATA_START,
132     QCAMERA3_TUNING_META_DATA_END,
133 
134     QCAMERA3_TEMPORAL_DENOISE_ENABLE = QCAMERA3_TEMPORAL_DENOISE_START,
135     QCAMERA3_TEMPORAL_DENOISE_PROCESS_TYPE,
136     QCAMERA3_TEMPORAL_DENOISE_END,
137 
138     QCAMERA3_USE_AV_TIMER = QCAMERA3_AV_TIMER_START,
139     QCAMERA3_AV_TIMER_END,
140 
141     QCAMERA3_SENSOR_DYNAMIC_BLACK_LEVEL_PATTERN = QCAMERA3_SENSOR_META_DATA_START,
142     QCAMERA3_SENSOR_IS_MONO_ONLY,
143     QCAMERA3_SENSOR_META_DATA_END,
144 
145     NEXUS_EXPERIMENTAL_2016_HYBRID_AE_ENABLE = NEXUS_EXPERIMENTAL_2016_START,
146     NEXUS_EXPERIMENTAL_2016_AF_SCENE_CHANGE,
147     // DEVCAMDEBUG
148     DEVCAMDEBUG_META_ENABLE,
149     // DEVCAMDEBUG AF
150     DEVCAMDEBUG_AF_LENS_POSITION,
151     DEVCAMDEBUG_AF_TOF_CONFIDENCE,
152     DEVCAMDEBUG_AF_TOF_DISTANCE,
153     DEVCAMDEBUG_AF_LUMA,
154     DEVCAMDEBUG_AF_HAF_STATE,
155     DEVCAMDEBUG_AF_MONITOR_PDAF_TARGET_POS,
156     DEVCAMDEBUG_AF_MONITOR_PDAF_CONFIDENCE,
157     DEVCAMDEBUG_AF_MONITOR_PDAF_REFOCUS,
158     DEVCAMDEBUG_AF_MONITOR_TOF_TARGET_POS,
159     DEVCAMDEBUG_AF_MONITOR_TOF_CONFIDENCE,
160     DEVCAMDEBUG_AF_MONITOR_TOF_REFOCUS,
161     DEVCAMDEBUG_AF_MONITOR_TYPE_SELECT,
162     DEVCAMDEBUG_AF_MONITOR_REFOCUS,
163     DEVCAMDEBUG_AF_MONITOR_TARGET_POS,
164     DEVCAMDEBUG_AF_SEARCH_PDAF_TARGET_POS,
165     DEVCAMDEBUG_AF_SEARCH_PDAF_NEXT_POS,
166     DEVCAMDEBUG_AF_SEARCH_PDAF_NEAR_POS,
167     DEVCAMDEBUG_AF_SEARCH_PDAF_FAR_POS,
168     DEVCAMDEBUG_AF_SEARCH_PDAF_CONFIDENCE,
169     DEVCAMDEBUG_AF_SEARCH_TOF_TARGET_POS,
170     DEVCAMDEBUG_AF_SEARCH_TOF_NEXT_POS,
171     DEVCAMDEBUG_AF_SEARCH_TOF_NEAR_POS,
172     DEVCAMDEBUG_AF_SEARCH_TOF_FAR_POS,
173     DEVCAMDEBUG_AF_SEARCH_TOF_CONFIDENCE,
174     DEVCAMDEBUG_AF_SEARCH_TYPE_SELECT,
175     DEVCAMDEBUG_AF_SEARCH_NEXT_POS,
176     DEVCAMDEBUG_AF_SEARCH_TARGET_POS,
177     // DEVCAMDEBUG AEC
178     DEVCAMDEBUG_AEC_TARGET_LUMA,
179     DEVCAMDEBUG_AEC_COMP_LUMA,
180     DEVCAMDEBUG_AEC_AVG_LUMA,
181     DEVCAMDEBUG_AEC_CUR_LUMA,
182     DEVCAMDEBUG_AEC_LINECOUNT,
183     DEVCAMDEBUG_AEC_REAL_GAIN,
184     DEVCAMDEBUG_AEC_EXP_INDEX,
185     DEVCAMDEBUG_AEC_LUX_IDX,
186     // DEVCAMDEBUG AWB
187     DEVCAMDEBUG_AWB_R_GAIN,
188     DEVCAMDEBUG_AWB_G_GAIN,
189     DEVCAMDEBUG_AWB_B_GAIN,
190     DEVCAMDEBUG_AWB_CCT,
191     DEVCAMDEBUG_AWB_DECISION,
192     // DEVCAMDEBUG END
193     NEXUS_EXPERIMENTAL_2016_END,
194 
195     QCAMERA3_DUALCAM_LINK_ENABLE = QCAMERA3_DUALCAM_LINK_META_DATA_START,
196     QCAMERA3_DUALCAM_LINK_IS_MAIN,
197     QCAMERA3_DUALCAM_LINK_RELATED_CAMERA_ID,
198     QCAMERA3_DUALCAM_LINK_META_DATA_END,
199 
200     QCAMERA3_DUALCAM_CALIB_META_DATA_BLOB = QCAMERA3_DUALCAM_CALIB_META_DATA_START,
201     QCAMERA3_DUALCAM_CALIB_META_DATA_END
202 };
203 
204 // QCAMERA3_OPAQUE_RAW_FORMAT
205 typedef enum qcamera3_ext_opaque_raw_format {
206     QCAMERA3_OPAQUE_RAW_FORMAT_LEGACY,
207     QCAMERA3_OPAQUE_RAW_FORMAT_MIPI
208 } qcamera3_ext_opaque_raw_format_t;
209 
210 typedef enum com_google_nexus_experimental_2016_control_ae_mode {
211     NEXUS_EXPERIMENTAL_2016_CONTROL_AE_MODE_EXTERNAL_FLASH = 5
212 } com_google_nexus_experimental_2016_control_ae_mode_t;
213 
214 class QCamera3VendorTags {
215 
216 public:
217     static void get_vendor_tag_ops(vendor_tag_ops_t* ops);
218     static int get_tag_count(
219             const vendor_tag_ops_t *ops);
220     static void get_all_tags(
221             const vendor_tag_ops_t *ops,
222             uint32_t *tag_array);
223     static const char* get_section_name(
224             const vendor_tag_ops_t *ops,
225             uint32_t tag);
226     static const char* get_tag_name(
227             const vendor_tag_ops_t *ops,
228             uint32_t tag);
229     static int get_tag_type(
230             const vendor_tag_ops_t *ops,
231             uint32_t tag);
232 
233     static const vendor_tag_ops_t *Ops;
234 };
235 
236 }; // namespace qcamera
237 
238 #endif /* __QCAMERA3VENDORTAGS_H__ */
239