1 /* Copyright (c) 2012, 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_INTF_H__
31 #define __QCAMERA_INTF_H__
32 
33 #include <stdint.h>
34 #include <pthread.h>
35 #include <inttypes.h>
36 
37 #define PAD_TO_WORD(a)               (((a)+3)&~3)
38 #define PAD_TO_2K(a)                 (((a)+2047)&~2047)
39 #define PAD_TO_4K(a)                 (((a)+4095)&~4095)
40 #define PAD_TO_8K(a)                 (((a)+8191)&~8191)
41 
42 #define CEILING32(X) (((X) + 0x0001F) & 0xFFFFFFE0)
43 #define CEILING16(X) (((X) + 0x000F) & 0xFFF0)
44 #define CEILING4(X)  (((X) + 0x0003) & 0xFFFC)
45 #define CEILING2(X)  (((X) + 0x0001) & 0xFFFE)
46 
47 #define MAX_ROI 2
48 #define MAX_NUM_PARM 5
49 #define MAX_NUM_OPS 2
50 #define VIDEO_MAX_PLANES 8
51 #define MAX_SNAPSHOT_BUFFERS 5
52 #define MAX_EXP_BRACKETING_LENGTH 32
53 
54 
55 /* Exif Tag ID */
56 typedef uint32_t exif_tag_id_t;
57 
58 /* Exif Info (opaque definition) */
59 struct exif_info_t;
60 typedef struct exif_info_t * exif_info_obj_t;
61 
62 typedef enum {
63   BACK_CAMERA,
64   FRONT_CAMERA,
65 }cam_position_t;
66 
67 typedef enum {
68   CAM_CTRL_FAILED,        /* Failure in doing operation */
69   CAM_CTRL_SUCCESS,       /* Operation Succeded */
70   CAM_CTRL_INVALID_PARM,  /* Inavlid parameter provided */
71   CAM_CTRL_NOT_SUPPORTED, /* Parameter/operation not supported */
72   CAM_CTRL_ACCEPTED,      /* Parameter accepted */
73   CAM_CTRL_MAX,
74 } cam_ctrl_status_t;
75 
76 typedef enum {
77   CAMERA_YUV_420_NV12,
78   CAMERA_YUV_420_NV21,
79   CAMERA_YUV_420_NV21_ADRENO,
80   CAMERA_BAYER_SBGGR10,
81   CAMERA_RDI,
82   CAMERA_YUV_420_YV12,
83   CAMERA_YUV_422_NV16,
84   CAMERA_YUV_422_NV61,
85   CAMERA_YUV_422_YUYV,
86   CAMERA_SAEC,
87   CAMERA_SAWB,
88   CAMERA_SAFC,
89   CAMERA_SHST,
90 } cam_format_t;
91 
92 typedef enum {
93   CAMERA_PAD_NONE,
94   CAMERA_PAD_TO_WORD,   /*2 bytes*/
95   CAMERA_PAD_TO_LONG_WORD, /*4 bytes*/
96   CAMERA_PAD_TO_8, /*8 bytes*/
97   CAMERA_PAD_TO_16, /*16 bytes*/
98 
99   CAMERA_PAD_TO_1K, /*1k bytes*/
100   CAMERA_PAD_TO_2K, /*2k bytes*/
101   CAMERA_PAD_TO_4K,
102   CAMERA_PAD_TO_8K
103 } cam_pad_format_t;
104 
105 typedef struct {
106   int ext_mode;   /* preview, main, thumbnail, video, raw, etc */
107   int frame_idx;  /* frame index */
108   int fd;         /* origin fd */
109   uint32_t size;
110   uint8_t is_hist; /* is hist mapping? */
111 } mm_camera_frame_map_type;
112 
113 typedef struct {
114   int ext_mode;   /* preview, main, thumbnail, video, raw, etc */
115   int frame_idx;  /* frame index */
116   uint8_t is_hist; /* is hist unmapping? */
117 } mm_camera_frame_unmap_type;
118 
119 typedef enum {
120   CAM_SOCK_MSG_TYPE_FD_MAPPING,
121   CAM_SOCK_MSG_TYPE_FD_UNMAPPING,
122   CAM_SOCK_MSG_TYPE_WDN_START,
123   CAM_SOCK_MSG_TYPE_HDR_START,
124   CAM_SOCK_MSG_TYPE_HIST_MAPPING,
125   CAM_SOCK_MSG_TYPE_HIST_UNMAPPING,
126   CAM_SOCK_MSG_TYPE_MAX
127 }mm_camera_socket_msg_type;
128 #define MAX_HDR_EXP_FRAME_NUM 5
129 typedef struct {
130   unsigned long cookie;
131   int num_hdr_frames;
132   int hdr_main_idx[MAX_HDR_EXP_FRAME_NUM];
133   int hdr_thm_idx[MAX_HDR_EXP_FRAME_NUM];
134   int exp[MAX_HDR_EXP_FRAME_NUM];
135 } mm_camera_hdr_start_type;
136 
137 #define MM_MAX_WDN_NUM 2
138 typedef struct {
139   unsigned long cookie;
140   int num_frames;
141   int ext_mode[MM_MAX_WDN_NUM];
142   int frame_idx[MM_MAX_WDN_NUM];
143 } mm_camera_wdn_start_type;
144 
145 typedef struct {
146   mm_camera_socket_msg_type msg_type;
147   union {
148     mm_camera_frame_map_type frame_fd_map;
149     mm_camera_frame_unmap_type frame_fd_unmap;
150     mm_camera_wdn_start_type wdn_start;
151     mm_camera_hdr_start_type hdr_pkg;
152   } payload;
153 } cam_sock_packet_t;
154 
155 typedef enum {
156   CAM_VIDEO_FRAME,
157   CAM_SNAPSHOT_FRAME,
158   CAM_PREVIEW_FRAME,
159 }cam_frame_type_t;
160 
161 
162 typedef enum {
163   CAMERA_MODE_2D = (1<<0),
164   CAMERA_MODE_3D = (1<<1),
165   CAMERA_NONZSL_MODE = (1<<2),
166   CAMERA_ZSL_MODE = (1<<3),
167   CAMERA_MODE_MAX = CAMERA_ZSL_MODE,
168 } camera_mode_t;
169 
170 
171 typedef struct {
172   int  modes_supported;
173   int8_t camera_id;
174   cam_position_t position;
175   uint32_t sensor_mount_angle;
176 }camera_info_t;
177 
178 typedef struct {
179   camera_mode_t mode;
180   int8_t camera_id;
181   camera_mode_t cammode;
182 }config_params_t;
183 
184 typedef struct {
185   uint32_t len;
186   uint32_t y_offset;
187   uint32_t cbcr_offset;
188 } cam_sp_len_offset_t;
189 
190 typedef struct{
191   uint32_t len;
192   uint32_t offset;
193 } cam_mp_len_offset_t;
194 
195 typedef struct {
196   int num_planes;
197   union {
198     cam_sp_len_offset_t sp;
199     cam_mp_len_offset_t mp[8];
200   };
201   uint32_t frame_len;
202 } cam_frame_len_offset_t;
203 
204 typedef struct {
205   uint32_t parm[MAX_NUM_PARM];
206   uint32_t ops[MAX_NUM_OPS];
207   uint8_t yuv_output;
208   uint8_t jpeg_capture;
209   uint32_t max_pict_width;
210   uint32_t max_pict_height;
211   uint32_t max_preview_width;
212   uint32_t max_preview_height;
213   uint32_t max_video_width;
214   uint32_t max_video_height;
215   uint32_t effect;
216   camera_mode_t modes;
217   uint8_t preview_format;
218   uint32_t preview_sizes_cnt;
219   uint32_t thumb_sizes_cnt;
220   uint32_t video_sizes_cnt;
221   uint32_t hfr_sizes_cnt;
222   uint8_t vfe_output_enable;
223   uint8_t hfr_frame_skip;
224   uint32_t default_preview_width;
225   uint32_t default_preview_height;
226   uint32_t bestshot_reconfigure;
227   uint32_t pxlcode;
228 }cam_prop_t;
229 
230 typedef struct {
231   uint16_t video_width;         /* Video width seen by VFE could be different than orig. Ex. DIS */
232   uint16_t video_height;        /* Video height seen by VFE */
233   uint16_t picture_width;       /* Picture width seen by VFE */
234   uint16_t picture_height;      /* Picture height seen by VFE */
235   uint16_t display_width;       /* width of display */
236   uint16_t display_height;      /* height of display */
237   uint16_t orig_video_width;    /* original video width received */
238   uint16_t orig_video_height;   /* original video height received */
239   uint16_t orig_picture_dx;     /* original picture width received */
240   uint16_t orig_picture_dy;     /* original picture height received */
241   uint16_t ui_thumbnail_height; /* Just like orig_picture_dx */
242   uint16_t ui_thumbnail_width;  /* Just like orig_picture_dy */
243   uint16_t thumbnail_height;
244   uint16_t thumbnail_width;
245   uint16_t orig_picture_width;
246   uint16_t orig_picture_height;
247   uint16_t orig_thumb_width;
248   uint16_t orig_thumb_height;
249   uint16_t raw_picture_height;
250   uint16_t raw_picture_width;
251   uint16_t rdi0_height;
252   uint16_t rdi0_width;
253   uint16_t rdi1_height;
254   uint16_t rdi1_width;
255   uint32_t hjr_xtra_buff_for_bayer_filtering;
256   cam_format_t    prev_format;
257   cam_format_t    enc_format;
258   cam_format_t    thumb_format;
259   cam_format_t    main_img_format;
260   cam_format_t    rdi0_format;
261   cam_format_t    rdi1_format;
262   cam_format_t    raw_img_format;
263   cam_pad_format_t prev_padding_format;
264   cam_pad_format_t enc_padding_format;
265   cam_pad_format_t thumb_padding_format;
266   cam_pad_format_t main_padding_format;
267   uint16_t display_luma_width;
268   uint16_t display_luma_height;
269   uint16_t display_chroma_width;
270   uint16_t display_chroma_height;
271   uint16_t video_luma_width;
272   uint16_t video_luma_height;
273   uint16_t video_chroma_width;
274   uint16_t video_chroma_height;
275   uint16_t thumbnail_luma_width;
276   uint16_t thumbnail_luma_height;
277   uint16_t thumbnail_chroma_width;
278   uint16_t thumbnail_chroma_height;
279   uint16_t main_img_luma_width;
280   uint16_t main_img_luma_height;
281   uint16_t main_img_chroma_width;
282   uint16_t main_img_chroma_height;
283   int rotation;
284   cam_frame_len_offset_t display_frame_offset;
285   cam_frame_len_offset_t video_frame_offset;
286   cam_frame_len_offset_t picture_frame_offset;
287   cam_frame_len_offset_t thumb_frame_offset;
288   uint32_t channel_interface_mask;
289 } cam_ctrl_dimension_t;
290 
291 typedef struct {
292   uint16_t type;
293   uint16_t width;
294   uint16_t height;
295 } cam_stats_buf_dimension_t;
296 
297 typedef struct {
298   uint8_t cid;
299   uint8_t dt;
300   uint32_t inst_handle;
301 } cam_cid_entry_t;
302 
303 #define CAM_MAX_CID_NUM    8
304 typedef struct {
305   /*should we hard code max CIDs? if not we need to have two CMD*/
306   uint8_t num_cids;
307   cam_cid_entry_t cid_entries[CAM_MAX_CID_NUM];
308 } cam_cid_info_t;
309 
310 typedef struct {
311   /* we still use prev, video, main,
312    * thumb to interprete image types */
313   uint32_t image_mode;                 /* input */
314   cam_format_t format;                 /* input */
315   cam_pad_format_t padding_format;     /* input */
316   int rotation;                        /* input */
317   uint16_t width;                      /* input/output */
318   uint16_t height;                     /* input/output */
319   cam_frame_len_offset_t frame_offset; /* output */
320 } cam_frame_resolution_t;
321 
322 typedef struct {
323   uint32_t instance_hdl; /* instance handler of the stream */
324   uint32_t frame_idx;    /* frame index */
325   uint16_t frame_width;
326   uint16_t frame_height;
327   cam_frame_len_offset_t frame_offset;
328 } mm_camera_wnr_frame_info_t;
329 
330 #define MM_CAMEAR_MAX_STRAEM_BUNDLE 4
331 typedef struct {
332     uint8_t num_frames;
333     mm_camera_wnr_frame_info_t frames[MM_CAMEAR_MAX_STRAEM_BUNDLE];
334 } mm_camera_wnr_info_t;
335 
336 typedef struct {
337   uint8_t num;
338   uint32_t stream_handles[MM_CAMEAR_MAX_STRAEM_BUNDLE]; /* instance handler */
339 } cam_stream_bundle_t;
340 
341 /* Add enumenrations at the bottom but before MM_CAMERA_PARM_MAX */
342 typedef enum {
343     MM_CAMERA_PARM_PICT_SIZE,
344     MM_CAMERA_PARM_ZOOM_RATIO,
345     MM_CAMERA_PARM_HISTOGRAM,
346     MM_CAMERA_PARM_DIMENSION,
347     MM_CAMERA_PARM_FPS,
348     MM_CAMERA_PARM_FPS_MODE, /*5*/
349     MM_CAMERA_PARM_EFFECT,
350     MM_CAMERA_PARM_EXPOSURE_COMPENSATION,
351     MM_CAMERA_PARM_EXPOSURE,
352     MM_CAMERA_PARM_SHARPNESS,
353     MM_CAMERA_PARM_CONTRAST, /*10*/
354     MM_CAMERA_PARM_SATURATION,
355     MM_CAMERA_PARM_BRIGHTNESS,
356     MM_CAMERA_PARM_WHITE_BALANCE,
357     MM_CAMERA_PARM_LED_MODE,
358     MM_CAMERA_PARM_ANTIBANDING, /*15*/
359     MM_CAMERA_PARM_ROLLOFF,
360     MM_CAMERA_PARM_CONTINUOUS_AF,
361     MM_CAMERA_PARM_FOCUS_RECT,
362     MM_CAMERA_PARM_AEC_ROI,
363     MM_CAMERA_PARM_AF_ROI, /*20*/
364     MM_CAMERA_PARM_HJR,
365     MM_CAMERA_PARM_ISO,
366     MM_CAMERA_PARM_BL_DETECTION,
367     MM_CAMERA_PARM_SNOW_DETECTION,
368     MM_CAMERA_PARM_BESTSHOT_MODE, /*25*/
369     MM_CAMERA_PARM_ZOOM,
370     MM_CAMERA_PARM_VIDEO_DIS,
371     MM_CAMERA_PARM_VIDEO_ROT,
372     MM_CAMERA_PARM_SCE_FACTOR,
373     MM_CAMERA_PARM_FD, /*30*/
374     MM_CAMERA_PARM_MODE,
375     /* 2nd 32 bits */
376     MM_CAMERA_PARM_3D_FRAME_FORMAT,
377     MM_CAMERA_PARM_CAMERA_ID,
378     MM_CAMERA_PARM_CAMERA_INFO,
379     MM_CAMERA_PARM_PREVIEW_SIZE, /*35*/
380     MM_CAMERA_PARM_QUERY_FALSH4SNAP,
381     MM_CAMERA_PARM_FOCUS_DISTANCES,
382     MM_CAMERA_PARM_BUFFER_INFO,
383     MM_CAMERA_PARM_JPEG_ROTATION,
384     MM_CAMERA_PARM_JPEG_MAINIMG_QUALITY, /* 40 */
385     MM_CAMERA_PARM_JPEG_THUMB_QUALITY,
386     MM_CAMERA_PARM_ZSL_ENABLE,
387     MM_CAMERA_PARM_FOCAL_LENGTH,
388     MM_CAMERA_PARM_HORIZONTAL_VIEW_ANGLE,
389     MM_CAMERA_PARM_VERTICAL_VIEW_ANGLE, /* 45 */
390     MM_CAMERA_PARM_MCE,
391     MM_CAMERA_PARM_RESET_LENS_TO_INFINITY,
392     MM_CAMERA_PARM_SNAPSHOTDATA,
393     MM_CAMERA_PARM_HFR,
394     MM_CAMERA_PARM_REDEYE_REDUCTION, /* 50 */
395     MM_CAMERA_PARM_WAVELET_DENOISE,
396     MM_CAMERA_PARM_3D_DISPLAY_DISTANCE,
397     MM_CAMERA_PARM_3D_VIEW_ANGLE,
398     MM_CAMERA_PARM_PREVIEW_FORMAT,
399     MM_CAMERA_PARM_RDI_FORMAT,
400     MM_CAMERA_PARM_HFR_SIZE, /* 55 */
401     MM_CAMERA_PARM_3D_EFFECT,
402     MM_CAMERA_PARM_3D_MANUAL_CONV_RANGE,
403     MM_CAMERA_PARM_3D_MANUAL_CONV_VALUE,
404     MM_CAMERA_PARM_ENABLE_3D_MANUAL_CONVERGENCE,
405     /* These are new parameters defined here */
406     MM_CAMERA_PARM_CH_IMAGE_FMT, /* 60 */       // mm_camera_ch_image_fmt_parm_t
407     MM_CAMERA_PARM_OP_MODE,             // camera state, sub state also
408     MM_CAMERA_PARM_SHARPNESS_CAP,       //
409     MM_CAMERA_PARM_SNAPSHOT_BURST_NUM,  // num shots per snapshot action
410     MM_CAMERA_PARM_LIVESHOT_MAIN,       // enable/disable full size live shot
411     MM_CAMERA_PARM_MAXZOOM, /* 65 */
412     MM_CAMERA_PARM_LUMA_ADAPTATION,     // enable/disable
413     MM_CAMERA_PARM_HDR,
414     MM_CAMERA_PARM_CROP,
415     MM_CAMERA_PARM_MAX_PICTURE_SIZE,
416     MM_CAMERA_PARM_MAX_PREVIEW_SIZE, /* 70 */
417     MM_CAMERA_PARM_ASD_ENABLE,
418     MM_CAMERA_PARM_RECORDING_HINT,
419     MM_CAMERA_PARM_CAF_ENABLE,
420     MM_CAMERA_PARM_FULL_LIVESHOT,
421     MM_CAMERA_PARM_DIS_ENABLE, /* 75 */
422     MM_CAMERA_PARM_AEC_LOCK,
423     MM_CAMERA_PARM_AWB_LOCK,
424     MM_CAMERA_PARM_AF_MTR_AREA,
425     MM_CAMERA_PARM_AEC_MTR_AREA,
426     MM_CAMERA_PARM_LOW_POWER_MODE,
427     MM_CAMERA_PARM_MAX_HFR_MODE, /* 80 */
428     MM_CAMERA_PARM_MAX_VIDEO_SIZE,
429     MM_CAMERA_PARM_DEF_PREVIEW_SIZES,
430     MM_CAMERA_PARM_DEF_VIDEO_SIZES,
431     MM_CAMERA_PARM_DEF_THUMB_SIZES,
432     MM_CAMERA_PARM_DEF_HFR_SIZES,
433     MM_CAMERA_PARM_PREVIEW_SIZES_CNT,
434     MM_CAMERA_PARM_VIDEO_SIZES_CNT,
435     MM_CAMERA_PARM_THUMB_SIZES_CNT,
436     MM_CAMERA_PARM_HFR_SIZES_CNT,
437     MM_CAMERA_PARM_GRALLOC_USAGE,
438     MM_CAMERA_PARM_VFE_OUTPUT_ENABLE, //to check whether both oputputs are
439     MM_CAMERA_PARM_DEFAULT_PREVIEW_WIDTH,
440     MM_CAMERA_PARM_DEFAULT_PREVIEW_HEIGHT,
441     MM_CAMERA_PARM_FOCUS_MODE,
442     MM_CAMERA_PARM_HFR_FRAME_SKIP,
443     MM_CAMERA_PARM_CH_INTERFACE,
444     //or single output enabled to differentiate 7x27a with others
445     MM_CAMERA_PARM_BESTSHOT_RECONFIGURE,
446     MM_CAMERA_PARM_MAX_NUM_FACES_DECT,
447     MM_CAMERA_PARM_FPS_RANGE,
448     MM_CAMERA_PARM_CID,
449     MM_CAMERA_PARM_FRAME_RESOLUTION,
450     MM_CAMERA_PARM_RAW_SNAPSHOT_FMT,
451     MM_CAMERA_PARM_FACIAL_FEATURE_INFO,
452     MM_CAMERA_PARM_MOBICAT,
453     MM_CAMERA_PARM_MAX
454 } mm_camera_parm_type_t;
455 
456 typedef enum {
457   STREAM_NONE           =  0x0,
458   STREAM_IMAGE          =  0x1,
459   STREAM_RAW            =  0x2,
460   STREAM_RAW1           =  0x4,
461   STREAM_RAW2           =  0x8,
462 } mm_camera_channel_stream_info_t;
463 
464 typedef enum {
465   CAMERA_SET_PARM_DISPLAY_INFO,
466   CAMERA_SET_PARM_DIMENSION,
467 
468   CAMERA_SET_PARM_ZOOM,
469   CAMERA_SET_PARM_SENSOR_POSITION,
470   CAMERA_SET_PARM_FOCUS_RECT,
471   CAMERA_SET_PARM_LUMA_ADAPTATION,
472   CAMERA_SET_PARM_CONTRAST,
473   CAMERA_SET_PARM_BRIGHTNESS,
474   CAMERA_SET_PARM_EXPOSURE_COMPENSATION,
475   CAMERA_SET_PARM_SHARPNESS,
476   CAMERA_SET_PARM_HUE,  /* 10 */
477   CAMERA_SET_PARM_SATURATION,
478   CAMERA_SET_PARM_EXPOSURE,
479   CAMERA_SET_PARM_AUTO_FOCUS,
480   CAMERA_SET_PARM_WB,
481   CAMERA_SET_PARM_EFFECT,
482   CAMERA_SET_PARM_FPS,
483   CAMERA_SET_PARM_FLASH,
484   CAMERA_SET_PARM_NIGHTSHOT_MODE,
485   CAMERA_SET_PARM_REFLECT,
486   CAMERA_SET_PARM_PREVIEW_MODE,  /* 20 */
487   CAMERA_SET_PARM_ANTIBANDING,
488   CAMERA_SET_PARM_RED_EYE_REDUCTION,
489   CAMERA_SET_PARM_FOCUS_STEP,
490   CAMERA_SET_PARM_EXPOSURE_METERING,
491   CAMERA_SET_PARM_AUTO_EXPOSURE_MODE,
492   CAMERA_SET_PARM_ISO,
493   CAMERA_SET_PARM_BESTSHOT_MODE,
494   CAMERA_SET_PARM_ENCODE_ROTATION,
495 
496   CAMERA_SET_PARM_PREVIEW_FPS,
497   CAMERA_SET_PARM_AF_MODE,  /* 30 */
498   CAMERA_SET_PARM_HISTOGRAM,
499   CAMERA_SET_PARM_FLASH_STATE,
500   CAMERA_SET_PARM_FRAME_TIMESTAMP,
501   CAMERA_SET_PARM_STROBE_FLASH,
502   CAMERA_SET_PARM_FPS_LIST,
503   CAMERA_SET_PARM_HJR,
504   CAMERA_SET_PARM_ROLLOFF,
505 
506   CAMERA_STOP_PREVIEW,
507   CAMERA_START_PREVIEW,
508   CAMERA_START_SNAPSHOT, /* 40 */
509   CAMERA_START_RAW_SNAPSHOT,
510   CAMERA_STOP_SNAPSHOT,
511   CAMERA_EXIT,
512   CAMERA_ENABLE_BSM,
513   CAMERA_DISABLE_BSM,
514   CAMERA_GET_PARM_ZOOM,
515   CAMERA_GET_PARM_MAXZOOM,
516   CAMERA_GET_PARM_ZOOMRATIOS,
517   CAMERA_GET_PARM_AF_SHARPNESS,
518   CAMERA_SET_PARM_LED_MODE, /* 50 */
519   CAMERA_SET_MOTION_ISO,
520   CAMERA_AUTO_FOCUS_CANCEL,
521   CAMERA_GET_PARM_FOCUS_STEP,
522   CAMERA_ENABLE_AFD,
523   CAMERA_PREPARE_SNAPSHOT,
524   CAMERA_SET_FPS_MODE,
525   CAMERA_START_VIDEO,
526   CAMERA_STOP_VIDEO,
527   CAMERA_START_RECORDING,
528   CAMERA_STOP_RECORDING, /* 60 */
529   CAMERA_SET_VIDEO_DIS_PARAMS,
530   CAMERA_SET_VIDEO_ROT_PARAMS,
531   CAMERA_SET_PARM_AEC_ROI,
532   CAMERA_SET_CAF,
533   CAMERA_SET_PARM_BL_DETECTION_ENABLE,
534   CAMERA_SET_PARM_SNOW_DETECTION_ENABLE,
535   CAMERA_SET_PARM_STROBE_FLASH_MODE,
536   CAMERA_SET_PARM_AF_ROI,
537   CAMERA_START_LIVESHOT,
538   CAMERA_SET_SCE_FACTOR, /* 70 */
539   CAMERA_GET_CAPABILITIES,
540   CAMERA_GET_PARM_DIMENSION,
541   CAMERA_GET_PARM_LED_MODE,
542   CAMERA_SET_PARM_FD,
543   CAMERA_GET_PARM_3D_FRAME_FORMAT,
544   CAMERA_QUERY_FLASH_FOR_SNAPSHOT,
545   CAMERA_GET_PARM_FOCUS_DISTANCES,
546   CAMERA_START_ZSL,
547   CAMERA_STOP_ZSL,
548   CAMERA_ENABLE_ZSL, /* 80 */
549   CAMERA_GET_PARM_FOCAL_LENGTH,
550   CAMERA_GET_PARM_HORIZONTAL_VIEW_ANGLE,
551   CAMERA_GET_PARM_VERTICAL_VIEW_ANGLE,
552   CAMERA_SET_PARM_WAVELET_DENOISE,
553   CAMERA_SET_PARM_MCE,
554   CAMERA_ENABLE_STEREO_CAM,
555   CAMERA_SET_PARM_RESET_LENS_TO_INFINITY,
556   CAMERA_GET_PARM_SNAPSHOTDATA,
557   CAMERA_SET_PARM_HFR,
558   CAMERA_SET_REDEYE_REDUCTION, /* 90 */
559   CAMERA_SET_PARM_3D_DISPLAY_DISTANCE,
560   CAMERA_SET_PARM_3D_VIEW_ANGLE,
561   CAMERA_SET_PARM_3D_EFFECT,
562   CAMERA_SET_PARM_PREVIEW_FORMAT,
563   CAMERA_GET_PARM_3D_DISPLAY_DISTANCE, /* 95 */
564   CAMERA_GET_PARM_3D_VIEW_ANGLE,
565   CAMERA_GET_PARM_3D_EFFECT,
566   CAMERA_GET_PARM_3D_MANUAL_CONV_RANGE,
567   CAMERA_SET_PARM_3D_MANUAL_CONV_VALUE,
568   CAMERA_ENABLE_3D_MANUAL_CONVERGENCE, /* 100 */
569   CAMERA_SET_PARM_HDR,
570   CAMERA_SET_ASD_ENABLE,
571   CAMERA_POSTPROC_ABORT,
572   CAMERA_SET_AEC_MTR_AREA,
573   CAMERA_SET_AEC_LOCK,       /*105*/
574   CAMERA_SET_AWB_LOCK,
575   CAMERA_SET_RECORDING_HINT,
576   CAMERA_SET_PARM_CAF,
577   CAMERA_SET_FULL_LIVESHOT,
578   CAMERA_SET_DIS_ENABLE,  /*110*/
579   CAMERA_GET_PARM_MAX_HFR_MODE,
580   CAMERA_SET_LOW_POWER_MODE,
581   CAMERA_GET_PARM_DEF_PREVIEW_SIZES,
582   CAMERA_GET_PARM_DEF_VIDEO_SIZES,
583   CAMERA_GET_PARM_DEF_THUMB_SIZES, /*115*/
584   CAMERA_GET_PARM_DEF_HFR_SIZES,
585   CAMERA_GET_PARM_MAX_LIVESHOT_SIZE,
586   CAMERA_GET_PARM_FPS_RANGE,
587   CAMERA_SET_3A_CONVERGENCE,
588   CAMERA_SET_PREVIEW_HFR, /*120*/
589   CAMERA_GET_MAX_DIMENSION,
590   CAMERA_GET_MAX_NUM_FACES_DECT,
591   CAMERA_SET_CHANNEL_STREAM,
592   CAMERA_GET_CHANNEL_STREAM,
593   CAMERA_SET_PARM_CID, /*125*/
594   CAMERA_GET_PARM_FRAME_RESOLUTION,
595   CAMERA_GET_FACIAL_FEATURE_INFO,
596   CAMERA_GET_PP_MASK, /* get post-processing mask */
597   CAMERA_DO_PP_WNR,   /* do post-process WNR */
598   CAMERA_GET_PARM_HDR,
599   CAMERA_SEND_PP_PIPELINE_CMD, /* send offline pp cmd */
600   CAMERA_SET_BUNDLE, /* set stream bundle */
601   CAMERA_ENABLE_MOBICAT,
602   CAMERA_GET_PARM_MOBICAT,
603   CAMERA_CTRL_PARM_MAX
604 } cam_ctrl_type;
605 
606 typedef enum {
607   CAMERA_ERROR_NO_MEMORY,
608   CAMERA_ERROR_EFS_FAIL,                /* Low-level operation failed */
609   CAMERA_ERROR_EFS_FILE_OPEN,           /* File already opened */
610   CAMERA_ERROR_EFS_FILE_NOT_OPEN,       /* File not opened */
611   CAMERA_ERROR_EFS_FILE_ALREADY_EXISTS, /* File already exists */
612   CAMERA_ERROR_EFS_NONEXISTENT_DIR,     /* User directory doesn't exist */
613   CAMERA_ERROR_EFS_NONEXISTENT_FILE,    /* User directory doesn't exist */
614   CAMERA_ERROR_EFS_BAD_FILE_NAME,       /* Client specified invalid file/directory name*/
615   CAMERA_ERROR_EFS_BAD_FILE_HANDLE,     /* Client specified invalid file/directory name*/
616   CAMERA_ERROR_EFS_SPACE_EXHAUSTED,     /* Out of file system space */
617   CAMERA_ERROR_EFS_OPEN_TABLE_FULL,     /* Out of open-file table slots                */
618   CAMERA_ERROR_EFS_OTHER_ERROR,         /* Other error                                 */
619   CAMERA_ERROR_CONFIG,
620   CAMERA_ERROR_EXIF_ENCODE,
621   CAMERA_ERROR_VIDEO_ENGINE,
622   CAMERA_ERROR_IPL,
623   CAMERA_ERROR_INVALID_FORMAT,
624   CAMERA_ERROR_TIMEOUT,
625   CAMERA_ERROR_ESD,
626   CAMERA_ERROR_MAX
627 } camera_error_type;
628 
629 #if defined CAMERA_ANTIBANDING_OFF
630 #undef CAMERA_ANTIBANDING_OFF
631 #endif
632 
633 #if defined CAMERA_ANTIBANDING_60HZ
634 #undef CAMERA_ANTIBANDING_60HZ
635 #endif
636 
637 #if defined CAMERA_ANTIBANDING_50HZ
638 #undef CAMERA_ANTIBANDING_50HZ
639 #endif
640 
641 #if defined CAMERA_ANTIBANDING_AUTO
642 #undef CAMERA_ANTIBANDING_AUTO
643 #endif
644 
645 typedef enum {
646   CAMERA_PP_MASK_TYPE_WNR = 0x01
647 } camera_pp_mask_type;
648 
649 typedef enum {
650   CAMERA_ANTIBANDING_OFF,
651   CAMERA_ANTIBANDING_60HZ,
652   CAMERA_ANTIBANDING_50HZ,
653   CAMERA_ANTIBANDING_AUTO,
654   CAMERA_ANTIBANDING_AUTO_50HZ,
655   CAMERA_ANTIBANDING_AUTO_60HZ,
656   CAMERA_MAX_ANTIBANDING,
657 } camera_antibanding_type;
658 
659 /* Enum Type for different ISO Mode supported */
660 typedef enum {
661   CAMERA_ISO_AUTO = 0,
662   CAMERA_ISO_DEBLUR,
663   CAMERA_ISO_100,
664   CAMERA_ISO_200,
665   CAMERA_ISO_400,
666   CAMERA_ISO_800,
667   CAMERA_ISO_1600,
668   CAMERA_ISO_MAX
669 } camera_iso_mode_type;
670 
671 typedef enum {
672   MM_CAMERA_FACIAL_FEATURE_FD, // facial detection
673   MM_CAMERA_FACIAL_FEATURE_MAX
674 } camera_facial_features;
675 
676 typedef enum {
677   AEC_ROI_OFF,
678   AEC_ROI_ON
679 } aec_roi_ctrl_t;
680 
681 typedef enum {
682   AEC_ROI_BY_INDEX,
683   AEC_ROI_BY_COORDINATE,
684 } aec_roi_type_t;
685 
686 typedef struct {
687   uint32_t x;
688   uint32_t y;
689 } cam_coordinate_type_t;
690 
691 /*
692  * Define DRAW_RECTANGLES to draw rectangles on screen. Just for test purpose.
693  */
694 //#define DRAW_RECTANGLES
695 
696 typedef struct {
697   uint16_t x;
698   uint16_t y;
699   uint16_t dx;
700   uint16_t dy;
701 } roi_t;
702 
703 typedef struct {
704   aec_roi_ctrl_t aec_roi_enable;
705   aec_roi_type_t aec_roi_type;
706   union {
707     cam_coordinate_type_t coordinate;
708     uint32_t aec_roi_idx;
709   } aec_roi_position;
710 } cam_set_aec_roi_t;
711 
712 typedef struct {
713   uint32_t frm_id;
714   uint8_t num_roi;
715   roi_t roi[MAX_ROI];
716   uint8_t is_multiwindow;
717 } roi_info_t;
718 
719 /* Exif Tag Data Type */
720 typedef enum
721 {
722     EXIF_BYTE      = 1,
723     EXIF_ASCII     = 2,
724     EXIF_SHORT     = 3,
725     EXIF_LONG      = 4,
726     EXIF_RATIONAL  = 5,
727     EXIF_UNDEFINED = 7,
728     EXIF_SLONG     = 9,
729     EXIF_SRATIONAL = 10
730 } exif_tag_type_t;
731 
732 
733 /* Exif Rational Data Type */
734 typedef struct
735 {
736     uint32_t  num;    // Numerator
737     uint32_t  denom;  // Denominator
738 
739 } rat_t;
740 
741 /* Exif Signed Rational Data Type */
742 typedef struct
743 {
744     int32_t  num;    // Numerator
745     int32_t  denom;  // Denominator
746 
747 } srat_t;
748 
749 typedef struct
750 {
751   exif_tag_type_t type;
752   uint8_t copy;
753   uint32_t count;
754   union
755   {
756     char      *_ascii;
757     uint8_t   *_bytes;
758     uint8_t    _byte;
759     uint16_t  *_shorts;
760     uint16_t   _short;
761     uint32_t  *_longs;
762     uint32_t   _long;
763     rat_t     *_rats;
764     rat_t      _rat;
765     uint8_t   *_undefined;
766     int32_t   *_slongs;
767     int32_t    _slong;
768     srat_t    *_srats;
769     srat_t     _srat;
770   } data;
771 } exif_tag_entry_t;
772 
773 typedef struct {
774     uint32_t      tag_id;
775     exif_tag_entry_t  tag_entry;
776 } exif_tags_info_t;
777 
778 
779 typedef enum {
780  HDR_BRACKETING_OFF,
781  HDR_MODE,
782  EXP_BRACKETING_MODE
783  } hdr_mode;
784 
785 typedef struct {
786   hdr_mode mode;
787   uint32_t hdr_enable;
788   uint32_t total_frames;
789   uint32_t total_hal_frames;
790   char values[MAX_EXP_BRACKETING_LENGTH];  /* user defined values */
791 } exp_bracketing_t;
792 typedef struct {
793   roi_t      mtr_area[MAX_ROI];
794   uint32_t   num_area;
795   int        weight[MAX_ROI];
796 } aec_mtr_area_t;
797 
798 typedef struct {
799   int denoise_enable;
800   int process_plates;
801 } denoise_param_t;
802 
803 #ifndef HAVE_CAMERA_SIZE_TYPE
804   #define HAVE_CAMERA_SIZE_TYPE
805 struct camera_size_type {
806   int width;
807   int height;
808 };
809 #endif
810 
811 typedef struct {
812   uint32_t yoffset;
813   uint32_t cbcr_offset;
814   uint32_t size;
815   struct camera_size_type resolution;
816 }cam_buf_info_t;
817 
818 typedef struct {
819   int x;
820   int y;
821 }cam_point_t;
822 
823 typedef struct {
824   /* AF parameters */
825   uint8_t focus_position;
826   /* AEC parameters */
827   uint32_t line_count;
828   uint8_t luma_target;
829   /* AWB parameters */
830   int32_t r_gain;
831   int32_t b_gain;
832   int32_t g_gain;
833   uint8_t exposure_mode;
834   uint8_t exposure_program;
835   float exposure_time;
836   uint32_t iso_speed;
837 } snapshotData_info_t;
838 
839 
840 typedef enum {
841   CAMERA_HFR_MODE_OFF = 1,
842   CAMERA_HFR_MODE_60FPS,
843   CAMERA_HFR_MODE_90FPS,
844   CAMERA_HFR_MODE_120FPS,
845   CAMERA_HFR_MODE_150FPS,
846 } camera_hfr_mode_t;
847 
848 /* frame Q*/
849 struct fifo_node
850 {
851   struct fifo_node *next;
852   void *f;
853 };
854 
855 struct fifo_queue
856 {
857   int num_of_frames;
858   struct fifo_node *front;
859   struct fifo_node *back;
860   pthread_mutex_t mut;
861   pthread_cond_t wait;
862   char* name;
863 };
864 
865 typedef struct {
866   uint32_t buf_len;
867   uint8_t num;
868   uint8_t pmem_type;
869   uint32_t vaddr[8];
870 } mm_camera_histo_mem_info_t;
871 
872 typedef enum {
873   MM_CAMERA_CTRL_EVT_ZOOM_DONE,
874   MM_CAMERA_CTRL_EVT_AUTO_FOCUS_DONE,
875   MM_CAMERA_CTRL_EVT_PREP_SNAPSHOT,
876   MM_CAMERA_CTRL_EVT_SNAPSHOT_CONFIG_DONE,
877   MM_CAMERA_CTRL_EVT_WDN_DONE, // wavelet denoise done
878   MM_CAMERA_CTRL_EVT_HDR_DONE,
879   MM_CAMERA_CTRL_EVT_ERROR,
880   MM_CAMERA_CTRL_EVT_MAX
881 }mm_camera_ctrl_event_type_t;
882 
883 typedef struct {
884   mm_camera_ctrl_event_type_t evt;
885   cam_ctrl_status_t status;
886   unsigned long cookie;
887 } mm_camera_ctrl_event_t;
888 
889 typedef enum {
890   MM_CAMERA_CH_EVT_STREAMING_ON,
891   MM_CAMERA_CH_EVT_STREAMING_OFF,
892   MM_CAMERA_CH_EVT_STREAMING_ERR,
893   MM_CAMERA_CH_EVT_DATA_DELIVERY_DONE,
894   MM_CAMERA_CH_EVT_DATA_REQUEST_MORE,
895   MM_CAMERA_CH_EVT_MAX
896 }mm_camera_ch_event_type_t;
897 
898 typedef struct {
899   uint32_t ch;
900   mm_camera_ch_event_type_t evt;
901 } mm_camera_ch_event_t;
902 
903 typedef struct {
904   uint32_t index;
905   /* TBD: need more fields for histo stats? */
906 } mm_camera_stats_histo_t;
907 
908 typedef struct  {
909   uint32_t event_id;
910   union {
911     mm_camera_stats_histo_t    stats_histo;
912   } e;
913 } mm_camera_stats_event_t;
914 
915 typedef enum {
916   FD_ROI_TYPE_HEADER,
917   FD_ROI_TYPE_DATA
918 } fd_roi_type_t;
919 
920 typedef struct {
921   int fd_mode;
922   int num_fd;
923 } fd_set_parm_t;
924 
925 typedef struct {
926   uint32_t frame_id;
927   int16_t num_face_detected;
928 } fd_roi_header_type;
929 
930 struct fd_rect_t {
931   uint16_t x;
932   uint16_t y;
933   uint16_t dx;
934   uint16_t dy;
935 };
936 
937 typedef struct {
938   struct fd_rect_t face_boundary;
939   uint16_t left_eye_center[2];
940   uint16_t right_eye_center[2];
941   uint16_t mouth_center[2];
942   uint8_t smile_degree;  //0 -100
943   uint8_t smile_confidence;  //
944   uint8_t blink_detected;  // 0 or 1
945   uint8_t is_face_recognised;  // 0 or 1
946   int8_t gaze_angle;  // -90 -45 0 45 90 for head left to rigth tilt
947   int8_t updown_dir;  // -90 to 90
948   int8_t leftright_dir;  //-90 to 90
949   int8_t roll_dir;  // -90 to 90
950   int8_t left_right_gaze;  // -50 to 50
951   int8_t top_bottom_gaze;  // -50 to 50
952   uint8_t left_blink;  // 0 - 100
953   uint8_t right_blink;  // 0 - 100
954   int8_t id;  // unique id for face tracking within view unless view changes
955   int8_t score;  // score of confidence( 0 -100)
956 } fd_face_type;
957 
958 typedef struct {
959   uint32_t frame_id;
960   uint8_t idx;
961   fd_face_type face;
962 } fd_roi_data_type;
963 
964 struct fd_roi_t {
965   fd_roi_type_t type;
966   union {
967     fd_roi_header_type hdr;
968     fd_roi_data_type data;
969   } d;
970 };
971 
972 typedef struct  {
973   uint32_t event_id;
974   union {
975     mm_camera_histo_mem_info_t histo_mem_info;
976     struct fd_roi_t roi;
977   } e;
978 } mm_camera_info_event_t;
979 
980 typedef struct  {
981   uint32_t trans_id;   /* transaction id */
982   uint32_t evt_type;   /* event type */
983   int32_t data_length; /* the length of valid data */
984   uint8_t evt_data[1]; /* buffer that holds the content of private event, must be flatten */
985 } mm_camera_private_event_t;
986 
987 typedef enum {
988   MM_CAMERA_EVT_TYPE_CH,
989   MM_CAMERA_EVT_TYPE_CTRL,
990   MM_CAMERA_EVT_TYPE_STATS,
991   MM_CAMERA_EVT_TYPE_INFO,
992   MM_CAMERA_EVT_TYPE_PRIVATE_EVT,
993   MM_CAMERA_EVT_TYPE_MAX
994 } mm_camera_event_type_t;
995 
996 typedef struct {
997   mm_camera_event_type_t event_type;
998   union {
999     mm_camera_ch_event_t ch;
1000     mm_camera_ctrl_event_t ctrl;
1001     mm_camera_stats_event_t stats;
1002     mm_camera_info_event_t info;
1003     mm_camera_private_event_t pri_evt;
1004   } e;
1005 } mm_camera_event_t;
1006 
1007 typedef enum {
1008   MM_CAMERA_REPRO_CMD_INVALID,
1009   MM_CAMERA_REPRO_CMD_OPEN,
1010   MM_CAMERA_REPRO_CMD_CONFIG,
1011   MM_CAMERA_REPRO_CMD_ATTACH_DETACH,
1012   MM_CAMERA_REPRO_CMD_START_STOP,
1013   MM_CAMERA_REPRO_CMD_REPROCESS,
1014   MM_CAMERA_REPRO_CMD_CLOSE,
1015   MM_CAMERA_REPRO_CMD_MAX
1016 } mmcam_repro_cmd_type_t;
1017 
1018 /* re-process isp type defintion */
1019 typedef enum {
1020   MM_CAMERA_REPRO_ISP_NOT_USED,
1021   MM_CAMERA_REPRO_ISP_PIX,
1022   MM_CAMERA_REPRO_ISP_CROP_AND_SCALING,
1023   MM_CAMERA_REPRO_ISP_COLOR_CONVERSION,
1024   MM_CAMERA_REPRO_ISP_DNOISE_AND_SHARPNESS,
1025   MM_CAMERA_REPRO_ISP_MAX_NUM
1026 } mm_camera_repro_isp_type_t;
1027 
1028 typedef struct {
1029   uint32_t addr_offset;
1030   uint32_t length;
1031   uint32_t data_offset;
1032 } mm_camera_repro_plane_t;
1033 
1034 typedef struct {
1035   uint32_t repro_handle;  /* repo isp handle */
1036   uint32_t inst_handle; /* instance handle */
1037   int8_t   buf_idx;     /* buffer index    */
1038   uint32_t frame_id;    /* frame id        */
1039   uint32_t frame_len;   /* frame length    */
1040   int8_t   num_planes;
1041   mm_camera_repro_plane_t planes[VIDEO_MAX_PLANES];
1042   struct timeval timestamp;
1043 } mm_camera_repro_cmd_reprocess_t;
1044 
1045 #define MM_CAMERA_MAX_NUM_REPROCESS_DEST 2
1046 
1047 typedef struct {
1048   uint8_t  isp_type;      /* in: mm_camera_repro_isp_type_t */
1049   uint32_t repro_handle;  /* out */
1050 } mm_camera_repro_cmd_open_t;
1051 
1052 typedef struct {
1053   int image_mode;
1054   int width;
1055   int height;
1056   cam_format_t format;
1057   uint32_t inst_handle; /* stream handler */
1058 } mm_camera_repro_config_data_t;
1059 
1060 typedef struct {
1061   uint32_t repro_handle;
1062   int num_dest;
1063   mm_camera_repro_config_data_t src;
1064   mm_camera_repro_config_data_t dest[MM_CAMERA_MAX_NUM_REPROCESS_DEST];
1065 } mm_camera_repro_cmd_config_t;
1066 
1067 typedef struct {
1068   uint32_t repro_handle;   /* repro isp handle */
1069   uint32_t inst_handle;    /* instance handle of dest stream */
1070   uint8_t  attach_flag;    /* flag: attach(TRUE)/detach(FALSE) */
1071 } mm_camera_repro_cmd_attach_detach_t;
1072 
1073 typedef struct {
1074   uint32_t repro_handle;   /* repo isp handle */
1075   uint32_t dest_handle;    /* Which destination to start/stop */
1076   uint8_t  start_flag;     /* flag: start isp(TRUE)/stop isp(FALSE) */
1077 } mm_camera_repro_cmd_start_stop_t;
1078 
1079 typedef struct {
1080   /* mm_camera_repro_cmd_type_t */
1081   int cmd;
1082   /* Union of the possible payloads for
1083    * this reprocess command. */
1084   union {
1085     /* MM_CAMERA_REPRO_CMD_OPEN */
1086     mm_camera_repro_cmd_open_t open;
1087     /* MM_CAMERA_REPRO_CMD_CONFIG */
1088     mm_camera_repro_cmd_config_t config;
1089     /* MM_CAMERA_REPRO_CMD_ATTACH_DETACH */
1090     mm_camera_repro_cmd_attach_detach_t attach_detach;
1091     /* MM_CAMERA_REPRO_CMD_REPROCESS */
1092     mm_camera_repro_cmd_reprocess_t reprocess;
1093     /* MM_CAMERA_REPRO_CMD_START_STOP */
1094     mm_camera_repro_cmd_start_stop_t start_stop;
1095     /* MM_CAMERA_REPRO_CMD_CLOSE */
1096     uint32_t repro_handle;
1097   } payload;
1098 } mm_camera_repro_cmd_t;
1099 
1100 typedef struct {
1101   /*input parameter*/
1102   int enable;
1103   /*output parameter*/
1104   uint32_t mobicat_size;
1105 }mm_cam_mobicat_info_t;
1106 
1107 #define MAX_MOBICAT_SIZE 8092
1108 
1109 /*
1110   WARNING: Since this data structure is huge,
1111   never use it as local variable, otherwise, it so easy to cause
1112   stack overflow
1113   Always use malloc to allocate heap memory for it
1114 */
1115 typedef struct {
1116   int max_len;   //telling the client max sizen of tags, here 10k.
1117   int data_len;  //client return real size including null "\0".
1118   char tags[MAX_MOBICAT_SIZE];
1119 } cam_exif_tags_t;
1120 
1121 /******************************************************************************
1122  * Function: exif_set_tag
1123  * Description: Inserts or modifies an Exif tag to the Exif Info object. Typical
1124  *              use is to call this function multiple times - to insert all the
1125  *              desired Exif Tags individually to the Exif Info object and
1126  *              then pass the info object to the Jpeg Encoder object so
1127  *              the inserted tags would be emitted as tags in the Exif header.
1128  * Input parameters:
1129  *   obj       - The Exif Info object where the tag would be inserted to or
1130  *               modified from.
1131  *   tag_id    - The Exif Tag ID of the tag to be inserted/modified.
1132  *   p_entry   - The pointer to the tag entry structure which contains the
1133  *               details of tag. The pointer can be set to NULL to un-do
1134  *               previous insertion for a certain tag.
1135  * Return values:
1136  *     JPEGERR_SUCCESS
1137  *     JPEGERR_ENULLPTR
1138  *     JPEGERR_EFAILED
1139  * (See jpegerr.h for description of error values.)
1140  * Notes: none
1141  *****************************************************************************/
1142 int exif_set_tag(exif_info_obj_t    obj,
1143                  exif_tag_id_t      tag_id,
1144                  exif_tag_entry_t  *p_entry);
1145 
1146 
1147 #endif /* __QCAMERA_INTF_H__ */
1148