1 /* Copyright (c) 2012-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 __QCAMERA_TYPES_H__
31 #define __QCAMERA_TYPES_H__
32 
33 // System dependencies
34 #include <stdint.h>
35 #include <media/msmb_camera.h>
36 
37 #define CAM_MAX_NUM_BUFS_PER_STREAM 64
38 #define MAX_METADATA_PRIVATE_PAYLOAD_SIZE_IN_BYTES 8096
39 #define AWB_DEBUG_DATA_SIZE               (45000)
40 #define AEC_DEBUG_DATA_SIZE               (5000)
41 #define AF_DEBUG_DATA_SIZE                (10000)
42 #define AF_STATS_DEBUG_DATA_SIZE          (40000)
43 #define ASD_DEBUG_DATA_SIZE               (100)
44 #define STATS_BUFFER_DEBUG_DATA_SIZE      (75000)
45 
46 #define CEILING64(X) (((X) + 0x0003F) & 0xFFFFFFC0)
47 #define CEILING32(X) (((X) + 0x0001F) & 0xFFFFFFE0)
48 #define CEILING16(X) (((X) + 0x000F) & 0xFFF0)
49 #define CEILING4(X)  (((X) + 0x0003) & 0xFFFC)
50 #define CEILING2(X)  (((X) + 0x0001) & 0xFFFE)
51 
52 #define MAX_ZOOMS_CNT 91
53 #define MAX_SIZES_CNT 40
54 #define MAX_EXP_BRACKETING_LENGTH 32
55 #define MAX_ROI 10
56 #define MAX_STREAM_NUM_IN_BUNDLE 8
57 #define MAX_NUM_STREAMS          8
58 #define CHROMATIX_SIZE 60000
59 #define COMMONCHROMATIX_SIZE 45000
60 #define CPPCHROMATIX_SIZE 36000
61 #define SWPOSTPROCCHROMATIX_SIZE 36000
62 #define AFTUNE_SIZE  32768
63 #define A3CHROMATIX_SIZE 30000
64 #define MAX_SCALE_SIZES_CNT 8
65 #define MAX_SAMP_DECISION_CNT     64
66 #define SENSOR_PHYSICAL_SIZE_CNT  2
67 #define EXPOSURE_TIME_RANGE_CNT   2
68 #define BLACK_LEVEL_PATTERN_CNT   4
69 #define FORWARD_MATRIX_COLS       3
70 #define FORWARD_MATRIX_ROWS       3
71 #define COLOR_TRANSFORM_COLS      3
72 #define COLOR_TRANSFORM_ROWS      3
73 #define CAL_TRANSFORM_COLS        3
74 #define CAL_TRANSFORM_ROWS        3
75 
76 #define MAX_ISP_DATA_SIZE (20*1024)
77 #define MAX_PP_DATA_SIZE  16384
78 #define MAX_AE_STATS_DATA_SIZE  1000
79 #define MAX_AWB_STATS_DATA_SIZE 1000
80 #define MAX_AF_STATS_DATA_SIZE  1000
81 #define MAX_ASD_STATS_DATA_SIZE 1000
82 
83 #define MAX_CAPTURE_BATCH_NUM 32
84 
85 #define TUNING_DATA_VERSION        6
86 #define TUNING_SENSOR_DATA_MAX     0x10000 /*(need value from sensor team)*/
87 #define TUNING_VFE_DATA_MAX        0x10000 /*(need value from vfe team)*/
88 #define TUNING_CPP_DATA_MAX        0x10000 /*(need value from pproc team)*/
89 #define TUNING_CAC_DATA_MAX        0x10000 /*(need value from imglib team)*/
90 #define TUNING_DATA_MAX            (TUNING_SENSOR_DATA_MAX + \
91                                    TUNING_VFE_DATA_MAX + TUNING_CPP_DATA_MAX + \
92                                    TUNING_CAC_DATA_MAX)
93 
94 #define TUNING_SENSOR_DATA_OFFSET  0
95 #define TUNING_VFE_DATA_OFFSET     TUNING_SENSOR_DATA_MAX
96 #define TUNING_CPP_DATA_OFFSET     (TUNING_SENSOR_DATA_MAX + TUNING_VFE_DATA_MAX)
97 #define TUNING_CAC_DATA_OFFSET     (TUNING_SENSOR_DATA_MAX + \
98                                    TUNING_VFE_DATA_MAX + TUNING_CPP_DATA_MAX)
99 #define MAX_STATS_DATA_SIZE 4000
100 
101 #define MAX_AF_BRACKETING_VALUES 5
102 #define MAX_TEST_PATTERN_CNT     8
103 
104 #define GPS_PROCESSING_METHOD_SIZE 33
105 #define EXIF_IMAGE_DESCRIPTION_SIZE 100
106 
107 #define MAX_INFLIGHT_REQUESTS  6
108 #define MAX_INFLIGHT_BLOB      3
109 #define MIN_INFLIGHT_REQUESTS  3
110 #define MAX_INFLIGHT_REPROCESS_REQUESTS 1
111 #define MAX_INFLIGHT_HFR_REQUESTS (48)
112 #define MIN_INFLIGHT_HFR_REQUESTS (40)
113 
114 #define QCAMERA_DUMP_FRM_LOCATION "/data/misc/camera/"
115 #define QCAMERA_MAX_FILEPATH_LENGTH 64
116 
117 #define LIKELY(x)       __builtin_expect((x), true)
118 #define UNLIKELY(x)     __builtin_expect((x), false)
119 
120 #define RELCAM_CALIB_ROT_MATRIX_MAX 9
121 #define RELCAM_CALIB_SURFACE_PARMS_MAX 32
122 #define RELCAM_CALIB_RESERVED_MAX 62
123 
124 #define MAX_NUM_CAMERA_PER_BUNDLE    2 /* Max number of cameras per bundle */
125 #define EXTRA_FRAME_SYNC_BUFFERS     4 /* Extra frame sync buffers in dc mode*/
126 #define MM_CAMERA_FRAME_SYNC_NODES   EXTRA_FRAME_SYNC_BUFFERS
127 
128 #define MAX_REPROCESS_STALL 2
129 
130 #define QCAMERA_MAX_FILEPATH_LENGTH 64
131 
132 #define MAX_EEPROM_VERSION_INFO_LEN 32
133 
134 #define MAX_OPTICAL_BLACK_REGIONS 5
135 
136 /*reprocess pipeline stages are pproc and jpeg */
137 #define MAX_REPROCESS_PIPELINE_STAGES 2
138 
139 /* Defines the number of rows in the color correction matrix (CCM) */
140 #define AWB_NUM_CCM_ROWS (3)
141 
142 /* Defines the number of columns in the color correction matrix (CCM) */
143 #define AWB_NUM_CCM_COLS (3)
144 
145 typedef enum {
146     CAM_HAL_V1 = 1,
147     CAM_HAL_V3 = 3
148 } cam_hal_version_t;
149 
150 typedef enum {
151     CAM_STATUS_SUCCESS,       /* Operation Succeded */
152     CAM_STATUS_FAILED,        /* Failure in doing operation */
153     CAM_STATUS_INVALID_PARM,  /* Inavlid parameter provided */
154     CAM_STATUS_NOT_SUPPORTED, /* Parameter/operation not supported */
155     CAM_STATUS_ACCEPTED,      /* Parameter accepted */
156     CAM_STATUS_MAX,
157 } cam_status_t;
158 
159 typedef enum {
160     /* back main camera */
161     CAM_POSITION_BACK,
162     /* front main camera */
163     CAM_POSITION_FRONT,
164     /* back aux camera */
165     CAM_POSITION_BACK_AUX,
166     /* front aux camera */
167     CAM_POSITION_FRONT_AUX
168 } cam_position_t;
169 
170 typedef enum {
171     CAM_FLICKER_NONE,
172     CAM_FLICKER_50_HZ,
173     CAM_FLICKER_60_HZ
174 } cam_flicker_t;
175 
176 typedef enum {
177     CAM_FORMAT_JPEG = 0,
178     CAM_FORMAT_YUV_420_NV12 = 1,
179     CAM_FORMAT_YUV_420_NV21,
180     CAM_FORMAT_YUV_420_NV21_ADRENO,
181     CAM_FORMAT_YUV_420_YV12,
182     CAM_FORMAT_YUV_422_NV16,
183     CAM_FORMAT_YUV_422_NV61,
184     CAM_FORMAT_YUV_420_NV12_VENUS,
185     /* Note: For all raw formats, each scanline needs to be 16 bytes aligned */
186 
187     /* Packed YUV/YVU raw format, 16 bpp: 8 bits Y and 8 bits UV.
188      * U and V are interleaved with Y: YUYV or YVYV */
189     CAM_FORMAT_YUV_RAW_8BIT_YUYV,
190     CAM_FORMAT_YUV_RAW_8BIT_YVYU,
191     CAM_FORMAT_YUV_RAW_8BIT_UYVY, //10
192     CAM_FORMAT_YUV_RAW_8BIT_VYUY,
193 
194     /* QCOM RAW formats where data is packed into 64bit word.
195      * 8BPP: 1 64-bit word contains 8 pixels p0 - p7, where p0 is
196      *       stored at LSB.
197      * 10BPP: 1 64-bit word contains 6 pixels p0 - p5, where most
198      *       significant 4 bits are set to 0. P0 is stored at LSB.
199      * 12BPP: 1 64-bit word contains 5 pixels p0 - p4, where most
200      *       significant 4 bits are set to 0. P0 is stored at LSB. */
201     CAM_FORMAT_BAYER_QCOM_RAW_8BPP_GBRG,
202     CAM_FORMAT_BAYER_QCOM_RAW_8BPP_GRBG,
203     CAM_FORMAT_BAYER_QCOM_RAW_8BPP_RGGB,
204     CAM_FORMAT_BAYER_QCOM_RAW_8BPP_BGGR,
205     CAM_FORMAT_BAYER_QCOM_RAW_10BPP_GBRG,
206     CAM_FORMAT_BAYER_QCOM_RAW_10BPP_GRBG,
207     CAM_FORMAT_BAYER_QCOM_RAW_10BPP_RGGB,
208     CAM_FORMAT_BAYER_QCOM_RAW_10BPP_BGGR,
209     CAM_FORMAT_BAYER_QCOM_RAW_12BPP_GBRG,  //20
210     CAM_FORMAT_BAYER_QCOM_RAW_12BPP_GRBG,
211     CAM_FORMAT_BAYER_QCOM_RAW_12BPP_RGGB,
212     CAM_FORMAT_BAYER_QCOM_RAW_12BPP_BGGR,
213     /* MIPI RAW formats based on MIPI CSI-2 specifiction.
214      * 8BPP: Each pixel occupies one bytes, starting at LSB.
215      *       Output with of image has no restrictons.
216      * 10BPP: Four pixels are held in every 5 bytes. The output
217      *       with of image must be a multiple of 4 pixels.
218      * 12BPP: Two pixels are held in every 3 bytes. The output
219      *       width of image must be a multiple of 2 pixels. */
220     CAM_FORMAT_BAYER_MIPI_RAW_8BPP_GBRG,
221     CAM_FORMAT_BAYER_MIPI_RAW_8BPP_GRBG,
222     CAM_FORMAT_BAYER_MIPI_RAW_8BPP_RGGB,
223     CAM_FORMAT_BAYER_MIPI_RAW_8BPP_BGGR,
224     CAM_FORMAT_BAYER_MIPI_RAW_10BPP_GBRG,
225     CAM_FORMAT_BAYER_MIPI_RAW_10BPP_GRBG,
226     CAM_FORMAT_BAYER_MIPI_RAW_10BPP_RGGB, //30
227     CAM_FORMAT_BAYER_MIPI_RAW_10BPP_BGGR,
228     CAM_FORMAT_BAYER_MIPI_RAW_12BPP_GBRG,
229     CAM_FORMAT_BAYER_MIPI_RAW_12BPP_GRBG,
230     CAM_FORMAT_BAYER_MIPI_RAW_12BPP_RGGB,
231     CAM_FORMAT_BAYER_MIPI_RAW_12BPP_BGGR,
232     /* Ideal raw formats where image data has gone through black
233      * correction, lens rolloff, demux/channel gain, bad pixel
234      * correction, and ABF.
235      * Ideal raw formats could output any of QCOM_RAW and MIPI_RAW
236      * formats, plus plain8 8bbp, plain16 800, plain16 10bpp, and
237      * plain 16 12bpp */
238     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_GBRG,
239     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_GRBG,
240     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_RGGB,
241     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_BGGR,
242     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_GBRG, //40
243     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_GRBG,
244     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_RGGB,
245     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_BGGR,
246     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_GBRG,
247     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_GRBG,
248     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_RGGB,
249     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_BGGR,
250     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_GBRG,
251     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_GRBG,
252     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_RGGB, //50
253     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_BGGR,
254     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_GBRG,
255     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_GRBG,
256     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_RGGB,
257     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_BGGR,
258     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_GBRG,
259     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_GRBG,
260     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_RGGB,
261     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_BGGR,
262     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_GBRG, //60
263     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_GRBG,
264     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_RGGB,
265     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN8_8BPP_BGGR,
266     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_GBRG,
267     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_GRBG,
268     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_RGGB,
269     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_8BPP_BGGR,
270     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_GBRG,
271     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_GRBG,
272     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_RGGB, //70
273     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_10BPP_BGGR,
274     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_GBRG,
275     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_GRBG,
276     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_RGGB,
277     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_12BPP_BGGR,
278 
279     /* generic 8-bit raw */
280     CAM_FORMAT_JPEG_RAW_8BIT,
281     CAM_FORMAT_META_RAW_8BIT,
282 
283     /* QCOM RAW formats where data is packed into 64bit word.
284      * 14BPP: 1 64-bit word contains 4 pixels p0 - p3, where most
285      *       significant 4 bits are set to 0. P0 is stored at LSB.
286      */
287     CAM_FORMAT_BAYER_QCOM_RAW_14BPP_GBRG,
288     CAM_FORMAT_BAYER_QCOM_RAW_14BPP_GRBG,
289     CAM_FORMAT_BAYER_QCOM_RAW_14BPP_RGGB, //80
290     CAM_FORMAT_BAYER_QCOM_RAW_14BPP_BGGR,
291     /* MIPI RAW formats based on MIPI CSI-2 specifiction.
292      * 14 BPPP: 1st byte: P0 [13:6]
293      *          2nd byte: P1 [13:6]
294      *          3rd byte: P2 [13:6]
295      *          4th byte: P3 [13:6]
296      *          5th byte: P0 [5:0]
297      *          7th byte: P1 [5:0]
298      *          8th byte: P2 [5:0]
299      *          9th byte: P3 [5:0]
300      */
301     CAM_FORMAT_BAYER_MIPI_RAW_14BPP_GBRG,
302     CAM_FORMAT_BAYER_MIPI_RAW_14BPP_GRBG,
303     CAM_FORMAT_BAYER_MIPI_RAW_14BPP_RGGB,
304     CAM_FORMAT_BAYER_MIPI_RAW_14BPP_BGGR,
305     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_14BPP_GBRG,
306     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_14BPP_GRBG,
307     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_14BPP_RGGB,
308     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_14BPP_BGGR,
309     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_14BPP_GBRG, //90
310     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_14BPP_GRBG,
311     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_14BPP_RGGB,
312     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_14BPP_BGGR,
313     /* 14BPP: 1st byte: P0 [8:0]
314      *        2nd byte: P0 [13:9]
315      *        3rd byte: P1 [8:0]
316      *        4th byte: P1 [13:9]
317      */
318     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_14BPP_GBRG,
319     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_14BPP_GRBG,
320     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_14BPP_RGGB,
321     CAM_FORMAT_BAYER_IDEAL_RAW_PLAIN16_14BPP_BGGR,
322 
323     CAM_FORMAT_YUV_444_NV24,
324     CAM_FORMAT_YUV_444_NV42,
325 
326     /* Y plane only, used for FD, 8BPP */
327     CAM_FORMAT_Y_ONLY, //100
328 
329     /* UBWC format */
330     CAM_FORMAT_YUV_420_NV12_UBWC,
331 
332     CAM_FORMAT_YUV_420_NV21_VENUS,
333 
334     /* RGB formats */
335     CAM_FORMAT_8888_ARGB,
336 
337     /* Y plane only */
338     CAM_FORMAT_Y_ONLY_10_BPP,
339     CAM_FORMAT_Y_ONLY_12_BPP,
340     CAM_FORMAT_Y_ONLY_14_BPP,
341     CAM_FORMAT_BAYER_QCOM_RAW_8BPP_GREY,
342     CAM_FORMAT_BAYER_QCOM_RAW_10BPP_GREY,
343     CAM_FORMAT_BAYER_QCOM_RAW_12BPP_GREY,
344     CAM_FORMAT_BAYER_QCOM_RAW_14BPP_GREY,
345     CAM_FORMAT_BAYER_MIPI_RAW_8BPP_GREY,
346     CAM_FORMAT_BAYER_MIPI_RAW_10BPP_GREY,
347     CAM_FORMAT_BAYER_MIPI_RAW_12BPP_GREY,
348     CAM_FORMAT_BAYER_MIPI_RAW_14BPP_GREY,
349     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_8BPP_GREY,
350     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_10BPP_GREY,
351     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_12BPP_GREY,
352     CAM_FORMAT_BAYER_IDEAL_RAW_QCOM_14BPP_GREY,
353     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_8BPP_GREY,
354     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_10BPP_GREY,
355     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_12BPP_GREY,
356     CAM_FORMAT_BAYER_IDEAL_RAW_MIPI_14BPP_GREY,
357 
358     CAM_FORMAT_MAX
359 } cam_format_t;
360 
361 typedef enum {
362     CAM_STREAM_TYPE_DEFAULT,       /* default stream type */
363     CAM_STREAM_TYPE_PREVIEW,       /* preview */
364     CAM_STREAM_TYPE_POSTVIEW,      /* postview */
365     CAM_STREAM_TYPE_SNAPSHOT,      /* snapshot */
366     CAM_STREAM_TYPE_VIDEO,         /* video */
367     CAM_STREAM_TYPE_CALLBACK,      /* app requested callback */
368     CAM_STREAM_TYPE_IMPL_DEFINED, /* opaque format: could be display, video enc, ZSL YUV */
369     CAM_STREAM_TYPE_METADATA,      /* meta data */
370     CAM_STREAM_TYPE_RAW,           /* raw dump from camif */
371     CAM_STREAM_TYPE_OFFLINE_PROC,  /* offline process */
372     CAM_STREAM_TYPE_PARM,         /* mct internal stream */
373     CAM_STREAM_TYPE_ANALYSIS,     /* analysis stream */
374     CAM_STREAM_TYPE_MAX,
375 } cam_stream_type_t;
376 
377 typedef enum {
378     CAM_PAD_NONE = 1,
379     CAM_PAD_TO_2 = 2,
380     CAM_PAD_TO_4 = 4,
381     CAM_PAD_TO_WORD = CAM_PAD_TO_4,
382     CAM_PAD_TO_8 = 8,
383     CAM_PAD_TO_16 = 16,
384     CAM_PAD_TO_32 = 32,
385     CAM_PAD_TO_64 = 64,
386     CAM_PAD_TO_128 = 128,
387     CAM_PAD_TO_256 = 256,
388     CAM_PAD_TO_512 = 512,
389     CAM_PAD_TO_1K = 1024,
390     CAM_PAD_TO_2K = 2048,
391     CAM_PAD_TO_4K = 4096,
392     CAM_PAD_TO_8K = 8192
393 } cam_pad_format_t;
394 
395 typedef enum {
396     /* followings are per camera */
397     CAM_MAPPING_BUF_TYPE_CAPABILITY,  /* mapping camera capability buffer */
398     CAM_MAPPING_BUF_TYPE_PARM_BUF,    /* mapping parameters buffer */
399     /* this buffer is needed for the payload to be sent with bundling related cameras cmd */
400     CAM_MAPPING_BUF_TYPE_SYNC_RELATED_SENSORS_BUF, /* mapping sync buffer.*/
401 
402     /* followings are per stream */
403     CAM_MAPPING_BUF_TYPE_STREAM_BUF,        /* mapping stream buffers */
404     CAM_MAPPING_BUF_TYPE_STREAM_INFO,       /* mapping stream information buffer */
405     CAM_MAPPING_BUF_TYPE_OFFLINE_INPUT_BUF, /* mapping offline process input buffer */
406     CAM_MAPPING_BUF_TYPE_OFFLINE_META_BUF,  /* mapping offline meta buffer */
407     CAM_MAPPING_BUF_TYPE_MISC_BUF,          /* mapping offline miscellaneous buffer */
408     CAM_MAPPING_BUF_TYPE_STREAM_USER_BUF,   /* mapping user ptr stream buffers */
409     CAM_MAPPING_BUF_TYPE_MAX
410 } cam_mapping_buf_type;
411 
412 typedef enum {
413     CAM_STREAM_BUF_TYPE_MPLANE,  /* Multiplanar Buffer type */
414     CAM_STREAM_BUF_TYPE_USERPTR, /* User specific structure pointer*/
415     CAM_STREAM_BUF_TYPE_MAX
416 } cam_stream_buf_type;
417 
418 typedef struct {
419     cam_mapping_buf_type type;
420     uint32_t stream_id;   /* stream id: valid if STREAM_BUF */
421     uint32_t frame_idx;   /* frame index: valid if type is STREAM_BUF */
422     int32_t plane_idx;    /* planner index. valid if type is STREAM_BUF.
423                            * -1 means all planners shanre the same fd;
424                            * otherwise, each planner has its own fd */
425     uint32_t cookie;      /* could be job_id(uint32_t) to identify mapping job */
426     int32_t fd;           /* origin fd */
427     size_t size;          /* size of the buffer */
428 } cam_buf_map_type;
429 
430 typedef struct {
431     uint32_t length;
432     cam_buf_map_type buf_maps[CAM_MAX_NUM_BUFS_PER_STREAM];
433 } cam_buf_map_type_list;
434 
435 typedef struct {
436     cam_mapping_buf_type type;
437     uint32_t stream_id;   /* stream id: valid if STREAM_BUF */
438     uint32_t frame_idx;   /* frame index: valid if STREAM_BUF or HIST_BUF */
439     int32_t plane_idx;    /* planner index. valid if type is STREAM_BUF.
440                            * -1 means all planners shanre the same fd;
441                            * otherwise, each planner has its own fd */
442     uint32_t cookie;      /* could be job_id(uint32_t) to identify unmapping job */
443 } cam_buf_unmap_type;
444 
445 typedef struct {
446     uint32_t length;
447     cam_buf_unmap_type buf_unmaps[CAM_MAX_NUM_BUFS_PER_STREAM];
448 } cam_buf_unmap_type_list;
449 
450 typedef enum {
451     CAM_MAPPING_TYPE_FD_MAPPING,
452     CAM_MAPPING_TYPE_FD_UNMAPPING,
453     CAM_MAPPING_TYPE_FD_BUNDLED_MAPPING,
454     CAM_MAPPING_TYPE_FD_BUNDLED_UNMAPPING,
455     CAM_MAPPING_TYPE_MAX
456 } cam_mapping_type;
457 
458 typedef struct {
459     cam_mapping_type msg_type;
460     union {
461         cam_buf_map_type buf_map;
462         cam_buf_unmap_type buf_unmap;
463         cam_buf_map_type_list buf_map_list;
464         cam_buf_unmap_type_list buf_unmap_list;
465     } payload;
466 } cam_sock_packet_t;
467 
468 typedef enum {
469     CAM_MODE_2D = (1<<0),
470     CAM_MODE_3D = (1<<1)
471 } cam_mode_t;
472 
473 typedef struct {
474     uint32_t len;
475     uint32_t y_offset;
476     uint32_t cbcr_offset;
477 } cam_sp_len_offset_t;
478 
479 typedef struct{
480     uint32_t len;
481     uint32_t offset;
482     int32_t offset_x;
483     int32_t offset_y;
484     int32_t stride;
485     int32_t stride_in_bytes;
486     int32_t scanline;
487     int32_t width;    /* width without padding */
488     int32_t height;   /* height without padding */
489     int32_t meta_stride;   /*Meta stride*/
490     int32_t meta_scanline; /*Meta Scanline*/
491     int32_t meta_len;   /*Meta plane length including 4k padding*/
492 } cam_mp_len_offset_t;
493 
494 typedef struct {
495     uint32_t offset_x;
496     uint32_t offset_y;
497 } cam_offset_info_t;
498 
499 typedef struct {
500     uint32_t width_padding;
501     uint32_t height_padding;
502     uint32_t plane_padding;
503     uint32_t min_stride;
504     uint32_t min_scanline;
505     cam_offset_info_t offset_info;
506 } cam_padding_info_t;
507 
508 typedef struct {
509     uint32_t num_planes;    /*Number of planes in planar buffer*/
510     union {
511         cam_sp_len_offset_t sp;
512         cam_mp_len_offset_t mp[VIDEO_MAX_PLANES];
513     };
514     uint32_t frame_len;
515 } cam_frame_len_offset_t;
516 
517 typedef struct {
518     uint8_t frame_buf_cnt;  /*Total plane frames present in 1 batch*/
519     uint32_t size;          /*Size of 1 batch buffer. Kernel structure size*/
520     long frameInterval;     /*frame interval between each frame*/
521 } cam_stream_user_buf_info_t;
522 
523 typedef struct {
524     int32_t width;
525     int32_t height;
526 } cam_dimension_t;
527 
528 typedef struct {
529     cam_frame_len_offset_t plane_info;
530 } cam_stream_buf_plane_info_t;
531 
532 typedef struct {
533     float min_fps;
534     float max_fps;
535     float video_min_fps;
536     float video_max_fps;
537 } cam_fps_range_t;
538 
539 typedef struct {
540     int32_t min_sensitivity;
541     int32_t max_sensitivity;
542 } cam_sensitivity_range_t;
543 
544 typedef enum {
545     CAM_HFR_MODE_OFF,
546     CAM_HFR_MODE_60FPS,
547     CAM_HFR_MODE_90FPS,
548     CAM_HFR_MODE_120FPS,
549     CAM_HFR_MODE_150FPS,
550     CAM_HFR_MODE_180FPS,
551     CAM_HFR_MODE_210FPS,
552     CAM_HFR_MODE_240FPS,
553     CAM_HFR_MODE_480FPS,
554     CAM_HFR_MODE_MAX
555 } cam_hfr_mode_t;
556 
557 typedef struct {
558     cam_hfr_mode_t mode;
559     cam_dimension_t dim;
560     uint8_t frame_skip;
561     uint8_t livesnapshot_sizes_tbl_cnt;                     /* livesnapshot sizes table size */
562     cam_dimension_t livesnapshot_sizes_tbl[MAX_SIZES_CNT];  /* livesnapshot sizes table */
563 } cam_hfr_info_t;
564 
565 typedef enum {
566     CAM_WB_MODE_AUTO,
567     CAM_WB_MODE_CUSTOM,
568     CAM_WB_MODE_INCANDESCENT,
569     CAM_WB_MODE_FLUORESCENT,
570     CAM_WB_MODE_WARM_FLUORESCENT,
571     CAM_WB_MODE_DAYLIGHT,
572     CAM_WB_MODE_CLOUDY_DAYLIGHT,
573     CAM_WB_MODE_TWILIGHT,
574     CAM_WB_MODE_SHADE,
575     CAM_WB_MODE_MANUAL,
576     CAM_WB_MODE_OFF,
577     CAM_WB_MODE_MAX
578 } cam_wb_mode_type;
579 
580 typedef enum {
581     CAM_ANTIBANDING_MODE_OFF,
582     CAM_ANTIBANDING_MODE_60HZ,
583     CAM_ANTIBANDING_MODE_50HZ,
584     CAM_ANTIBANDING_MODE_AUTO,
585     CAM_ANTIBANDING_MODE_AUTO_50HZ,
586     CAM_ANTIBANDING_MODE_AUTO_60HZ,
587     CAM_ANTIBANDING_MODE_MAX,
588 } cam_antibanding_mode_type;
589 
590 /* Enum Type for different ISO Mode supported */
591 typedef enum {
592     CAM_ISO_MODE_AUTO,
593     CAM_ISO_MODE_DEBLUR,
594     CAM_ISO_MODE_100,
595     CAM_ISO_MODE_200,
596     CAM_ISO_MODE_400,
597     CAM_ISO_MODE_800,
598     CAM_ISO_MODE_1600,
599     CAM_ISO_MODE_3200,
600     CAM_ISO_MODE_MAX
601 } cam_iso_mode_type;
602 
603 typedef enum {
604     CAM_AEC_MODE_FRAME_AVERAGE,
605     CAM_AEC_MODE_CENTER_WEIGHTED,
606     CAM_AEC_MODE_SPOT_METERING,
607     CAM_AEC_MODE_SMART_METERING,
608     CAM_AEC_MODE_USER_METERING,
609     CAM_AEC_MODE_SPOT_METERING_ADV,
610     CAM_AEC_MODE_CENTER_WEIGHTED_ADV,
611     CAM_AEC_MODE_MAX
612 } cam_auto_exposure_mode_type;
613 
614 /* enum to select AEC convergence type */
615 typedef enum {
616     /* Normal AEC connvergence */
617     CAM_AEC_NORMAL_CONVERGENCE = 0,
618     /* Aggressive AEC connvergence */
619     CAM_AEC_AGGRESSIVE_CONVERGENCE,
620     /* Fast AEC convergence */
621     CAM_AEC_FAST_CONVERGENCE,
622     CAM_AEC_CONVERGENCE_MAX
623 } cam_aec_convergence_type;
624 
625 typedef enum {
626     CAM_AE_MODE_OFF,
627     CAM_AE_MODE_ON,
628     CAM_AE_MODE_MAX
629 } cam_ae_mode_type;
630 
631 typedef enum {
632     CAM_FOCUS_ALGO_AUTO,
633     CAM_FOCUS_ALGO_SPOT,
634     CAM_FOCUS_ALGO_CENTER_WEIGHTED,
635     CAM_FOCUS_ALGO_AVERAGE,
636     CAM_FOCUS_ALGO_MAX
637 } cam_focus_algorithm_type;
638 
639 /* Auto focus mode */
640 typedef enum {
641     CAM_FOCUS_MODE_OFF,
642     CAM_FOCUS_MODE_AUTO,
643     CAM_FOCUS_MODE_INFINITY,
644     CAM_FOCUS_MODE_MACRO,
645     CAM_FOCUS_MODE_FIXED,
646     CAM_FOCUS_MODE_EDOF,
647     CAM_FOCUS_MODE_CONTINOUS_VIDEO,
648     CAM_FOCUS_MODE_CONTINOUS_PICTURE,
649     CAM_FOCUS_MODE_MANUAL,
650     CAM_FOCUS_MODE_MAX
651 } cam_focus_mode_type;
652 
653 typedef enum {
654     CAM_MANUAL_FOCUS_MODE_INDEX,
655     CAM_MANUAL_FOCUS_MODE_DAC_CODE,
656     CAM_MANUAL_FOCUS_MODE_RATIO,
657     CAM_MANUAL_FOCUS_MODE_DIOPTER,
658     CAM_MANUAL_FOCUS_MODE_MAX
659 } cam_manual_focus_mode_type;
660 
661 typedef struct {
662     cam_manual_focus_mode_type flag;
663     union{
664         int32_t af_manual_lens_position_index;
665         int32_t af_manual_lens_position_dac;
666         int32_t af_manual_lens_position_ratio;
667         float af_manual_diopter;
668     };
669 } cam_manual_focus_parm_t;
670 
671 typedef enum {
672     CAM_MANUAL_WB_MODE_CCT,
673     CAM_MANUAL_WB_MODE_GAIN,
674     CAM_MANUAL_WB_MODE_MAX
675 } cam_manual_wb_mode_type;
676 
677 typedef struct {
678     float r_gain;
679     float g_gain;
680     float b_gain;
681 } cam_awb_gain_t;
682 
683 typedef struct {
684     cam_manual_wb_mode_type type;
685     union{
686         int32_t cct;
687         cam_awb_gain_t gains;
688     };
689 } cam_manual_wb_parm_t;
690 
691 typedef enum {
692     CAM_SCENE_MODE_OFF,
693     CAM_SCENE_MODE_AUTO,
694     CAM_SCENE_MODE_LANDSCAPE,
695     CAM_SCENE_MODE_SNOW,
696     CAM_SCENE_MODE_BEACH,
697     CAM_SCENE_MODE_SUNSET,
698     CAM_SCENE_MODE_NIGHT,
699     CAM_SCENE_MODE_PORTRAIT,
700     CAM_SCENE_MODE_BACKLIGHT,
701     CAM_SCENE_MODE_SPORTS,
702     CAM_SCENE_MODE_ANTISHAKE,
703     CAM_SCENE_MODE_FLOWERS,
704     CAM_SCENE_MODE_CANDLELIGHT,
705     CAM_SCENE_MODE_FIREWORKS,
706     CAM_SCENE_MODE_PARTY,
707     CAM_SCENE_MODE_NIGHT_PORTRAIT,
708     CAM_SCENE_MODE_THEATRE,
709     CAM_SCENE_MODE_ACTION,
710     CAM_SCENE_MODE_AR,
711     CAM_SCENE_MODE_FACE_PRIORITY,
712     CAM_SCENE_MODE_BARCODE,
713     CAM_SCENE_MODE_HDR,
714     CAM_SCENE_MODE_AQUA,
715     CAM_SCENE_MODE_MAX
716 } cam_scene_mode_type;
717 
718 typedef enum {
719     CAM_EFFECT_MODE_OFF,
720     CAM_EFFECT_MODE_MONO,
721     CAM_EFFECT_MODE_NEGATIVE,
722     CAM_EFFECT_MODE_SOLARIZE,
723     CAM_EFFECT_MODE_SEPIA,
724     CAM_EFFECT_MODE_POSTERIZE,
725     CAM_EFFECT_MODE_WHITEBOARD,
726     CAM_EFFECT_MODE_BLACKBOARD,
727     CAM_EFFECT_MODE_AQUA,
728     CAM_EFFECT_MODE_EMBOSS,
729     CAM_EFFECT_MODE_SKETCH,
730     CAM_EFFECT_MODE_NEON,
731     CAM_EFFECT_MODE_BEAUTY,
732     CAM_EFFECT_MODE_MAX
733 } cam_effect_mode_type;
734 
735 typedef enum {
736     CAM_FLASH_MODE_OFF,
737     CAM_FLASH_MODE_AUTO,
738     CAM_FLASH_MODE_ON,
739     CAM_FLASH_MODE_TORCH,
740     CAM_FLASH_MODE_SINGLE,
741     CAM_FLASH_MODE_MAX
742 } cam_flash_mode_t;
743 
744 // Flash States
745 typedef enum {
746     CAM_FLASH_STATE_UNAVAILABLE,
747     CAM_FLASH_STATE_CHARGING,
748     CAM_FLASH_STATE_READY,
749     CAM_FLASH_STATE_FIRED,
750     CAM_FLASH_STATE_PARTIAL,
751     CAM_FLASH_STATE_MAX
752 } cam_flash_state_t;
753 
754 typedef enum {
755     CAM_FLASH_FIRING_LEVEL_0,
756     CAM_FLASH_FIRING_LEVEL_1,
757     CAM_FLASH_FIRING_LEVEL_2,
758     CAM_FLASH_FIRING_LEVEL_3,
759     CAM_FLASH_FIRING_LEVEL_4,
760     CAM_FLASH_FIRING_LEVEL_5,
761     CAM_FLASH_FIRING_LEVEL_6,
762     CAM_FLASH_FIRING_LEVEL_7,
763     CAM_FLASH_FIRING_LEVEL_8,
764     CAM_FLASH_FIRING_LEVEL_9,
765     CAM_FLASH_FIRING_LEVEL_10,
766     CAM_FLASH_FIRING_LEVEL_MAX
767 } cam_flash_firing_level_t;
768 
769 
770 typedef enum {
771     CAM_AEC_TRIGGER_IDLE,
772     CAM_AEC_TRIGGER_START
773 } cam_aec_trigger_type_t;
774 
775 typedef enum {
776     CAM_AF_TRIGGER_IDLE,
777     CAM_AF_TRIGGER_START,
778     CAM_AF_TRIGGER_CANCEL
779 } cam_af_trigger_type_t;
780 
781 typedef enum {
782     CAM_AE_STATE_INACTIVE,
783     CAM_AE_STATE_SEARCHING,
784     CAM_AE_STATE_CONVERGED,
785     CAM_AE_STATE_LOCKED,
786     CAM_AE_STATE_FLASH_REQUIRED,
787     CAM_AE_STATE_PRECAPTURE
788 } cam_ae_state_t;
789 
790 typedef enum {
791     CAM_NOISE_REDUCTION_MODE_OFF,
792     CAM_NOISE_REDUCTION_MODE_FAST,
793     CAM_NOISE_REDUCTION_MODE_HIGH_QUALITY,
794     CAM_NOISE_REDUCTION_MODE_MINIMAL,
795     CAM_NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG
796 } cam_noise_reduction_mode_t;
797 
798 typedef enum {
799     CAM_EDGE_MODE_OFF,
800     CAM_EDGE_MODE_FAST,
801     CAM_EDGE_MODE_HIGH_QUALITY,
802     CAM_EDGE_MODE_ZERO_SHUTTER_LAG,
803 } cam_edge_mode_t;
804 
805 typedef struct {
806    uint8_t edge_mode;
807    int32_t sharpness;
808 } cam_edge_application_t;
809 
810 typedef enum {
811     CAM_BLACK_LEVEL_LOCK_OFF,
812     CAM_BLACK_LEVEL_LOCK_ON,
813 } cam_black_level_lock_t;
814 
815 typedef enum {
816     CAM_HOTPIXEL_MODE_OFF,
817     CAM_HOTPIXEL_MODE_FAST,
818     CAM_HOTPIXEL_MODE_HIGH_QUALITY,
819 } cam_hotpixel_mode_t;
820 
821 typedef enum {
822     CAM_LENS_SHADING_MAP_MODE_OFF,
823     CAM_LENS_SHADING_MAP_MODE_ON,
824 } cam_lens_shading_map_mode_t;
825 
826 typedef enum {
827     CAM_LENS_SHADING_MODE_OFF,
828     CAM_LENS_SHADING_MODE_FAST,
829     CAM_LENS_SHADING_MODE_HIGH_QUALITY,
830 } cam_lens_shading_mode_t;
831 
832 typedef enum {
833     CAM_FACE_DETECT_MODE_OFF,
834     CAM_FACE_DETECT_MODE_SIMPLE,
835     CAM_FACE_DETECT_MODE_FULL,
836 } cam_face_detect_mode_t;
837 
838 typedef enum {
839     CAM_TONEMAP_MODE_CONTRAST_CURVE,
840     CAM_TONEMAP_MODE_FAST,
841     CAM_TONEMAP_MODE_HIGH_QUALITY,
842 } cam_tonemap_mode_t;
843 
844 typedef enum {
845     CAM_CDS_MODE_OFF,
846     CAM_CDS_MODE_ON,
847     CAM_CDS_MODE_AUTO,
848     CAM_CDS_MODE_LOCK,
849     CAM_CDS_MODE_MAX
850 } cam_cds_mode_type_t;
851 
852 typedef enum {
853     CAM_SENSOR_HDR_OFF,
854     CAM_SENSOR_HDR_IN_SENSOR = 1,
855     CAM_SENSOR_HDR_ZIGZAG,
856     CAM_SENSOR_HDR_MAX,
857 } cam_sensor_hdr_type_t;
858 
859 typedef struct  {
860     int32_t left;
861     int32_t top;
862     int32_t width;
863     int32_t height;
864 } cam_rect_t;
865 
866 typedef struct  {
867     cam_rect_t rect;
868     int32_t weight; /* weight of the area, valid for focusing/metering areas */
869 } cam_area_t;
870 
871 typedef enum {
872     CAM_STREAMING_MODE_CONTINUOUS, /* continous streaming */
873     CAM_STREAMING_MODE_BURST,      /* burst streaming */
874     CAM_STREAMING_MODE_BATCH,      /* stream frames in batches */
875     CAM_STREAMING_MODE_MAX
876 } cam_streaming_mode_t;
877 
878 typedef enum {
879     IS_TYPE_NONE,
880     IS_TYPE_DIS,
881     IS_TYPE_GA_DIS,
882     IS_TYPE_EIS_1_0,
883     IS_TYPE_EIS_2_0,
884     IS_TYPE_MAX
885 } cam_is_type_t;
886 
887 typedef enum {
888     DIS_DISABLE,
889     DIS_ENABLE
890 } cam_dis_mode_t;
891 
892 typedef enum {
893   NON_SECURE,
894   SECURE
895 } cam_stream_secure_t;
896 
897 #define CAM_REPROCESS_MASK_TYPE_WNR (1<<0)
898 
899 /* event from server */
900 typedef enum {
901     CAM_EVENT_TYPE_MAP_UNMAP_DONE  = (1<<0),
902     CAM_EVENT_TYPE_AUTO_FOCUS_DONE = (1<<1),
903     CAM_EVENT_TYPE_ZOOM_DONE       = (1<<2),
904     CAM_EVENT_TYPE_DAEMON_DIED     = (1<<3),
905     CAM_EVENT_TYPE_INT_TAKE_JPEG   = (1<<4),
906     CAM_EVENT_TYPE_INT_TAKE_RAW    = (1<<5),
907     CAM_EVENT_TYPE_DAEMON_PULL_REQ = (1<<6),
908     CAM_EVENT_TYPE_CAC_DONE        = (1<<7),
909     CAM_EVENT_TYPE_MAX
910 } cam_event_type_t;
911 
912 typedef enum {
913     CAM_EXP_BRACKETING_OFF,
914     CAM_EXP_BRACKETING_ON
915 } cam_bracket_mode;
916 
917 typedef enum {
918     CAM_LOW_LIGHT_OFF = 0,
919     CAM_LOW_LIGHT_ON,
920 } cam_low_light_mode_t;
921 
922 typedef struct {
923     cam_bracket_mode mode;
924     char values[MAX_EXP_BRACKETING_LENGTH];  /* user defined values */
925 } cam_exp_bracketing_t;
926 
927 typedef struct {
928   uint32_t num_frames;
929   cam_exp_bracketing_t exp_val;
930 } cam_hdr_bracketing_info_t;
931 
932  typedef struct {
933     cam_bracket_mode mode;
934     int32_t values;  /* user defined values */
935 } cam_capture_bracketing_t;
936 
937 typedef enum {
938     CAM_SETTINGS_TYPE_OFF,
939     CAM_SETTINGS_TYPE_ON,
940     CAM_SETTINGS_TYPE_AUTO
941 } cam_manual_setting_mode;
942 
943 typedef struct {
944     cam_manual_setting_mode exp_mode;
945     int64_t exp_time;
946     cam_manual_setting_mode iso_mode;
947     int32_t iso_value;
948 } cam_capture_manual_3A_t;
949 
950 typedef enum {
951     CAM_CAPTURE_NORMAL,
952     CAM_CAPTURE_FLASH,
953     CAM_CAPTURE_BRACKETING,
954     CAM_CAPTURE_LOW_LIGHT,
955     CAM_CAPTURE_RESET,
956     CAM_CAPTURE_MANUAL_3A,
957     CAM_CAPTURE_MAX
958 } cam_capture_type;
959 
960 typedef struct {
961     int32_t num_frames;     /*Num of frames requested on this quality*/
962     cam_capture_type type;  /*type of the capture request*/
963 
964     /*union to strore values of capture type*/
965     union {
966         cam_flash_mode_t flash_mode;
967         cam_capture_bracketing_t hdr_mode;
968         cam_low_light_mode_t low_light_mode;
969         cam_capture_manual_3A_t manual_3A_mode;
970     };
971 } cam_capture_settings_t;
972 
973 typedef struct {
974     uint32_t num_batch;  /*Number of frames batch requested*/
975     cam_capture_settings_t configs[MAX_CAPTURE_BATCH_NUM];
976 } cam_capture_frame_config_t;
977 
978 typedef struct {
979     uint8_t stepsize;
980     uint8_t direction;
981     int32_t num_steps;
982     uint8_t ttype;
983 } tune_actuator_t;
984 
985 typedef struct {
986     uint8_t module;
987     uint8_t type;
988     int32_t value;
989 } tune_cmd_t;
990 
991 typedef enum {
992     CAM_AEC_ROI_OFF,
993     CAM_AEC_ROI_ON
994 } cam_aec_roi_ctrl_t;
995 
996 typedef enum {
997     CAM_AEC_ROI_BY_INDEX,
998     CAM_AEC_ROI_BY_COORDINATE,
999 } cam_aec_roi_type_t;
1000 
1001 typedef struct {
1002     uint32_t x;
1003     uint32_t y;
1004 } cam_coordinate_type_t;
1005 
1006 typedef struct {
1007     int32_t numerator;
1008     int32_t denominator;
1009 } cam_rational_type_t;
1010 
1011 typedef struct {
1012     cam_aec_roi_ctrl_t aec_roi_enable;
1013     cam_aec_roi_type_t aec_roi_type;
1014     union {
1015         cam_coordinate_type_t coordinate[MAX_ROI];
1016         uint32_t aec_roi_idx[MAX_ROI];
1017     } cam_aec_roi_position;
1018 } cam_set_aec_roi_t;
1019 
1020 typedef struct {
1021     uint32_t frm_id;
1022     uint8_t num_roi;
1023     cam_rect_t roi[MAX_ROI];
1024     int32_t weight[MAX_ROI];
1025     uint8_t is_multiwindow;
1026 } cam_roi_info_t;
1027 
1028 typedef enum {
1029     CAM_WAVELET_DENOISE_YCBCR_PLANE,
1030     CAM_WAVELET_DENOISE_CBCR_ONLY,
1031     CAM_WAVELET_DENOISE_STREAMLINE_YCBCR,
1032     CAM_WAVELET_DENOISE_STREAMLINED_CBCR
1033 } cam_denoise_process_type_t;
1034 
1035 typedef struct {
1036     uint8_t denoise_enable;
1037     cam_denoise_process_type_t process_plates;
1038 } cam_denoise_param_t;
1039 
1040 #define CAM_FACE_PROCESS_MASK_DETECTION     (1U<<0)
1041 #define CAM_FACE_PROCESS_MASK_RECOGNITION   (1U<<1)
1042 #define CAM_FACE_PROCESS_MASK_FOCUS         (1U<<2)
1043 #define CAM_FACE_PROCESS_MASK_BLINK         (1U<<3)
1044 #define CAM_FACE_PROCESS_MASK_SMILE         (1U<<4)
1045 #define CAM_FACE_PROCESS_MASK_GAZE          (1U<<5)
1046 
1047 typedef struct {
1048     uint32_t fd_mode;          /* mask of face process */
1049     uint32_t num_fd;
1050 } cam_fd_set_parm_t;
1051 
1052 typedef enum {
1053     QCAMERA_FD_PREVIEW,
1054     QCAMERA_FD_SNAPSHOT
1055 }qcamera_face_detect_type_t;
1056 
1057 typedef enum {
1058     CAM_FACE_CT_POINT_EYE_L_PUPIL,
1059     CAM_FACE_CT_POINT_EYE_L_IN,
1060     CAM_FACE_CT_POINT_EYE_L_OUT,
1061     CAM_FACE_CT_POINT_EYE_L_UP,
1062     CAM_FACE_CT_POINT_EYE_L_DOWN,
1063     CAM_FACE_CT_POINT_EYE_R_PUPIL,
1064     CAM_FACE_CT_POINT_EYE_R_IN,
1065     CAM_FACE_CT_POINT_EYE_R_OUT,
1066     CAM_FACE_CT_POINT_EYE_R_UP,
1067     CAM_FACE_CT_POINT_EYE_R_DOWN,
1068     CAM_FACE_CT_POINT_EYE_MAX
1069 } cam_face_ct_point_eye_t;
1070 
1071 typedef enum {
1072     CAM_FACE_CT_POINT_FOREHEAD,
1073     CAM_FACE_CT_POINT_FOREHEAD_MAX
1074 } cam_face_ct_point_forh_t;
1075 
1076 typedef enum {
1077     CAM_FACE_CT_POINT_NOSE,
1078     CAM_FACE_CT_POINT_NOSE_TIP,
1079     CAM_FACE_CT_POINT_NOSE_L,
1080     CAM_FACE_CT_POINT_NOSE_R,
1081     CAM_FACE_CT_POINT_NOSE_L_0,
1082     CAM_FACE_CT_POINT_NOSE_R_0,
1083     CAM_FACE_CT_POINT_NOSE_L_1,
1084     CAM_FACE_CT_POINT_NOSE_R_1,
1085     CAM_FACE_CT_POINT_NOSE_MAX
1086 } cam_face_ct_point_nose_t;
1087 
1088 typedef enum {
1089     CAM_FACE_CT_POINT_MOUTH_L,
1090     CAM_FACE_CT_POINT_MOUTH_R,
1091     CAM_FACE_CT_POINT_MOUTH_UP,
1092     CAM_FACE_CT_POINT_MOUTH_DOWN,
1093     CAM_FACE_CT_POINT_MOUTH_MAX
1094 } cam_face_ct_point_mouth_t;
1095 
1096 typedef enum {
1097     CAM_FACE_CT_POINT_LIP_UP,
1098     CAM_FACE_CT_POINT_LIP_DOWN,
1099     CAM_FACE_CT_POINT_LIP_MAX
1100 } cam_face_ct_point_lip_t;
1101 
1102 typedef enum {
1103     CAM_FACE_CT_POINT_BROW_L_UP,
1104     CAM_FACE_CT_POINT_BROW_L_DOWN,
1105     CAM_FACE_CT_POINT_BROW_L_IN,
1106     CAM_FACE_CT_POINT_BROW_L_OUT,
1107     CAM_FACE_CT_POINT_BROW_R_UP,
1108     CAM_FACE_CT_POINT_BROW_R_DOWN,
1109     CAM_FACE_CT_POINT_BROW_R_IN,
1110     CAM_FACE_CT_POINT_BROW_R_OUT,
1111     CAM_FACE_CT_POINT_BROW_MAX
1112 } cam_face_ct_point_brow_t;
1113 
1114 typedef enum {
1115     CAM_FACE_CT_POINT_CHIN,
1116     CAM_FACE_CT_POINT_CHIN_L,
1117     CAM_FACE_CT_POINT_CHIN_R,
1118     CAM_FACE_CT_POINT_CHIN_MAX
1119 } cam_face_ct_point_chin_t;
1120 
1121 typedef enum {
1122     CAM_FACE_CT_POINT_EAR_L_DOWN,
1123     CAM_FACE_CT_POINT_EAR_R_DOWN,
1124     CAM_FACE_CT_POINT_EAR_L_UP,
1125     CAM_FACE_CT_POINT_EAR_R_UP,
1126     CAM_FACE_CT_POINT_EAR_MAX
1127 } cam_face_ct_point_ear_t;
1128 
1129 typedef struct {
1130   uint8_t is_eye_valid;
1131   cam_coordinate_type_t contour_eye_pt[CAM_FACE_CT_POINT_EYE_MAX];
1132   uint8_t is_forehead_valid;
1133   cam_coordinate_type_t contour_forh_pt[CAM_FACE_CT_POINT_FOREHEAD_MAX];
1134   uint8_t is_nose_valid;
1135   cam_coordinate_type_t contour_nose_pt[CAM_FACE_CT_POINT_NOSE_MAX];
1136   uint8_t is_mouth_valid;
1137   cam_coordinate_type_t contour_mouth_pt[CAM_FACE_CT_POINT_MOUTH_MAX];
1138   uint8_t is_lip_valid;
1139   cam_coordinate_type_t contour_lip_pt[CAM_FACE_CT_POINT_LIP_MAX];
1140   uint8_t is_brow_valid;
1141   cam_coordinate_type_t contour_brow_pt[CAM_FACE_CT_POINT_BROW_MAX];
1142   uint8_t is_chin_valid;
1143   cam_coordinate_type_t contour_chin_pt[CAM_FACE_CT_POINT_CHIN_MAX];
1144   uint8_t is_ear_valid;
1145   cam_coordinate_type_t contour_ear_pt[CAM_FACE_CT_POINT_EAR_MAX];
1146 } cam_face_contour_info_t;
1147 
1148 typedef struct {
1149     cam_face_contour_info_t face_contour[MAX_ROI];
1150 } cam_face_contour_data_t;
1151 
1152 typedef struct {
1153     cam_coordinate_type_t left_eye_center;  /* coordinate of center of left eye */
1154     cam_coordinate_type_t right_eye_center; /* coordinate of center of right eye */
1155     cam_coordinate_type_t mouth_center;     /* coordinate of center of mouth */
1156 } cam_face_landmarks_info_t;
1157 
1158 typedef struct {
1159     cam_face_landmarks_info_t face_landmarks[MAX_ROI];
1160 } cam_face_landmarks_data_t;
1161 
1162 typedef struct {
1163     uint8_t smile_degree;      /* smile degree (0, -100) */
1164     uint8_t smile_confidence;  /* smile confidence (0, 100) */
1165 } cam_face_smile_info_t;
1166 
1167 typedef struct {
1168     cam_face_smile_info_t smile[MAX_ROI];
1169 } cam_face_smile_data_t;
1170 
1171 typedef struct {
1172     int8_t gaze_angle;         /* -90 -45 0 45 90 for head left to rigth tilt */
1173     int32_t updown_dir;        /* up down direction (-180, 179) */
1174     int32_t leftright_dir;     /* left right direction (-180, 179) */
1175     int32_t roll_dir;          /* roll direction (-180, 179) */
1176     int8_t left_right_gaze;    /* left right gaze degree (-50, 50) */
1177     int8_t top_bottom_gaze;    /* up down gaze degree (-50, 50) */
1178 } cam_face_gaze_info_t;
1179 
1180 typedef struct {
1181     cam_face_gaze_info_t gaze[MAX_ROI];
1182 } cam_face_gaze_data_t;
1183 
1184 typedef struct {
1185     uint8_t blink_detected;    /* if blink is detected */
1186     uint8_t left_blink;        /* left eye blink degeree (0, -100) */
1187     uint8_t right_blink;       /* right eye blink degree (0, - 100) */
1188 } cam_face_blink_info_t;
1189 
1190 typedef struct {
1191     cam_face_blink_info_t blink[MAX_ROI];
1192 } cam_face_blink_data_t;
1193 
1194 typedef struct {
1195     uint8_t face_recognised;   /* if face is recognised */
1196     uint32_t unique_id;   /* if face is recognised */
1197 } cam_face_recog_info_t;
1198 
1199 typedef struct {
1200     cam_face_recog_info_t face_rec[MAX_ROI];
1201 } cam_face_recog_data_t;
1202 
1203 typedef struct {
1204     int32_t face_id;            /* unique id for face tracking within view unless view changes */
1205     int8_t score;              /* score of confidence (0, -100) */
1206     cam_rect_t face_boundary;  /* boundary of face detected */
1207 } cam_face_detection_info_t;
1208 
1209 typedef struct {
1210     uint32_t frame_id;                         /* frame index of which faces are detected */
1211     uint8_t num_faces_detected;                /* number of faces detected */
1212     cam_face_detection_info_t faces[MAX_ROI];  /* detailed information of faces detected */
1213     qcamera_face_detect_type_t fd_type;        /* face detect for preview or snapshot frame*/
1214     cam_dimension_t fd_frame_dim;              /* frame dims on which fd is applied */
1215     uint8_t update_flag;                       /* flag to inform whether HAL needs to send cb
1216                                                 * to app or not */
1217 } cam_face_detection_data_t;
1218 
1219 // definition of composite face detection data
1220 typedef struct {
1221     cam_face_detection_data_t detection_data;
1222 
1223     int8_t recog_valid;
1224     cam_face_recog_data_t recog_data;
1225 
1226     int8_t blink_valid;
1227     cam_face_blink_data_t blink_data;
1228 
1229     int8_t gaze_valid;
1230     cam_face_gaze_data_t gaze_data;
1231 
1232     int8_t smile_valid;
1233     cam_face_smile_data_t smile_data;
1234 
1235     int8_t landmark_valid;
1236     cam_face_landmarks_data_t landmark_data;
1237 
1238     int8_t contour_valid;
1239     cam_face_contour_data_t contour_data;
1240 } cam_faces_data_t;
1241 
1242 #define CAM_HISTOGRAM_STATS_SIZE 256
1243 typedef struct {
1244     uint32_t max_hist_value;
1245     uint32_t hist_buf[CAM_HISTOGRAM_STATS_SIZE]; /* buf holding histogram stats data */
1246 } cam_histogram_data_t;
1247 
1248 typedef struct {
1249     cam_histogram_data_t r_stats;
1250     cam_histogram_data_t b_stats;
1251     cam_histogram_data_t gr_stats;
1252     cam_histogram_data_t gb_stats;
1253 } cam_bayer_hist_stats_t;
1254 
1255 typedef enum {
1256     CAM_HISTOGRAM_TYPE_BAYER,
1257     CAM_HISTOGRAM_TYPE_YUV
1258 } cam_histogram_type_t;
1259 
1260 typedef struct {
1261     cam_histogram_type_t type;
1262     union {
1263         cam_bayer_hist_stats_t bayer_stats;
1264         cam_histogram_data_t yuv_stats;
1265     };
1266 } cam_hist_stats_t;
1267 
1268 enum cam_focus_distance_index{
1269   CAM_FOCUS_DISTANCE_NEAR_INDEX,  /* 0 */
1270   CAM_FOCUS_DISTANCE_OPTIMAL_INDEX,
1271   CAM_FOCUS_DISTANCE_FAR_INDEX,
1272   CAM_FOCUS_DISTANCE_MAX_INDEX
1273 };
1274 
1275 typedef struct {
1276   float focus_distance[CAM_FOCUS_DISTANCE_MAX_INDEX];
1277 } cam_focus_distances_info_t;
1278 
1279 typedef struct {
1280     uint32_t scale;
1281     float diopter;
1282 } cam_focus_pos_info_t ;
1283 
1284 typedef struct {
1285     float focalLengthRatio;
1286 } cam_focal_length_ratio_t;
1287 
1288 typedef struct {
1289     uint8_t needFlush;
1290     uint32_t focused_frame_idx;
1291 } cam_af_flush_info_t;
1292 
1293 /* Different autofocus cycle when calling do_autoFocus
1294  * CAM_AF_COMPLETE_EXISTING_SWEEP: Complete existing sweep
1295  * if one is ongoing, and lock.
1296  * CAM_AF_DO_ONE_FULL_SWEEP: Do one full sweep, regardless
1297  * of the current state, and lock.
1298  * CAM_AF_START_CONTINUOUS_SWEEP: Start continous sweep.
1299  * After do_autoFocus, HAL receives an event: CAM_AF_FOCUSED,
1300  * or CAM_AF_NOT_FOCUSED.
1301  * cancel_autoFocus stops any lens movement.
1302  * Each do_autoFocus call only produces 1 FOCUSED/NOT_FOCUSED
1303  * event, not both.
1304  */
1305 typedef enum {
1306     CAM_AF_COMPLETE_EXISTING_SWEEP,
1307     CAM_AF_DO_ONE_FULL_SWEEP,
1308     CAM_AF_START_CONTINUOUS_SWEEP
1309 } cam_autofocus_cycle_t;
1310 
1311 typedef enum {
1312     CAM_AF_SCANNING,
1313     CAM_AF_FOCUSED,
1314     CAM_AF_NOT_FOCUSED,
1315     CAM_CAF_SCANNING,
1316     CAM_CAF_FOCUSED,
1317     CAM_CAF_NOT_FOCUSED,
1318     CAM_AF_INACTIVE
1319 } cam_autofocus_state_t;
1320 
1321 //Don't change the order of the AF states below. It should match
1322 //with the corresponding enum in frameworks (camera3.h and
1323 //CameraMetadata.java)
1324 typedef enum {
1325     CAM_AF_STATE_INACTIVE,
1326     CAM_AF_STATE_PASSIVE_SCAN,
1327     CAM_AF_STATE_PASSIVE_FOCUSED,
1328     CAM_AF_STATE_ACTIVE_SCAN,
1329     CAM_AF_STATE_FOCUSED_LOCKED,
1330     CAM_AF_STATE_NOT_FOCUSED_LOCKED,
1331     CAM_AF_STATE_PASSIVE_UNFOCUSED
1332 } cam_af_state_t;
1333 
1334 typedef struct {
1335     cam_af_state_t focus_state;           /* state of focus */
1336     cam_focus_distances_info_t focus_dist;       /* focus distance */
1337     cam_focus_mode_type focus_mode;        /* focus mode from backend */
1338     int32_t focus_pos;
1339     cam_af_flush_info_t flush_info;
1340 } cam_auto_focus_data_t;
1341 
1342 typedef struct {
1343     uint32_t stream_id;
1344     cam_rect_t crop;
1345     cam_rect_t roi_map;
1346 } cam_stream_crop_info_t;
1347 
1348 typedef struct {
1349     uint8_t num_of_streams;
1350     cam_stream_crop_info_t crop_info[MAX_NUM_STREAMS];
1351 } cam_crop_data_t;
1352 
1353 typedef struct {
1354     uint32_t stream_id;
1355     uint32_t cds_enable;
1356 } cam_stream_cds_info_t;
1357 
1358 typedef struct {
1359     uint8_t session_cds_enable;
1360     uint8_t num_of_streams;
1361     cam_stream_cds_info_t cds_info[MAX_NUM_STREAMS];
1362 } cam_cds_data_t;
1363 
1364 typedef enum {
1365     DO_NOT_NEED_FUTURE_FRAME,
1366     NEED_FUTURE_FRAME,
1367 } cam_prep_snapshot_state_t;
1368 
1369 #define CC_GAINS_COUNT  4
1370 
1371 typedef struct {
1372     float gains[CC_GAINS_COUNT];
1373 } cam_color_correct_gains_t;
1374 
1375 typedef struct {
1376     // If LED is ON and Burst Num > 1, this is first LED ON frame
1377     uint32_t min_frame_idx;
1378     // If LED is ON and Burst Num > 1, this is first LED Off frame after ON
1379     uint32_t max_frame_idx;
1380     // Used only when LED Is ON and burst num > 1
1381     uint32_t num_led_on_frames;
1382     // Skip count after LED is turned OFF
1383     uint32_t frame_skip_count;
1384     // Batch id for each picture request
1385     uint32_t config_batch_idx;
1386 } cam_frame_idx_range_t;
1387 
1388 typedef enum {
1389   S_NORMAL = 0,
1390   S_SCENERY,
1391   S_PORTRAIT,
1392   S_PORTRAIT_BACKLIGHT,
1393   S_SCENERY_BACKLIGHT,
1394   S_BACKLIGHT,
1395   S_HDR,
1396   S_MAX_DEFAULT,
1397   S_CUSTOM0 = S_MAX_DEFAULT,
1398   S_CUSTOM1,
1399   S_CUSTOM2,
1400   S_CUSTOM3,
1401   S_CUSTOM4,
1402   S_CUSTOM5,
1403   S_CUSTOM6,
1404   S_CUSTOM7,
1405   S_CUSTOM8,
1406   S_CUSTOM9,
1407   S_MAX,
1408 } cam_auto_scene_t;
1409 
1410 typedef struct {
1411   uint32_t is_hdr_scene;
1412   float    hdr_confidence;
1413 } cam_asd_hdr_scene_data_t;
1414 
1415 typedef struct {
1416   uint32_t          detected;
1417   float             confidence;
1418   uint32_t          auto_compensation;
1419 } cam_asd_scene_info_t;
1420 
1421 typedef struct {
1422   cam_auto_scene_t      detected_scene;
1423   uint8_t               max_n_scenes;
1424   cam_asd_scene_info_t  scene_info[S_MAX];
1425 } cam_asd_decision_t;
1426 
1427 
1428 typedef struct {
1429    uint32_t meta_frame_id;
1430 } cam_meta_valid_t;
1431 
1432 typedef enum {
1433     CAM_SENSOR_RAW,
1434     CAM_SENSOR_YUV,
1435     CAM_SENSOR_MONO
1436 } cam_sensor_t;
1437 
1438 typedef struct {
1439     cam_flash_mode_t flash_mode;
1440     float            aperture_value;
1441     cam_flash_state_t        flash_state;
1442     float            focal_length;
1443     float            f_number;
1444     int32_t          sensing_method;
1445     float            crop_factor;
1446     cam_sensor_t sens_type;
1447 } cam_sensor_params_t;
1448 
1449 typedef enum {
1450     CAM_METERING_MODE_UNKNOWN = 0,
1451     CAM_METERING_MODE_AVERAGE = 1,
1452     CAM_METERING_MODE_CENTER_WEIGHTED_AVERAGE = 2,
1453     CAM_METERING_MODE_SPOT = 3,
1454     CAM_METERING_MODE_MULTI_SPOT = 4,
1455     CAM_METERING_MODE_PATTERN = 5,
1456     CAM_METERING_MODE_PARTIAL = 6,
1457     CAM_METERING_MODE_OTHER = 255,
1458 } cam_metering_mode_t;
1459 
1460 typedef struct {
1461     float exp_time;
1462     int32_t iso_value;
1463     uint32_t flash_needed;
1464     uint32_t settled;
1465     cam_wb_mode_type wb_mode;
1466     uint32_t metering_mode;
1467     uint32_t exposure_program;
1468     uint32_t exposure_mode;
1469     uint32_t scenetype;
1470     float brightness;
1471     float est_snap_exp_time;
1472     int32_t est_snap_iso_value;
1473     uint32_t est_snap_luma;
1474     uint32_t est_snap_target;
1475 } cam_3a_params_t;
1476 
1477 typedef struct {
1478     uint64_t sw_version_number;
1479     int32_t aec_debug_data_size;
1480     char aec_private_debug_data[AEC_DEBUG_DATA_SIZE];
1481 } cam_ae_exif_debug_t;
1482 
1483 typedef struct {
1484     int8_t awb_ccm_enable;
1485     int8_t hard_awb_ccm_flag;
1486     int8_t ccm_update_flag;
1487     float  ccm[AWB_NUM_CCM_ROWS][AWB_NUM_CCM_COLS];
1488     float  ccm_offset[AWB_NUM_CCM_ROWS];
1489 } cam_awb_ccm_update_t;
1490 
1491 typedef struct {
1492     int32_t cct_value;
1493     cam_awb_gain_t rgb_gains;
1494     cam_awb_ccm_update_t ccm_update;
1495 } cam_awb_params_t;
1496 
1497 typedef struct {
1498     int32_t awb_debug_data_size;
1499     char awb_private_debug_data[AWB_DEBUG_DATA_SIZE];
1500 } cam_awb_exif_debug_t;
1501 
1502 typedef struct {
1503     int32_t af_debug_data_size;
1504     int32_t haf_debug_data_size;
1505     int32_t tof_debug_data_size;
1506     int32_t dciaf_debug_data_size;
1507     int32_t pdaf_debug_data_size;
1508     char af_private_debug_data[AF_DEBUG_DATA_SIZE];
1509     int32_t af_stats_buffer_size;
1510     char af_stats_private_debug_data[AF_STATS_DEBUG_DATA_SIZE];
1511 } cam_af_exif_debug_t;
1512 
1513 typedef struct {
1514     int32_t asd_debug_data_size;
1515     char asd_private_debug_data[ASD_DEBUG_DATA_SIZE];
1516 } cam_asd_exif_debug_t;
1517 
1518 typedef struct {
1519     int32_t bg_stats_buffer_size;
1520     int32_t bhist_stats_buffer_size;
1521     int32_t bg_config_buffer_size;
1522     char stats_buffer_private_debug_data[STATS_BUFFER_DEBUG_DATA_SIZE];
1523 } cam_stats_buffer_exif_debug_t;
1524 
1525 /* 3A version*/
1526 typedef struct {
1527     uint16_t major_version;
1528     uint16_t minor_version;
1529     uint16_t patch_version;
1530     uint16_t new_feature_des;
1531 } cam_q3a_version_t;
1532 
1533 typedef struct {
1534     uint32_t tuning_data_version;
1535     size_t tuning_sensor_data_size;
1536     size_t tuning_vfe_data_size;
1537     size_t tuning_cpp_data_size;
1538     size_t tuning_cac_data_size;
1539     size_t tuning_cac_data_size2;
1540     size_t tuning_mod3_data_size;
1541     uint8_t  data[TUNING_DATA_MAX];
1542 }tuning_params_t;
1543 
1544 typedef struct {
1545     int32_t event_type;
1546     cam_dimension_t dim;
1547     size_t size;
1548     char path[QCAMERA_MAX_FILEPATH_LENGTH];
1549     cam_format_t picture_format;
1550 } cam_int_evt_params_t;
1551 
1552 typedef struct {
1553   uint8_t private_isp_data[MAX_ISP_DATA_SIZE];
1554 } cam_chromatix_lite_isp_t;
1555 
1556 typedef struct {
1557   uint8_t private_pp_data[MAX_PP_DATA_SIZE];
1558 } cam_chromatix_lite_pp_t;
1559 
1560 typedef struct {
1561   uint8_t private_stats_data[MAX_AE_STATS_DATA_SIZE];
1562 } cam_chromatix_lite_ae_stats_t;
1563 
1564 typedef struct {
1565   uint8_t private_stats_data[MAX_AWB_STATS_DATA_SIZE];
1566 } cam_chromatix_lite_awb_stats_t;
1567 
1568 typedef struct {
1569   uint8_t private_stats_data[MAX_AF_STATS_DATA_SIZE];
1570 } cam_chromatix_lite_af_stats_t;
1571 
1572 typedef struct {
1573   uint8_t private_stats_data[MAX_ASD_STATS_DATA_SIZE];
1574 } cam_chromatix_lite_asd_stats_t;
1575 
1576 typedef struct {
1577    uint32_t min_buffers;
1578    uint32_t max_buffers;
1579 } cam_buffer_info_t;
1580 
1581 typedef struct {
1582     cam_dimension_t stream_sizes[MAX_NUM_STREAMS];
1583     uint32_t num_streams;
1584     cam_stream_type_t type[MAX_NUM_STREAMS];
1585     uint32_t postprocess_mask[MAX_NUM_STREAMS];
1586     cam_buffer_info_t buffer_info;
1587     cam_is_type_t is_type;
1588     cam_hfr_mode_t hfr_mode;
1589     cam_format_t format[MAX_NUM_STREAMS];
1590     uint32_t buf_alignment;
1591     uint32_t min_stride;
1592     uint32_t min_scanline;
1593     uint8_t batch_size;
1594 } cam_stream_size_info_t;
1595 
1596 
1597 typedef enum {
1598     CAM_INTF_OVERWRITE_MINI_CHROMATIX_OFFLINE,
1599     CAM_INTF_OVERWRITE_ISP_HW_DATA_OFFLINE,
1600     CAM_INTF_OVERWRITE_MINI_CHROMATIX_ONLINE,
1601     CAM_INTF_OVERWRITE_ISP_HW_DATA_ONLINE,
1602     CAM_INTF_OVERWRITE_MAX,
1603 } cam_intf_overwrite_type_t;
1604 
1605 typedef struct {
1606   uint8_t lds_enabled;
1607   float rnr_sampling_factor;
1608 } cam_img_hysterisis_info_t;
1609 
1610 typedef struct {
1611   /* dynamic feature enablement */
1612   uint64_t dyn_feature_mask;
1613   /* input frame count for stacking */
1614   uint32_t input_count;
1615   /* reserved for future use */
1616   uint8_t  reserved[32];
1617 } cam_dyn_img_data_t;
1618 
1619 typedef struct {
1620   cam_intf_overwrite_type_t overwrite_type;
1621   char isp_hw_data_list[4096];     /*add upper bound memory, customer to fill*/
1622   char chromatix_data_overwrite[4096]; /*add bound memory, customer fill*/
1623 } cam_hw_data_overwrite_t;
1624 
1625 typedef struct {
1626     uint32_t num_streams;
1627     uint32_t streamID[MAX_NUM_STREAMS];
1628 } cam_stream_ID_t;
1629 
1630 /*CAC Message posted during pipeline*/
1631 typedef struct {
1632     uint32_t frame_id;
1633     int32_t buf_idx;
1634 } cam_cac_info_t;
1635 
1636 typedef struct
1637 {
1638   uint32_t id;            /* Frame ID */
1639   uint64_t timestamp;    /* Time stamp */
1640   uint32_t distance_in_mm; /* Distance of object in ROI's in milimeters */
1641   uint32_t confidence;     /* Confidence on distance from 0(No confidence)to 1024(max) */
1642   uint32_t status;        /* Status of DCRF library execution call */
1643   cam_rect_t focused_roi; /* ROI's for which distance is estimated */
1644   uint32_t focused_x;     /* Focus location X inside ROI with distance estimation */
1645   uint32_t focused_y;     /* Focus location Y inside ROI with distance estimation */
1646 } cam_dcrf_result_t;
1647 
1648 typedef struct {
1649     uint32_t frame_id;
1650     uint32_t num_streams;
1651     uint32_t stream_id[MAX_NUM_STREAMS];
1652 } cam_buf_divert_info_t;
1653 
1654 typedef  struct {
1655     uint8_t is_stats_valid;               /* if histgram data is valid */
1656     cam_hist_stats_t stats_data;          /* histogram data */
1657 
1658     uint8_t is_faces_valid;               /* if face detection data is valid */
1659     cam_face_detection_data_t faces_data; /* face detection result */
1660 
1661     uint8_t is_focus_valid;               /* if focus data is valid */
1662     cam_auto_focus_data_t focus_data;     /* focus data */
1663 
1664     uint8_t is_crop_valid;                /* if crop data is valid */
1665     cam_crop_data_t crop_data;            /* crop data */
1666 
1667     uint8_t is_prep_snapshot_done_valid;  /* if prep snapshot done is valid */
1668     cam_prep_snapshot_state_t prep_snapshot_done_state;  /* prepare snapshot done state */
1669 
1670     uint8_t is_cac_valid;                 /* if cac info is valid */
1671     cam_cac_info_t cac_info;              /* cac info */
1672 
1673     /* Hysterisis data from Img modules */
1674     uint8_t is_hyst_info_valid;           /* if hyst info is valid */
1675     cam_img_hysterisis_info_t img_hyst_info; /* hyst info */
1676 
1677     /* if good frame idx range is valid */
1678     uint8_t is_good_frame_idx_range_valid;
1679     /* good frame idx range, make sure:
1680      * 1. good_frame_idx_range.min_frame_idx > current_frame_idx
1681      * 2. good_frame_idx_range.min_frame_idx - current_frame_idx < 100 */
1682     cam_frame_idx_range_t good_frame_idx_range;
1683 
1684     cam_asd_decision_t cam_asd_info;
1685 
1686     char private_metadata[MAX_METADATA_PRIVATE_PAYLOAD_SIZE_IN_BYTES];
1687 
1688     /* AE parameters */
1689     uint8_t is_3a_params_valid;
1690     cam_3a_params_t cam_3a_params;
1691 
1692     /* AE exif debug parameters */
1693     uint8_t is_ae_exif_debug_valid;
1694     cam_ae_exif_debug_t ae_exif_debug_params;
1695 
1696     /* AWB exif debug parameters */
1697     uint8_t is_awb_exif_debug_valid;
1698     cam_awb_exif_debug_t awb_exif_debug_params;
1699 
1700     /* AF exif debug parameters */
1701     uint8_t is_af_exif_debug_valid;
1702     cam_af_exif_debug_t af_exif_debug_params;
1703 
1704     /* ASD exif debug parameters */
1705     uint8_t is_asd_exif_debug_valid;
1706     cam_asd_exif_debug_t asd_exif_debug_params;
1707 
1708     /* Stats buffer exif debug parameters */
1709     uint8_t is_stats_buffer_exif_debug_valid;
1710     cam_stats_buffer_exif_debug_t stats_buffer_exif_debug_params;
1711 
1712     /* AWB parameters */
1713     uint8_t is_awb_params_valid;
1714     cam_awb_params_t awb_params;
1715 
1716     /* sensor parameters */
1717     uint8_t is_sensor_params_valid;
1718     cam_sensor_params_t sensor_params;
1719 
1720     /* Meta valid params */
1721     uint8_t is_meta_valid;
1722     cam_meta_valid_t meta_valid_params;
1723 
1724     /*Tuning Data*/
1725     uint8_t is_tuning_params_valid;
1726     tuning_params_t tuning_params;
1727 
1728     uint8_t is_chromatix_lite_isp_valid;
1729     cam_chromatix_lite_isp_t chromatix_lite_isp_data;
1730 
1731     uint8_t is_chromatix_lite_pp_valid;
1732     cam_chromatix_lite_pp_t chromatix_lite_pp_data;
1733 
1734     uint8_t is_chromatix_lite_ae_stats_valid;
1735     cam_chromatix_lite_ae_stats_t chromatix_lite_ae_stats_data;
1736 
1737     uint8_t is_chromatix_lite_awb_stats_valid;
1738     cam_chromatix_lite_awb_stats_t chromatix_lite_awb_stats_data;
1739 
1740     uint8_t is_chromatix_lite_af_stats_valid;
1741     cam_chromatix_lite_af_stats_t chromatix_lite_af_stats_data;
1742 
1743     uint8_t is_dcrf_result_valid;
1744     cam_dcrf_result_t dcrf_result;
1745 
1746     /* Dynamic feature enablement from postprocessing modules */
1747     uint8_t is_dyn_img_data_valid;
1748     cam_dyn_img_data_t dyn_img_data;
1749 
1750 } cam_metadata_info_t;
1751 
1752 typedef enum {
1753     CAM_INTF_PARM_HAL_VERSION = 0x1,
1754 
1755     /* Overall mode of 3A control routines. We need to have this parameter
1756      * because not all android.control.* have an OFF option, for example,
1757      * AE_FPS_Range, aePrecaptureTrigger */
1758     CAM_INTF_META_MODE,
1759     /* Whether AE is currently updating the sensor exposure and sensitivity
1760      * fields */
1761     CAM_INTF_META_AEC_MODE,
1762     CAM_INTF_PARM_WHITE_BALANCE,
1763     CAM_INTF_PARM_FOCUS_MODE,
1764 
1765     /* common between HAL1 and HAL3 */
1766     CAM_INTF_PARM_ANTIBANDING,
1767     CAM_INTF_PARM_EXPOSURE_COMPENSATION,
1768     CAM_INTF_PARM_EV_STEP,
1769     CAM_INTF_PARM_AEC_LOCK,
1770     CAM_INTF_PARM_FPS_RANGE, /* 10 */
1771     CAM_INTF_PARM_AWB_LOCK,
1772     CAM_INTF_PARM_EFFECT,
1773     CAM_INTF_PARM_BESTSHOT_MODE,
1774     CAM_INTF_PARM_DIS_ENABLE,
1775     CAM_INTF_PARM_LED_MODE,
1776     CAM_INTF_META_HISTOGRAM,
1777     CAM_INTF_META_FACE_DETECTION,
1778     /* Whether optical image stabilization is enabled. */
1779     CAM_INTF_META_LENS_OPT_STAB_MODE,
1780     /* specific to HAl1 */
1781     CAM_INTF_META_AUTOFOCUS_DATA,
1782     CAM_INTF_PARM_QUERY_FLASH4SNAP, /* 20 */
1783     CAM_INTF_PARM_EXPOSURE,
1784     CAM_INTF_PARM_SHARPNESS,
1785     CAM_INTF_PARM_CONTRAST,
1786     CAM_INTF_PARM_SATURATION,
1787     CAM_INTF_PARM_BRIGHTNESS,
1788     CAM_INTF_PARM_ISO,
1789     CAM_INTF_PARM_ZOOM,
1790     CAM_INTF_PARM_ROLLOFF,
1791     CAM_INTF_PARM_MODE,             /* camera mode */
1792     CAM_INTF_PARM_AEC_ALGO_TYPE, /* 30 */ /* auto exposure algorithm */
1793     CAM_INTF_PARM_FOCUS_ALGO_TYPE,  /* focus algorithm */
1794     CAM_INTF_PARM_AEC_ROI,
1795     CAM_INTF_PARM_AF_ROI,
1796     CAM_INTF_PARM_SCE_FACTOR,
1797     CAM_INTF_PARM_FD,
1798     CAM_INTF_PARM_MCE,
1799     CAM_INTF_PARM_HFR,
1800     CAM_INTF_PARM_REDEYE_REDUCTION,
1801     CAM_INTF_PARM_WAVELET_DENOISE,
1802     CAM_INTF_PARM_TEMPORAL_DENOISE, /* 40 */
1803     CAM_INTF_PARM_HISTOGRAM,
1804     CAM_INTF_PARM_ASD_ENABLE,
1805     CAM_INTF_PARM_RECORDING_HINT,
1806     CAM_INTF_PARM_HDR,
1807     CAM_INTF_PARM_MAX_DIMENSION,
1808     CAM_INTF_PARM_RAW_DIMENSION,
1809     CAM_INTF_PARM_FRAMESKIP,
1810     CAM_INTF_PARM_ZSL_MODE,  /* indicating if it's running in ZSL mode */
1811     CAM_INTF_PARM_BURST_NUM,
1812     CAM_INTF_PARM_RETRO_BURST_NUM, /* 50 */
1813     CAM_INTF_PARM_BURST_LED_ON_PERIOD,
1814     CAM_INTF_PARM_HDR_NEED_1X, /* if HDR needs 1x output */
1815     CAM_INTF_PARM_LOCK_CAF,
1816     CAM_INTF_PARM_VIDEO_HDR,
1817     CAM_INTF_PARM_SENSOR_HDR,
1818     CAM_INTF_PARM_ROTATION,
1819     CAM_INTF_PARM_SCALE,
1820     CAM_INTF_PARM_VT, /* indicating if it's a Video Call Apllication */
1821     CAM_INTF_META_CROP_DATA,
1822     CAM_INTF_META_PREP_SNAPSHOT_DONE, /* 60 */
1823     CAM_INTF_META_GOOD_FRAME_IDX_RANGE,
1824     CAM_INTF_META_ASD_HDR_SCENE_DATA,
1825     CAM_INTF_META_ASD_SCENE_INFO,
1826     CAM_INTF_META_CURRENT_SCENE,
1827     CAM_INTF_META_AEC_INFO,
1828     CAM_INTF_META_SENSOR_INFO,
1829     CAM_INTF_META_CHROMATIX_LITE_ISP,
1830     CAM_INTF_META_CHROMATIX_LITE_PP,
1831     CAM_INTF_META_CHROMATIX_LITE_AE,
1832     CAM_INTF_META_CHROMATIX_LITE_AWB, /* 70 */
1833     CAM_INTF_META_CHROMATIX_LITE_AF,
1834     CAM_INTF_META_CHROMATIX_LITE_ASD,
1835     CAM_INTF_META_EXIF_DEBUG_AE,
1836     CAM_INTF_META_EXIF_DEBUG_AWB,
1837     CAM_INTF_META_EXIF_DEBUG_AF,
1838     CAM_INTF_META_EXIF_DEBUG_ASD,
1839     CAM_INTF_META_EXIF_DEBUG_STATS,
1840     CAM_INTF_PARM_GET_CHROMATIX,
1841     CAM_INTF_PARM_SET_RELOAD_CHROMATIX,
1842     CAM_INTF_PARM_SET_AUTOFOCUSTUNING, /* 80 */
1843     CAM_INTF_PARM_GET_AFTUNE,
1844     CAM_INTF_PARM_SET_RELOAD_AFTUNE,
1845     CAM_INTF_PARM_SET_VFE_COMMAND,
1846     CAM_INTF_PARM_SET_PP_COMMAND,
1847     CAM_INTF_PARM_TINTLESS,
1848     CAM_INTF_PARM_LONGSHOT_ENABLE,
1849     CAM_INTF_PARM_RDI_MODE,
1850     CAM_INTF_PARM_CDS_MODE,
1851     CAM_INTF_PARM_TONE_MAP_MODE,
1852     CAM_INTF_PARM_CAPTURE_FRAME_CONFIG, /* 90 */
1853     CAM_INTF_PARM_DUAL_LED_CALIBRATION,
1854     CAM_INTF_PARM_ADV_CAPTURE_MODE,
1855 
1856     /* stream based parameters */
1857     CAM_INTF_PARM_DO_REPROCESS,
1858     CAM_INTF_PARM_SET_BUNDLE,
1859     CAM_INTF_PARM_STREAM_FLIP,
1860     CAM_INTF_PARM_GET_OUTPUT_CROP,
1861 
1862     CAM_INTF_PARM_EZTUNE_CMD,
1863     CAM_INTF_PARM_INT_EVT,
1864 
1865     /* specific to HAL3 */
1866     /* Whether the metadata maps to a valid frame number */
1867     CAM_INTF_META_FRAME_NUMBER_VALID,
1868     /* Whether the urgent metadata maps to a valid frame number */
1869     CAM_INTF_META_URGENT_FRAME_NUMBER_VALID,
1870     /* Whether the stream buffer corresponding this frame is dropped or not */
1871     CAM_INTF_META_FRAME_DROPPED, /* 100 */
1872     /* COLOR CORRECTION.*/
1873     CAM_INTF_META_COLOR_CORRECT_MODE,
1874     /* A transform matrix to chromatically adapt pixels in the CIE XYZ (1931)
1875      * color space from the scene illuminant to the sRGB-standard D65-illuminant. */
1876     CAM_INTF_META_COLOR_CORRECT_TRANSFORM,
1877     /*Color channel gains in the Bayer raw domain in the order [RGeGoB]*/
1878     CAM_INTF_META_COLOR_CORRECT_GAINS,
1879     /*The best fit color transform matrix calculated by the stats*/
1880     CAM_INTF_META_PRED_COLOR_CORRECT_TRANSFORM,
1881     /*The best fit color channels gains calculated by the stats*/
1882     CAM_INTF_META_PRED_COLOR_CORRECT_GAINS,
1883     /* CONTROL */
1884     /* A frame counter set by the framework. Must be maintained unchanged in
1885      * output frame. */
1886     CAM_INTF_META_FRAME_NUMBER,
1887     /* A frame counter set by the framework. Must be maintained unchanged in
1888      * output frame. */
1889     CAM_INTF_META_URGENT_FRAME_NUMBER,
1890     /*Number of streams and size of streams in current configuration*/
1891     CAM_INTF_META_STREAM_INFO,
1892     /* List of areas to use for metering */
1893     CAM_INTF_META_AEC_ROI,
1894     /* Whether the HAL must trigger precapture metering.*/
1895     CAM_INTF_META_AEC_PRECAPTURE_TRIGGER, /* 110 */
1896     /* The ID sent with the latest CAMERA2_TRIGGER_PRECAPTURE_METERING call */
1897     /* Current state of AE algorithm */
1898     CAM_INTF_META_AEC_STATE,
1899     /* List of areas to use for focus estimation */
1900     CAM_INTF_META_AF_ROI,
1901     /* Whether the HAL must trigger autofocus. */
1902     CAM_INTF_META_AF_TRIGGER,
1903     /* Current state of AF algorithm */
1904     CAM_INTF_META_AF_STATE,
1905     /* List of areas to use for illuminant estimation */
1906     CAM_INTF_META_AWB_REGIONS,
1907     /* Current state of AWB algorithm */
1908     CAM_INTF_META_AWB_STATE,
1909     /*Whether black level compensation is frozen or free to vary*/
1910     CAM_INTF_META_BLACK_LEVEL_LOCK,
1911     /* Information to 3A routines about the purpose of this capture, to help
1912      * decide optimal 3A strategy */
1913     CAM_INTF_META_CAPTURE_INTENT,
1914     /* DEMOSAIC */
1915     /* Controls the quality of the demosaicing processing */
1916     CAM_INTF_META_DEMOSAIC,
1917     /* EDGE */
1918     /* Operation mode for edge enhancement */
1919     CAM_INTF_META_EDGE_MODE, /* 120 */
1920     /* Control the amount of edge enhancement applied to the images.*/
1921     /* 1-10; 10 is maximum sharpening */
1922     CAM_INTF_META_SHARPNESS_STRENGTH,
1923     /* FLASH */
1924     /* Power for flash firing/torch, 10 is max power; 0 is no flash. Linear */
1925     CAM_INTF_META_FLASH_POWER,
1926     /* Firing time of flash relative to start of exposure, in nanoseconds*/
1927     CAM_INTF_META_FLASH_FIRING_TIME,
1928     /* Current state of the flash unit */
1929     CAM_INTF_META_FLASH_STATE,
1930     /* GEOMETRIC */
1931     /* Operating mode of geometric correction */
1932     CAM_INTF_META_GEOMETRIC_MODE,
1933     /* Control the amount of shading correction applied to the images */
1934     CAM_INTF_META_GEOMETRIC_STRENGTH,
1935     /* HOT PIXEL */
1936     /* Set operational mode for hot pixel correction */
1937     CAM_INTF_META_HOTPIXEL_MODE,
1938     /* LENS */
1939     /* Size of the lens aperture */
1940     CAM_INTF_META_LENS_APERTURE,
1941     /* State of lens neutral density filter(s) */
1942     CAM_INTF_META_LENS_FILTERDENSITY,
1943     /* Lens optical zoom setting */
1944     CAM_INTF_META_LENS_FOCAL_LENGTH, /* 130 */
1945     /* Distance to plane of sharpest focus, measured from frontmost surface
1946      * of the lens */
1947     CAM_INTF_META_LENS_FOCUS_DISTANCE,
1948     /* The range of scene distances that are in sharp focus (depth of field) */
1949     CAM_INTF_META_LENS_FOCUS_RANGE,
1950     /*Whether the hal needs to output the lens shading map*/
1951     CAM_INTF_META_LENS_SHADING_MAP_MODE,
1952     /* Current lens status */
1953     CAM_INTF_META_LENS_STATE,
1954     /* NOISE REDUCTION */
1955     /* Mode of operation for the noise reduction algorithm */
1956     CAM_INTF_META_NOISE_REDUCTION_MODE,
1957    /* Control the amount of noise reduction applied to the images.
1958     * 1-10; 10 is max noise reduction */
1959     CAM_INTF_META_NOISE_REDUCTION_STRENGTH,
1960     /* SCALER */
1961     /* Top-left corner and width of the output region to select from the active
1962      * pixel array */
1963     CAM_INTF_META_SCALER_CROP_REGION,
1964     /* The estimated scene illumination lighting frequency */
1965     CAM_INTF_META_SCENE_FLICKER,
1966     /* SENSOR */
1967     /* Duration each pixel is exposed to light, in nanoseconds */
1968     CAM_INTF_META_SENSOR_EXPOSURE_TIME,
1969     /* Duration from start of frame exposure to start of next frame exposure,
1970      * in nanoseconds */
1971     CAM_INTF_META_SENSOR_FRAME_DURATION, /* 140 */
1972     /* Gain applied to image data. Must be implemented through analog gain only
1973      * if set to values below 'maximum analog sensitivity'. */
1974     CAM_INTF_META_SENSOR_SENSITIVITY,
1975     /* Time at start of exposure of first row */
1976     CAM_INTF_META_SENSOR_TIMESTAMP,
1977     /* Duration b/w start of first row exposure and the start of last
1978        row exposure in nanoseconds */
1979     CAM_INTF_META_SENSOR_ROLLING_SHUTTER_SKEW,
1980     /* SHADING */
1981     /* Quality of lens shading correction applied to the image data */
1982     CAM_INTF_META_SHADING_MODE,
1983     /* Control the amount of shading correction applied to the images.
1984      * unitless: 1-10; 10 is full shading compensation */
1985     CAM_INTF_META_SHADING_STRENGTH,
1986     /* STATISTICS */
1987     /* State of the face detector unit */
1988     CAM_INTF_META_STATS_FACEDETECT_MODE,
1989     /* Operating mode for histogram generation */
1990     CAM_INTF_META_STATS_HISTOGRAM_MODE,
1991     /* Operating mode for sharpness map generation */
1992     CAM_INTF_META_STATS_SHARPNESS_MAP_MODE,
1993     /* A 3-channel sharpness map, based on the raw sensor data,
1994      * If only a monochrome sharpness map is supported, all channels
1995      * should have the same data
1996      */
1997     CAM_INTF_META_STATS_SHARPNESS_MAP,
1998 
1999     /* TONEMAP */
2000     /* Tone map mode */
2001     CAM_INTF_META_TONEMAP_MODE, /* 150 */
2002     /* Table mapping RGB input values to output values */
2003     CAM_INTF_META_TONEMAP_CURVES,
2004 
2005     CAM_INTF_META_FLASH_MODE,
2006     /* 2D array of gain factors for each color channel that was used to
2007      * compensate for lens shading for this frame */
2008     CAM_INTF_META_LENS_SHADING_MAP,
2009     CAM_INTF_META_PRIVATE_DATA,
2010     CAM_INTF_PARM_STATS_DEBUG_MASK,
2011     CAM_INTF_PARM_STATS_AF_PAAF,
2012     /* Indicates streams ID of all the requested buffers */
2013     CAM_INTF_META_STREAM_ID,
2014     CAM_INTF_PARM_FOCUS_BRACKETING,
2015     CAM_INTF_PARM_FLASH_BRACKETING,
2016     CAM_INTF_PARM_GET_IMG_PROP, /* 160 */
2017     CAM_INTF_META_JPEG_GPS_COORDINATES,
2018     CAM_INTF_META_JPEG_GPS_PROC_METHODS,
2019     CAM_INTF_META_JPEG_GPS_TIMESTAMP,
2020     CAM_INTF_META_JPEG_ORIENTATION,
2021     CAM_INTF_META_JPEG_QUALITY,
2022     CAM_INTF_META_JPEG_THUMB_QUALITY,
2023     CAM_INTF_META_JPEG_THUMB_SIZE,
2024 
2025     CAM_INTF_META_TEST_PATTERN_DATA,
2026     /* DNG file support */
2027     CAM_INTF_META_PROFILE_TONE_CURVE,
2028     CAM_INTF_META_NEUTRAL_COL_POINT, /* 170 */
2029 
2030     /* CAC */
2031     CAM_INTF_META_CAC_INFO,
2032     CAM_INTF_PARM_CAC,
2033     CAM_INTF_META_IMG_HYST_INFO,
2034 
2035     /* trigger for all modules to read the debug/log level properties */
2036     CAM_INTF_PARM_UPDATE_DEBUG_LEVEL,
2037 
2038     /* OTP : WB gr/gb */
2039     CAM_INTF_META_OTP_WB_GRGB,
2040     /* LED override for EZTUNE */
2041     CAM_INTF_META_LED_MODE_OVERRIDE,
2042     /* auto lens position info */
2043     CAM_INTF_META_FOCUS_POSITION,
2044     /* Manual exposure time */
2045     CAM_INTF_PARM_EXPOSURE_TIME,
2046     /* AWB meta data info */
2047     CAM_INTF_META_AWB_INFO,
2048     /* Manual lens position info */
2049     CAM_INTF_PARM_MANUAL_FOCUS_POS, /* 180 */
2050     /* Manual White balance gains */
2051     CAM_INTF_PARM_WB_MANUAL,
2052     /* Offline Data Overwrite */
2053     CAM_INTF_PARM_HW_DATA_OVERWRITE,
2054     /* IMG LIB reprocess debug section */
2055     CAM_INTF_META_IMGLIB, /* cam_intf_meta_imglib_t */
2056     /* OEM specific parameters */
2057     CAM_INTF_PARM_CUSTOM,
2058     /* parameters added for related cameras */
2059     /* fetch calibration info for related cam subsystem */
2060     CAM_INTF_PARM_RELATED_SENSORS_CALIBRATION,
2061     /* focal length ratio info */
2062     CAM_INTF_META_AF_FOCAL_LENGTH_RATIO,
2063     /* crop for binning & FOV adjust */
2064     CAM_INTF_META_SNAP_CROP_INFO_SENSOR,
2065     /* crop for trimming edge pixels */
2066     CAM_INTF_META_SNAP_CROP_INFO_CAMIF,
2067     /* crop for FOV adjust and zoom */
2068     CAM_INTF_META_SNAP_CROP_INFO_ISP,
2069     /* crop for image-stabilization and zoom */
2070     CAM_INTF_META_SNAP_CROP_INFO_CPP, /* 190 */
2071     /* parameter for enabling DCRF */
2072     CAM_INTF_PARM_DCRF,
2073     /* metadata tag for DCRF info */
2074     CAM_INTF_META_DCRF,
2075     /* FLIP mode parameter*/
2076     CAM_INTF_PARM_FLIP,
2077     /*Frame divert info from ISP*/
2078     CAM_INTF_BUF_DIVERT_INFO,
2079     /* Use AV timer */
2080     CAM_INTF_META_USE_AV_TIMER,
2081     CAM_INTF_META_EFFECTIVE_EXPOSURE_FACTOR,
2082     /* Special event to request stream frames*/
2083     CAM_INTF_PARM_REQUEST_FRAMES,
2084     /* Special event to request operational mode*/
2085     CAM_INTF_PARM_REQUEST_OPS_MODE,
2086     /*Black level parameters*/
2087     CAM_INTF_META_LDAF_EXIF,
2088     CAM_INTF_META_BLACK_LEVEL_SOURCE_PATTERN,
2089     CAM_INTF_META_BLACK_LEVEL_APPLIED_PATTERN, /* 200 */
2090     CAM_INTF_META_CDS_DATA,
2091     /*3A low light level information*/
2092     CAM_INTF_META_LOW_LIGHT,
2093     /* dynamic feature detection */
2094     CAM_INTF_META_IMG_DYN_FEAT, /* 200 */
2095     /*Parameter entry to communicate manual
2096     capture type*/
2097     CAM_INTF_PARM_MANUAL_CAPTURE_TYPE,
2098     /*AF state change detected by AF module*/
2099     CAM_INTF_AF_STATE_TRANSITION,
2100     /* face recognition */
2101     CAM_INTF_META_FACE_RECOG,
2102     /* face blink detection */
2103     CAM_INTF_META_FACE_BLINK,
2104     /* face gaze detection */
2105     CAM_INTF_META_FACE_GAZE,
2106     /* face smile detection */
2107     CAM_INTF_META_FACE_SMILE,
2108     /* face landmark detection */
2109     CAM_INTF_META_FACE_LANDMARK, /* 210 */
2110     /* face contour detection */
2111     CAM_INTF_META_FACE_CONTOUR,
2112     /* Whether EIS is enabled */
2113     CAM_INTF_META_VIDEO_STAB_MODE,
2114     /* Touch exposure compensation (EV) status */
2115     CAM_INTF_META_TOUCH_AE_RESULT,
2116     /* Param for updating initial exposure index value*/
2117     CAM_INTF_PARM_INITIAL_EXPOSURE_INDEX,
2118     /* Gain applied post raw captrue.
2119        ISP digital gain */
2120     CAM_INTF_META_ISP_SENSITIVITY,
2121     /* Param for enabling instant aec*/
2122     CAM_INTF_PARM_INSTANT_AEC,
2123     CAM_INTF_PARM_MAX
2124 } cam_intf_parm_type_t;
2125 
2126 typedef struct {
2127     uint32_t forced;
2128     union {
2129       uint32_t force_linecount_value;
2130       float    force_gain_value;
2131       float    force_snap_exp_value;
2132       float    force_exp_value;
2133       uint32_t force_snap_linecount_value;
2134       float    force_snap_gain_value;
2135     } u;
2136 } cam_ez_force_params_t;
2137 
2138 typedef struct {
2139     float cam_black_level[4];
2140 } cam_black_level_metadata_t;
2141 
2142 typedef enum {
2143     CAM_EZTUNE_CMD_STATUS,
2144     CAM_EZTUNE_CMD_AEC_ENABLE,
2145     CAM_EZTUNE_CMD_AWB_ENABLE,
2146     CAM_EZTUNE_CMD_AF_ENABLE,
2147     CAM_EZTUNE_CMD_AEC_FORCE_LINECOUNT,
2148     CAM_EZTUNE_CMD_AEC_FORCE_GAIN,
2149     CAM_EZTUNE_CMD_AEC_FORCE_EXP,
2150     CAM_EZTUNE_CMD_AEC_FORCE_SNAP_LC,
2151     CAM_EZTUNE_CMD_AEC_FORCE_SNAP_GAIN,
2152     CAM_EZTUNE_CMD_AEC_FORCE_SNAP_EXP,
2153     CAM_EZTUNE_CMD_AWB_MODE,
2154     CAM_EZTUNE_CMD_AWB_FORCE_DUAL_LED_IDX,
2155 } cam_eztune_cmd_type_t;
2156 
2157 typedef struct {
2158   cam_eztune_cmd_type_t   cmd;
2159   union {
2160     int32_t running;
2161     int32_t aec_enable;
2162     int32_t awb_enable;
2163     int32_t af_enable;
2164     cam_ez_force_params_t ez_force_param;
2165     int32_t awb_mode;
2166     int32_t ez_force_dual_led_idx;
2167   } u;
2168 } cam_eztune_cmd_data_t;
2169 
2170 
2171 /*****************************************************************************
2172  *                 Code for HAL3 data types                                  *
2173  ****************************************************************************/
2174 typedef enum {
2175     CAM_INTF_METADATA_MAX
2176 } cam_intf_metadata_type_t;
2177 
2178 typedef enum {
2179     CAM_INTENT_CUSTOM,
2180     CAM_INTENT_PREVIEW,
2181     CAM_INTENT_STILL_CAPTURE,
2182     CAM_INTENT_VIDEO_RECORD,
2183     CAM_INTENT_VIDEO_SNAPSHOT,
2184     CAM_INTENT_ZERO_SHUTTER_LAG,
2185     CAM_INTENT_MAX,
2186 } cam_intent_t;
2187 
2188 typedef enum {
2189     /* Full application control of pipeline. All 3A routines are disabled,
2190      * no other settings in android.control.* have any effect */
2191     CAM_CONTROL_OFF,
2192     /* Use settings for each individual 3A routine. Manual control of capture
2193      * parameters is disabled. All controls in android.control.* besides sceneMode
2194      * take effect */
2195     CAM_CONTROL_AUTO,
2196     /* Use specific scene mode. Enabling this disables control.aeMode,
2197      * control.awbMode and control.afMode controls; the HAL must ignore those
2198      * settings while USE_SCENE_MODE is active (except for FACE_PRIORITY scene mode).
2199      * Other control entries are still active. This setting can only be used if
2200      * availableSceneModes != UNSUPPORTED. TODO: Should we remove this and handle this
2201      * in HAL ?*/
2202     CAM_CONTROL_USE_SCENE_MODE,
2203     CAM_CONTROL_MAX
2204 } cam_control_mode_t;
2205 
2206 typedef enum {
2207     /* Use the android.colorCorrection.transform matrix to do color conversion */
2208     CAM_COLOR_CORRECTION_TRANSFORM_MATRIX,
2209     /* Must not slow down frame rate relative to raw bayer output */
2210     CAM_COLOR_CORRECTION_FAST,
2211     /* Frame rate may be reduced by high quality */
2212     CAM_COLOR_CORRECTION_HIGH_QUALITY,
2213 } cam_color_correct_mode_t;
2214 
2215 typedef enum {
2216     CAM_COLOR_CORRECTION_ABERRATION_OFF,
2217     CAM_COLOR_CORRECTION_ABERRATION_FAST,
2218     CAM_COLOR_CORRECTION_ABERRATION_HIGH_QUALITY,
2219     CAM_COLOR_CORRECTION_ABERRATION_MAX
2220 } cam_aberration_mode_t;
2221 
2222 #define CC_MATRIX_ROWS 3
2223 #define CC_MATRIX_COLS 3
2224 
2225 typedef struct {
2226     /* 3x3 float matrix in row-major order. each element is in range of (0, 1) */
2227     cam_rational_type_t transform_matrix[CC_MATRIX_ROWS][CC_MATRIX_COLS];
2228 } cam_color_correct_matrix_t;
2229 
2230 #define CAM_FOCAL_LENGTHS_MAX     1
2231 #define CAM_APERTURES_MAX         1
2232 #define CAM_FILTER_DENSITIES_MAX  1
2233 #define CAM_MAX_MAP_HEIGHT        6
2234 #define CAM_MAX_MAP_WIDTH         6
2235 #define CAM_MAX_SHADING_MAP_WIDTH 17
2236 #define CAM_MAX_SHADING_MAP_HEIGHT 13
2237 #define CAM_MAX_TONEMAP_CURVE_SIZE    512
2238 #define CAM_MAX_FLASH_BRACKETING    5
2239 
2240 typedef struct {
2241     /* A 1D array of pairs of floats.
2242      * Mapping a 0-1 input range to a 0-1 output range.
2243      * The input range must be monotonically increasing with N,
2244      * and values between entries should be linearly interpolated.
2245      * For example, if the array is: [0.0, 0.0, 0.3, 0.5, 1.0, 1.0],
2246      * then the input->output mapping for a few sample points would be:
2247      * 0 -> 0, 0.15 -> 0.25, 0.3 -> 0.5, 0.5 -> 0.64 */
2248     float tonemap_points[CAM_MAX_TONEMAP_CURVE_SIZE][2];
2249 } cam_tonemap_curve_t;
2250 
2251 typedef struct {
2252    size_t tonemap_points_cnt;
2253    cam_tonemap_curve_t curves[3];
2254 } cam_rgb_tonemap_curves;
2255 
2256 typedef struct {
2257    size_t tonemap_points_cnt;
2258    cam_tonemap_curve_t curve;
2259 } cam_profile_tone_curve;
2260 
2261 #define NEUTRAL_COL_POINTS 3
2262 
2263 typedef struct {
2264     cam_rational_type_t neutral_col_point[NEUTRAL_COL_POINTS];
2265 } cam_neutral_col_point_t;
2266 
2267 typedef enum {
2268     OFF,
2269     FAST,
2270     QUALITY,
2271 } cam_quality_preference_t;
2272 
2273 typedef enum {
2274     CAM_FLASH_CTRL_OFF,
2275     CAM_FLASH_CTRL_SINGLE,
2276     CAM_FLASH_CTRL_TORCH
2277 } cam_flash_ctrl_t;
2278 
2279 typedef struct {
2280     uint8_t frame_dropped; /*  This flag indicates whether any stream buffer is dropped or not */
2281     cam_stream_ID_t cam_stream_ID; /* if dropped, Stream ID of dropped streams */
2282 } cam_frame_dropped_t;
2283 
2284 typedef struct {
2285     uint8_t ae_mode;
2286     uint8_t awb_mode;
2287     uint8_t af_mode;
2288 } cam_scene_mode_overrides_t;
2289 
2290 typedef struct {
2291     int32_t left;
2292     int32_t top;
2293     int32_t width;
2294     int32_t height;
2295 } cam_crop_region_t;
2296 
2297 typedef struct {
2298     /* Estimated sharpness for each region of the input image.
2299      * Normalized to be between 0 and maxSharpnessMapValue.
2300      * Higher values mean sharper (better focused) */
2301     int32_t sharpness[CAM_MAX_MAP_WIDTH][CAM_MAX_MAP_HEIGHT];
2302 } cam_sharpness_map_t;
2303 
2304 typedef struct {
2305    float lens_shading[4*CAM_MAX_SHADING_MAP_HEIGHT*CAM_MAX_SHADING_MAP_WIDTH];
2306 } cam_lens_shading_map_t;
2307 
2308 typedef struct {
2309     int32_t min_value;
2310     int32_t max_value;
2311     int32_t def_value;
2312     int32_t step;
2313 } cam_control_range_t;
2314 
2315 #define CAM_QCOM_FEATURE_NONE            0U
2316 #define CAM_QCOM_FEATURE_FACE_DETECTION (1U<<0)
2317 #define CAM_QCOM_FEATURE_DENOISE2D      (1U<<1)
2318 #define CAM_QCOM_FEATURE_CROP           (1U<<2)
2319 #define CAM_QCOM_FEATURE_ROTATION       (1U<<3)
2320 #define CAM_QCOM_FEATURE_FLIP           (1U<<4)
2321 #define CAM_QCOM_FEATURE_HDR            (1U<<5)
2322 #define CAM_QCOM_FEATURE_REGISTER_FACE  (1U<<6)
2323 #define CAM_QCOM_FEATURE_SHARPNESS      (1U<<7)
2324 #define CAM_QCOM_FEATURE_VIDEO_HDR      (1U<<8)
2325 #define CAM_QCOM_FEATURE_CAC            (1U<<9)
2326 #define CAM_QCOM_FEATURE_SCALE          (1U<<10)
2327 #define CAM_QCOM_FEATURE_EFFECT         (1U<<11)
2328 #define CAM_QCOM_FEATURE_UBIFOCUS       (1U<<12)
2329 #define CAM_QCOM_FEATURE_CHROMA_FLASH   (1U<<13)
2330 #define CAM_QCOM_FEATURE_OPTIZOOM       (1U<<14)
2331 #define CAM_QCOM_FEATURE_SENSOR_HDR     (1U<<15)
2332 #define CAM_QCOM_FEATURE_REFOCUS        (1U<<16)
2333 #define CAM_QCOM_FEATURE_CPP_TNR        (1U<<17)
2334 #define CAM_QCOM_FEATURE_RAW_PROCESSING (1U<<18)
2335 #define CAM_QCOM_FEATURE_TRUEPORTRAIT   (1U<<19)
2336 #define CAM_QCOM_FEATURE_LLVD           (1U<<20)
2337 #define CAM_QCOM_FEATURE_DIS20          (1U<<21)
2338 #define CAM_QCOM_FEATURE_STILLMORE      (1U<<22)
2339 #define CAM_QCOM_FEATURE_DCRF           (1U<<23)
2340 #define CAM_QCOM_FEATURE_CDS            (1U<<24)
2341 #define CAM_QCOM_FEATURE_EZTUNE         (1U<<25)
2342 #define CAM_QCOM_FEATURE_DSDN           (1U<<26) //Special CDS in CPP block
2343 #define CAM_QCOM_FEATURE_SW2D           (1U<<27)
2344 #define CAM_OEM_FEATURE_1               (1U<<28)
2345 #define CAM_OEM_FEATURE_2               (1U<<29)
2346 #define CAM_QTI_FEATURE_SW_TNR          (1U<<30)
2347 #define CAM_QCOM_FEATURE_METADATA_PROCESSING (1U<<31)
2348 #define CAM_QCOM_FEATURE_MAX            32
2349 #define CAM_QCOM_FEATURE_PP_SUPERSET    (CAM_QCOM_FEATURE_DENOISE2D|CAM_QCOM_FEATURE_CROP|\
2350                                          CAM_QCOM_FEATURE_ROTATION|CAM_QCOM_FEATURE_SHARPNESS|\
2351                                          CAM_QCOM_FEATURE_SCALE|CAM_QCOM_FEATURE_CAC|\
2352                                          CAM_QCOM_FEATURE_EZTUNE|CAM_QCOM_FEATURE_CPP_TNR|\
2353                                          CAM_QCOM_FEATURE_LLVD)
2354 
2355 #define CAM_QCOM_FEATURE_PP_PASS_1      CAM_QCOM_FEATURE_PP_SUPERSET
2356 #define CAM_QCOM_FEATURE_PP_PASS_2      CAM_QCOM_FEATURE_SCALE | CAM_QCOM_FEATURE_CROP;
2357 
2358 // Counter clock wise
2359 typedef enum {
2360     ROTATE_0 = 1<<0,
2361     ROTATE_90 = 1<<1,
2362     ROTATE_180 = 1<<2,
2363     ROTATE_270 = 1<<3,
2364 } cam_rotation_t;
2365 
2366 typedef struct {
2367    cam_rotation_t rotation;         /* jpeg rotation */
2368    cam_rotation_t device_rotation;  /* device rotation */
2369    uint32_t streamId;
2370 } cam_rotation_info_t;
2371 
2372 typedef enum {
2373     FLIP_NONE = 0, /* 00b */
2374     FLIP_H = 1,    /* 01b */
2375     FLIP_V = 2,    /* 10b */
2376     FLIP_V_H = 3,  /* 11b */
2377 } cam_flip_t;
2378 
2379 typedef struct {
2380     uint32_t bundle_id;                            /* bundle id */
2381     uint8_t num_of_streams;                        /* number of streams in the bundle */
2382     uint32_t stream_ids[MAX_STREAM_NUM_IN_BUNDLE]; /* array of stream ids to be bundled */
2383 } cam_bundle_config_t;
2384 
2385 typedef enum {
2386     CAM_ONLINE_REPROCESS_TYPE,    /* online reprocess, frames from running streams */
2387     CAM_OFFLINE_REPROCESS_TYPE,   /* offline reprocess, frames from external source */
2388 } cam_reprocess_type_enum_t;
2389 
2390 typedef struct {
2391     uint8_t burst_count;
2392     uint8_t min_burst_count;
2393     uint8_t max_burst_count;
2394 } cam_still_more_t;
2395 
2396 typedef struct {
2397     uint8_t burst_count;
2398     uint8_t output_count;
2399     uint8_t flash_bracketing[CAM_MAX_FLASH_BRACKETING];
2400     uint8_t metadata_index;
2401 } cam_chroma_flash_t;
2402 
2403 typedef enum {
2404     CAM_HDR_MODE_SINGLEFRAME,    /* Single frame HDR mode which does only tone mapping */
2405     CAM_HDR_MODE_MULTIFRAME,     /* Multi frame HDR mode which needs two frames with 0.5x and 2x exposure respectively */
2406 } cam_hdr_mode_enum_t;
2407 
2408 typedef struct {
2409     uint32_t hdr_enable;
2410     uint32_t hdr_need_1x; /* when CAM_QCOM_FEATURE_HDR enabled, indicate if 1x is needed for output */
2411     cam_hdr_mode_enum_t hdr_mode;
2412 } cam_hdr_param_t;
2413 
2414 typedef struct {
2415     int32_t output_width;
2416     int32_t output_height;
2417 } cam_scale_param_t;
2418 
2419 typedef struct {
2420     uint8_t enable;
2421     uint8_t burst_count;
2422     uint8_t focus_steps[MAX_AF_BRACKETING_VALUES];
2423     uint8_t output_count;
2424     uint32_t meta_max_size;
2425 } cam_af_bracketing_t;
2426 
2427 typedef struct {
2428     uint8_t enable;
2429     uint8_t burst_count;
2430 } cam_flash_bracketing_t;
2431 
2432 typedef struct {
2433     uint8_t enable;
2434     uint8_t burst_count;
2435     uint8_t zoom_threshold;
2436 } cam_opti_zoom_t;
2437 
2438 typedef struct {
2439     size_t meta_max_size;
2440 } cam_true_portrait_t;
2441 
2442 typedef enum {
2443     CAM_FLASH_OFF,
2444     CAM_FLASH_ON
2445 } cam_flash_value_t;
2446 
2447 typedef struct {
2448     cam_sensor_t sens_type;
2449     cam_format_t native_format;
2450 } cam_sensor_type_t;
2451 
2452 typedef struct {
2453     uint32_t result;
2454     uint32_t header_size;
2455     uint32_t width;
2456     uint32_t height;
2457     uint8_t data[0];
2458 } cam_misc_buf_t;
2459 
2460 typedef struct {
2461     uint32_t misc_buffer_index;
2462 } cam_misc_buf_param_t;
2463 
2464 typedef struct {
2465     /* reprocess feature mask */
2466     uint32_t feature_mask;
2467 
2468     /* individual setting for features to be reprocessed */
2469     cam_denoise_param_t denoise2d;
2470     cam_rect_t input_crop;
2471     cam_rotation_t rotation;
2472     uint32_t flip;
2473     int32_t sharpness;
2474     int32_t effect;
2475     cam_hdr_param_t hdr_param;
2476     cam_scale_param_t scale_param;
2477 
2478     uint8_t zoom_level;
2479     cam_flash_value_t flash_value;
2480     cam_misc_buf_param_t misc_buf_param;
2481     uint32_t burst_cnt;
2482     uint8_t cur_reproc_count;
2483     uint8_t total_reproc_count;
2484 } cam_pp_feature_config_t;
2485 
2486 typedef struct {
2487     uint32_t input_stream_id;
2488     /* input source stream type */
2489     cam_stream_type_t input_stream_type;
2490 } cam_pp_online_src_config_t;
2491 
2492 typedef struct {
2493     /* image format */
2494     cam_format_t input_fmt;
2495 
2496     /* image dimension */
2497     cam_dimension_t input_dim;
2498 
2499     /* buffer plane information, will be calc based on stream_type, fmt,
2500        dim, and padding_info(from stream config). Info including:
2501        offset_x, offset_y, stride, scanline, plane offset */
2502     cam_stream_buf_plane_info_t input_buf_planes;
2503 
2504     /* number of input reprocess buffers */
2505     uint8_t num_of_bufs;
2506 
2507     /* input source type */
2508     cam_stream_type_t input_type;
2509 
2510 } cam_pp_offline_src_config_t;
2511 
2512 /* reprocess stream input configuration */
2513 typedef struct {
2514     /* input source config */
2515     cam_reprocess_type_enum_t pp_type;
2516     union {
2517         cam_pp_online_src_config_t online;
2518         cam_pp_offline_src_config_t offline;
2519     };
2520 
2521     /* pp feature config */
2522     cam_pp_feature_config_t pp_feature_config;
2523 } cam_stream_reproc_config_t;
2524 
2525 typedef struct {
2526     uint8_t crop_enabled;
2527     cam_rect_t input_crop;
2528 } cam_crop_param_t;
2529 
2530 typedef struct {
2531     uint8_t trigger;
2532     int32_t trigger_id;
2533 } cam_trigger_t;
2534 
2535 typedef struct {
2536     cam_denoise_param_t denoise2d;
2537     cam_crop_param_t crop;
2538     uint32_t flip;     /* 0 means no flip */
2539     uint32_t uv_upsample; /* 0 means no chroma upsampling */
2540     int32_t sharpness; /* 0 means no sharpness */
2541     int32_t effect;
2542     cam_rotation_t rotation;
2543     cam_rotation_t device_rotation;
2544 } cam_per_frame_pp_config_t;
2545 
2546 typedef enum {
2547     CAM_OPT_STAB_OFF,
2548     CAM_OPT_STAB_ON,
2549     CAM_OPT_STAB_MAX
2550 } cam_optical_stab_modes_t;
2551 
2552 typedef enum {
2553     CAM_FILTER_ARRANGEMENT_RGGB,
2554     CAM_FILTER_ARRANGEMENT_GRBG,
2555     CAM_FILTER_ARRANGEMENT_GBRG,
2556     CAM_FILTER_ARRANGEMENT_BGGR,
2557 
2558     /* Sensor is not Bayer; output has 3 16-bit values for each pixel,
2559      * instead of just 1 16-bit value per pixel.*/
2560     CAM_FILTER_ARRANGEMENT_RGB,
2561     /* Sensor is YUV; SW do not have access to actual RAW,
2562      * output is interleaved UYVY */
2563     CAM_FILTER_ARRANGEMENT_UYVY,
2564     CAM_FILTER_ARRANGEMENT_YUYV,
2565     CAM_FILTER_ARRANGEMENT_Y
2566 } cam_color_filter_arrangement_t;
2567 
2568 typedef enum {
2569   CAM_AF_LENS_STATE_STATIONARY,
2570   CAM_AF_LENS_STATE_MOVING,
2571 } cam_af_lens_state_t;
2572 
2573 typedef enum {
2574     CAM_AWB_STATE_INACTIVE,
2575     CAM_AWB_STATE_SEARCHING,
2576     CAM_AWB_STATE_CONVERGED,
2577     CAM_AWB_STATE_LOCKED
2578 } cam_awb_state_t;
2579 
2580 typedef enum {
2581     CAM_FOCUS_UNCALIBRATED,
2582     CAM_FOCUS_APPROXIMATE,
2583     CAM_FOCUS_CALIBRATED
2584 } cam_focus_calibration_t;
2585 
2586 typedef enum {
2587     CAM_TEST_PATTERN_OFF,
2588     CAM_TEST_PATTERN_SOLID_COLOR,
2589     CAM_TEST_PATTERN_COLOR_BARS,
2590     CAM_TEST_PATTERN_COLOR_BARS_FADE_TO_GRAY,
2591     CAM_TEST_PATTERN_PN9,
2592     CAM_TEST_PATTERN_CUSTOM1 = 256
2593 } cam_test_pattern_mode_t;
2594 
2595 typedef struct {
2596     cam_test_pattern_mode_t mode;
2597     int32_t r;
2598     int32_t gr;
2599     int32_t gb;
2600     int32_t b;
2601 } cam_test_pattern_data_t;
2602 
2603 typedef enum {
2604     CAM_AWB_D50,
2605     CAM_AWB_D65,
2606     CAM_AWB_D75,
2607     CAM_AWB_A,
2608     CAM_AWB_CUSTOM_A,
2609     CAM_AWB_WARM_FLO,
2610     CAM_AWB_COLD_FLO,
2611     CAM_AWB_CUSTOM_FLO,
2612     CAM_AWB_NOON,
2613     CAM_AWB_CUSTOM_DAYLIGHT,
2614     CAM_AWB_INVALID_ALL_LIGHT,
2615 } cam_illuminat_t;
2616 
2617 typedef enum {
2618     LEGACY_RAW,
2619     MIPI_RAW,
2620 } cam_opaque_raw_format_t;
2621 
2622 typedef enum {
2623     CAM_PERF_NORMAL = 0,
2624     CAM_PERF_HIGH,
2625     CAM_PERF_HIGH_PERFORMANCE,
2626 } cam_perf_mode_t;
2627 
2628 typedef struct {
2629     float real_gain;
2630     float lux_idx;
2631     float exp_time;
2632 } cam_intf_aec_t;
2633 
2634 #define CAM_INTF_AEC_DATA_MAX   (10)
2635 
2636 typedef struct {
2637     uint32_t frame_count;
2638     cam_intf_aec_t aec_data[CAM_INTF_AEC_DATA_MAX];
2639 } cam_intf_meta_imglib_input_aec_t;
2640 
2641 typedef struct {
2642     cam_intf_meta_imglib_input_aec_t meta_imglib_input_aec;
2643 } cam_intf_meta_imglib_t;
2644 
2645 typedef struct {
2646     uint8_t previewOnly;
2647     uint64_t value;
2648 } cam_intf_parm_manual_3a_t;
2649 
2650 typedef enum {
2651     CAM_MANUAL_CAPTURE_TYPE_OFF, /*Manual capture mode disabled*/
2652     CAM_MANUAL_CAPTURE_TYPE_1,   /*Normal ZSL capture with limited 3A settings*/
2653     CAM_MANUAL_CAPTURE_TYPE_2,   /*Low light capture mode */
2654     CAM_MANUAL_CAPTURE_TYPE_3,   /*Offline RAW processing */
2655     CAM_MANUAL_CAPTURE_TYPE_4    /*Offline RAW processing with multiple RAW*/
2656 } cam_manual_capture_type;
2657 
2658 /***********************************
2659 * ENUM definition for custom parameter type
2660 ************************************/
2661 typedef enum {
2662     CAM_CUSTOM_PARM_EXAMPLE,
2663     CAM_CUSTOM_PARM_MAX,
2664 } cam_custom_parm_type;
2665 #endif /* __QCAMERA_TYPES_H__ */
2666