Initial release
[adaptation/ap_samsung/gst-plugins-s5pc2xx.git] / camerasrc / src / include / camerasrc.h
1 /*
2  * camerasrc
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jeongmo Yang <jm80.yang@samsung.com>
7  *
8  * This library is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU Lesser General Public License as published by the
10  * Free Software Foundation; either version 2.1 of the License, or (at your option)
11  * any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
14  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
15  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16  * License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; if not, write to the Free Software Foundation, Inc., 51
20  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  */
23
24 #ifndef __CAMERASRC_H__
25 #define __CAMERASRC_H__
26
27 #include <stdint.h> /* to use uint64_t */
28 #include <camerasrc-error.h>
29 #include <mm_ta.h>
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /* GENERAL DEFINITIONS */
35 /**
36  * Type definition of av camera src handle.
37  */
38 typedef void *camsrc_handle_t;
39
40
41 /* ENUMERATION DEFINITIONS */
42 /*! @enum camerasrc_state_t
43  *  @brief Enumeration type for state transition
44  */
45 typedef enum {
46     CAMERASRC_STATE_NONE = 0,
47     CAMERASRC_STATE_CREATED,
48     CAMERASRC_STATE_REALIZED,
49     CAMERASRC_STATE_READY,
50     CAMERASRC_STATE_PREVIEW,
51     CAMERASRC_STATE_STILL,
52     CAMERASRC_STATE_VIDEO,
53     CAMERASRC_STATE_UNREALIZED,
54     CAMERASRC_STATE_DESTROYED,
55     CAMERASRC_STATE_AF_IN_PROGRESS,
56 }camerasrc_state_t;
57
58 /*! @enum camerasrc_dev_id_t
59  *  @brief Enumeration type for camera device ID
60  *
61  *  Devices will be managed by this IDs. (Independent with device index of V4L2)
62  */
63 typedef enum {
64     CAMERASRC_DEV_ID_PRIMARY,           /**< Higher resolution camera*/
65     CAMERASRC_DEV_ID_SECONDARY,         /**< Lower resolution camera*/
66     CAMERASRC_DEV_ID_EXTENSION,         /**< reserved for extension*/
67     CAMERASRC_DEV_ID_UNKNOWN,           /**< reserved for extension*/
68     CAMERASRC_DEV_ID_NUM,               /**< Number of IDs*/
69 }camerasrc_dev_id_t;
70
71 typedef enum {
72     CAMERASRC_COLOR_VIOLET = 0,
73     CAMERASRC_COLOR_PURPLE,
74     CAMERASRC_COLOR_MAGENTA_1,
75     CAMERASRC_COLOR_MAGENTA_2,
76     CAMERASRC_COLOR_RED_1,
77     CAMERASRC_COLOR_RED_2,
78     CAMERASRC_COLOR_BROWN,
79     CAMERASRC_COLOR_YELLOW,
80     CAMERASRC_COLOR_GREEN_1,
81     CAMERASRC_COLOR_GREEN_2,
82     CAMERASRC_COLOR_GREEN_3,
83     CAMERASRC_COLOR_GREEN_4,
84     CAMERASRC_COLOR_COBALT_BLUE,
85     CAMERASRC_COLOR_CYAN,
86     CAMERASRC_COLOR_BLUE_1,
87     CAMERASRC_COLOR_BLUE_2,
88     CAMERASRC_COLOR_GRAY,
89     CAMERASRC_COLOR_NUM,
90 }camerasrc_color_t;
91
92 typedef enum {
93     CAMERASRC_PARTCOLOR_MODE_NONE = 0,
94     CAMERASRC_PARTCOLOR_MODE_SWAP,
95     CAMERASRC_PARTCOLOR_MODE_ACCENT,
96     CAMERASRC_PARTCOLOR_MODE_NUM,
97 }camerasrc_partcolor_mode_t;
98
99 /*! @enum camerasrc_ctrl_t
100  *  @brief Enumeration type for camera controls
101  *
102  *  Special control entries for camera effects
103  *
104  *  @remark Strobo can be controlled by this entry and ::camerasrc_set_strobo_status
105  */
106 typedef enum {
107     CAMERASRC_CTRL_BRIGHTNESS = 0,          /**< Brightness control entry*/
108     CAMERASRC_CTRL_CONTRAST,                /**< Contrast control entry*/
109     CAMERASRC_CTRL_DIGITAL_ZOOM,            /**< Digital zoom control entry*/
110     CAMERASRC_CTRL_OPTICAL_ZOOM,            /**< Optical zoom control entry*/
111     CAMERASRC_CTRL_WHITE_BALANCE,           /**< White balance control entry*/
112     CAMERASRC_CTRL_COLOR_TONE,              /**< Color tone control entry*/
113     CAMERASRC_CTRL_PROGRAM_MODE,            /**< Program mode control entry*/
114     CAMERASRC_CTRL_FLIP,                    /**< Flip control entry*/
115     CAMERASRC_CTRL_PARTCOLOR_SRC,           /**< Partcolor effect source */
116     CAMERASRC_CTRL_PARTCOLOR_DST,           /**< Partcolor effect destination */
117     CAMERASRC_CTRL_PARTCOLOR_MODE,          /**< Partcolor effect mode */
118     CAMERASRC_CTRL_ANTI_HANDSHAKE,          /**< Anti-handshake control, 0:OFF / 1:ON / 2:AUTO / 3:MOVIE */
119     CAMERASRC_CTRL_WIDE_DYNAMIC_RANGE,      /**< wide dynamic control, 0:OFF / 1:ON / 2:AUTO */
120     CAMERASRC_CTRL_SATURATION,              /**< Saturation value control */
121     CAMERASRC_CTRL_SHARPNESS,               /**< Sharpness value control */
122     CAMERASRC_CTRL_ISO,                     /**< Sensor sensitivity*/
123     CAMERASRC_CTRL_PHOTOMETRY,              /**< Exposure mode*/
124     CAMERASRC_CTRL_NUM,                     /**< Number of Controls*/
125 }camerasrc_ctrl_t;
126
127 /*! @enum camerasrc_af_mode_t
128  *  @brief AF operation mode
129  */
130 typedef enum {
131     CAMERASRC_AF_MODE_AUTO = 0,      /**< Auto Focus */
132     CAMERASRC_AF_MODE_MANUAL,        /**< Manual Focus */
133     CAMERASRC_AF_MODE_PAN,           /**< Pan Focus */
134     CAMERASRC_AF_MODE_TOUCH_AUTO,    /**< Touch Auto Focus */
135     CAMERASRC_AF_MODE_CONTINUOUS,    /**< Continuous Focus */
136     CAMERASRC_AF_MODE_NUM,           /**< Number of AF modes */
137 }camerasrc_af_mode_t;
138
139 /*! @enum camerasrc_af_scan_range_t
140  *  @brief AF scan range
141  *  AF scan range
142  */
143 typedef enum {
144     CAMERASRC_AF_RANGE_NORMAL = 0,   /**< Scan autofocus in normal range */
145     CAMERASRC_AF_RANGE_MACRO,        /**< Scan autofocus in macro range(close distance) */
146     CAMERASRC_AF_RANGE_FULL,         /**< Scan autofocus in full range(all range scan, limited by dev spec) */
147     CAMERASRC_AF_RANGE_NUM,          /**< Number of AF range types */
148 }camerasrc_af_scan_range_t;
149
150 /*! @enum camerasrc_resol_name_t
151  *  @brief Enumeration type of resolution settings based on traditional resolution name
152  *  Means pixel order of contents.
153  *  @remark In the Grandprix, only YUV422P & RGGB8 is used
154  */
155 typedef enum {
156     CAMERASRC_RESOL_QQCIF = 0,          /**< 88 x 72 */
157     CAMERASRC_RESOL_QQVGA,              /**< 160 x 120 */
158     CAMERASRC_RESOL_QCIF,               /**< 176 x 144 */
159     CAMERASRC_RESOL_QVGA,               /**< 320 x 240 */
160     CAMERASRC_RESOL_CIF,                /**< 352 x 288 */
161     CAMERASRC_RESOL_VGA,                /**< 640 x 480 */
162     CAMERASRC_RESOL_WVGA,               /**< 800 x 480 */
163     CAMERASRC_RESOL_SVGA,               /**< 800 x 600 */
164     CAMERASRC_RESOL_WSXGA,              /**< 1280 x 960 (1M) */
165     CAMERASRC_RESOL_UXGA,               /**< 1600 x 1200 (2M) */
166     CAMERASRC_RESOL_QXGA,               /**< 2048 x 1536 (3M) */
167     CAMERASRC_RESOL_WQSXGA,             /**< 2560 x 1920 (5M) */
168     CAMERASRC_RESOL_720P,               /**< 1280 x 720 (720P) */
169     CAMERASRC_RESOL_WQVGA,              /**< 400 x 240 */
170     CAMERASRC_RESOL_RQVGA,              /**< 240 x 320 */
171     CAMERASRC_RESOL_RWQVGA,             /**< 240 x 400 */
172     CAMERASRC_RESOL_QVGA_60FPS,         /**< 320 x 240 60FPS(Slow motion I) */
173     CAMERASRC_RESOL_QVGA_120FPS,        /**< 320 x 240 60FPS(Slow motion II) */
174     CAMERASRC_RESOL_NUM,
175 }camerasrc_resol_name_t;
176
177 /*! @enum camerasrc_pix_format_t
178  *  @brief Means order of pixel of contents
179  *  Means pixel order of contents.
180  *  @remark In the Grandprix, only YUV422P & RGGB8 is used
181  */
182 typedef enum {
183     CAMERASRC_PIX_NONE = -1,      /**< Default value or Not supported */
184     CAMERASRC_PIX_YUV422P = 0,    /**< Pixel format like YYYYYYYYUUUUVVVV*/
185     CAMERASRC_PIX_YUV420P,        /**< Pixel format like YYYYYYYYUUVV*/
186     CAMERASRC_PIX_YUV420,         /**< Pixel format like YYYYYYYYUVUV*/
187     CAMERASRC_PIX_SN12,           /**< YUV420 (interleaved, non-linear) */
188     CAMERASRC_PIX_ST12,           /**< YUV420 (interleaved, tiled, non-linear) */
189     CAMERASRC_PIX_YUY2,           /**< YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel */
190     CAMERASRC_PIX_RGGB8,          /**< Raw RGB Pixel format like CCD order, a pixel consists of 8 bits, Actually means JPEG + JPEG image output */
191     CAMERASRC_PIX_RGGB10,         /**< Raw RGB Pixel format like CCD order, a pixel consists of 10 bits, Actually means JPEG + YUV image output */
192     CAMERASRC_PIX_RGB565,         /**< Raw RGB Pixel format like CCD order, a pixel consists of 10 bits, Actually means JPEG + YUV image output */
193     CAMERASRC_PIX_UYVY,           /**< YUV 4:2:2 */
194     CAMERASRC_PIX_NV12,           /**< YUV 4:2:0, 8-bit Y plane followed by an interleaved U/V plane with 2x2 subsampling */
195     CAMERASRC_PIX_INTERLEAVED,    /**< JPEG/YUYV interleaved data format for zero shutter lag */
196     CAMERASRC_PIX_NUM,            /**< Number of pixel formats*/
197 }camerasrc_pix_format_t;
198
199 /*! @enum camerasrc_colorspace_t
200  *  @brief Means stored order or compressed status of image.
201  *  Means stored order or compressed status of image. supplements of camerasrc_pix_format_t
202  *
203  *  @note RAW means RGB/YUV pixel data, JPEG means compressed JPG file with marker information(header)
204  */
205 typedef enum {
206     CAMERASRC_COL_NONE = -1,    /**< Default value or Not supported */
207     CAMERASRC_COL_RAW,          /**< Non-compressed RGB/YUV pixel data*/
208     CAMERASRC_COL_JPEG,         /**< Compressed jpg data*/
209     CAMERASRC_COL_NUM,          /**< Number of colorspace data*/
210 }camerasrc_colorspace_t;
211
212 /*! @enum camerasrc_auto_focus_status_t
213  *  @brief AF status
214  *  AF status
215  */
216 typedef enum {
217     CAMERASRC_AUTO_FOCUS_STATUS_RELEASED,       /**< AF status released.*/
218     CAMERASRC_AUTO_FOCUS_STATUS_ONGOING,        /**< AF in progress*/
219     CAMERASRC_AUTO_FOCUS_STATUS_NUM,            /**< Number of AF status*/
220 }camerasrc_auto_focus_status_t;
221
222 /*! @enum camerasrc_auto_focus_cmd_t
223  *  @brief AF status
224  *  AF status
225  */
226 typedef enum {
227     CAMERASRC_AUTO_FOCUS_CMD_NULL,              /**< Null command.*/
228     CAMERASRC_AUTO_FOCUS_CMD_START,             /**< Start AF.*/
229     CAMERASRC_AUTO_FOCUS_CMD_STOP,              /**< Stop AF.*/
230     CAMERASRC_AUTO_FOCUS_CMD_KILL,              /**< Kill AF thread.*/
231     CAMERASRC_AUTO_FOCUS_CMD_NUM,               /**< Number of AF command*/
232 }camerasrc_auto_focus_cmd_t;
233
234 /*! @enum camerasrc_auto_focus_result_t
235  *  @brief AF status
236  *  AF status
237  */
238 typedef enum {
239     CAMERASRC_AUTO_FOCUS_RESULT_FOCUSED = 2,    /**< Focused.*/
240     CAMERASRC_AUTO_FOCUS_RESULT_FAILED,         /**< AF failed.*/
241     CAMERASRC_AUTO_FOCUS_RESULT_NUM,            /**< Number of AF result*/
242 }camerasrc_auto_focus_result_t;
243
244 /*! @enum camerasrc_ae_lock_t
245  *  @brief
246  */
247 typedef enum {
248     CAMERASRC_AE_LOCK = 0,
249     CAMERASRC_AE_UNLOCK,
250     CAMERASRC_AE_NUM,
251 }camerasrc_ae_lock_t;
252
253 /*! @enum camerasrc_io_method_t
254  *  @brief
255  */
256 typedef enum {
257     CAMERASRC_IO_METHOD_READ= 0,
258     CAMERASRC_IO_METHOD_MMAP,
259     CAMERASRC_IO_METHOD_USRPTR,
260     CAMERASRC_IO_METHOD_NUM,
261 }camerasrc_io_method_t;
262
263 /*! @enum camerasrc_buffer_queued_status
264  *  @brief
265  */
266 typedef enum {
267         CAMERASRC_BUFFER_QUEUED   = 0,
268         CAMERASRC_BUFFER_DEQUEUED = 1,
269 }camerasrc_buffer_queued_status;
270
271
272 /* STRUCTURE DEFINITIONS */
273
274 typedef struct _camerasrc_rect_t {
275     int x;
276     int y;
277     int width;
278     int height;
279 } camerasrc_rect_t;
280
281 /*! @struct camsrc_frac_t
282  *  @brief Time per frame or frame per second will be expressed by this structure
283  *  Time per frame or frame per second will be expressed by this structure
284  */
285 typedef struct _camerasrc_frac_t {
286     int numerator;              /**< Upper number of fraction*/
287     int denominator;            /**< Lower number of fraction*/
288 } camerasrc_frac_t;
289
290 /*! @struct camerasrc_buffer_t
291  *  @brief data buffer
292  *  Image data buffer
293  */
294 typedef struct _camerasrc_buffer_t {
295         unsigned int length;                            /**< Size of stored data*/
296         unsigned char* start;                           /**< Start address of data*/
297         camerasrc_buffer_queued_status queued_status;   /**< Queued or Dequeued status */
298 } camerasrc_buffer_t;
299
300 /*! @struct camerasrc_usr_buf_t
301  *  @brief data buffer set to present usrptr buffer to camsrctem
302  *  Image data buffer set
303  */
304 typedef struct {
305     camerasrc_buffer_t* present_buffer;
306     unsigned int num_buffer;
307 } camerasrc_usr_buf_t;
308
309 /*! @struct camerasrc_dimension_t
310  *  @brief For non-regular size resolution
311  *  width and height can be set independently
312  */
313 typedef struct _camerasrc_dimension_t {
314     int width;
315     int height;
316 } camerasrc_dimension_t;
317
318 /*! @union  camerasrc_size_t
319  *  @brief Size can be expressed by resolution name(predefined) and dimension(x, y)
320  */
321 typedef union _camerasrc_size_t {
322     camerasrc_resol_name_t res;         /**< Predefined resolution name */
323     camerasrc_dimension_t dim;          /**< Dimensional expression */
324 } camerasrc_size_t;
325
326 /*! @struct camerasrc_format_t
327  *  @brief Format description structure
328  *  in/output format description structure just like v4l2_format
329  */
330 typedef struct _camerasrc_format_t {
331     camerasrc_size_t img_size;
332     camerasrc_size_t thumb_size;        /**< Thumbnail size. Only effective with CAMERASRC_PIX_RGGB8 or CAMERASRC_PIX_RGGB10 */
333     camerasrc_pix_format_t pix_format;  /**< pixel order format*/
334     int num_planes;                     /**< bytes per a line*/
335     int bytesperline;                   /**< bytes per a line*/
336     int sizeimage;                      /**< size of whole image*/
337     camerasrc_colorspace_t colorspace;  /**< stored status of image*/
338     unsigned int quality;               /**< jpeg compress ratio*/
339     unsigned int is_highquality_mode;   /**< picture quality is high or normal */
340     int rotation;                       /**< Rotation angle of camera input */
341 } camerasrc_format_t;
342
343 typedef struct _camerasrc_ctrl_query_t {
344     int support;                        /**<1: support, 0: Not support, -1: extra support(Non v4l2)*/
345     int max;                            /**<Integer max value(includes enums)*/
346     int min;                            /**<Integer min value(includes enums)*/
347 }camerasrc_ctrl_query_t;
348
349 typedef struct _camerasrc_exif_t {
350     /* Dynamic value */
351     unsigned int exposure_time_numerator;       /**< Exposure time, given in seconds */
352     unsigned int exposure_time_denominator;
353     int shutter_speed_numerator;                /**< Shutter speed, given in APEX(Additive System Photographic Exposure) */
354     int shutter_speed_denominator;
355     int brigtness_numerator;                    /**< Value of brightness, before firing flash, given in APEX value */
356     int brightness_denominator;
357     unsigned short int iso;                     /**< Sensitivity value of sensor */
358     unsigned short int flash;                   /**< Whether flash is fired(1) or not(0) */
359     int metering_mode;                          /**< metering mode in EXIF 2.2 */
360     int exif_image_width;                       /**< Size of image */
361     int exif_image_height;
362     int exposure_bias_in_APEX;                  /**< Exposure bias in APEX standard */
363     int software_used;                          /**< Firmware S/W version */
364     int focal_len_numerator;                    /**< Lens focal length (f = 4.5mm) */
365     int focal_len_denominator;
366     int aperture_f_num_numerator;               /**< Aperture value (f_num = 2.8) */
367     int aperture_f_num_denominator;
368     int aperture_in_APEX;                       /**< Aperture value in APEX standard */
369     int max_lens_aperture_in_APEX;              /**< Max aperture value in APEX standard */
370
371     /* Fixed value */
372     int component_configuration;                /**< color components arrangement (YCbCr = 1230) */
373     int colorspace;                             /**< colorspace information (sRGB=1) */
374 }camerasrc_exif_t;
375
376 typedef struct _camerasrc_frame_data_t {
377     int          index;
378     unsigned int phyAddrY;
379     unsigned int phyAddrCbCr;
380     unsigned int virAddrY;
381     unsigned int virAddrCbCr;
382 }camerasrc_frame_data_t;
383
384 /* JPEG/YUV interleaved data */
385 #define INTERLEAVED_JPEG_MAX_SIZE               (1024*1024*6)  /* 6 Mbyte */
386
387 /* Fixed focal length and aperture f-number */
388 #define CAMERASRC_PRIMARY_FOCAL_LEGNTH_NUM      397
389 #define CAMERASRC_PRIMARY_FOCAL_LEGNTH_DENOM    100
390 #define CAMERASRC_PRIMARY_F_NUMBER_NUM          265
391 #define CAMERASRC_PRIMARY_F_NUMBER_DENOM        100
392 #define CAMERASRC_SECONDARY_FOCAL_LEGNTH_NUM    273
393 #define CAMERASRC_SECONDARY_FOCAL_LEGNTH_DENOM  100
394 #define CAMERASRC_SECONDARY_F_NUMBER_NUM        28
395 #define CAMERASRC_SECONDARY_F_NUMBER_DENOM      10
396
397 /* For Query functionalities
398    For Querying capabilities */
399 /*! Use static size of structures for querying because of performance
400  */
401
402 #define MAX_NUM_FMT_DESC        32
403 #define MAX_NUM_RESOLUTION      32
404 #define MAX_NUM_AVAILABLE_TPF   16
405 #define MAX_NUM_AVAILABLE_FPS   16
406 #define MAX_NUM_CTRL_LIST_INFO  64
407 #define MAX_NUM_CTRL_MENU       64
408 #define MAX_SZ_CTRL_NAME_STRING 32
409 #define MAX_SZ_DEV_NAME_STRING  32
410
411 enum{
412     CAMERASRC_FCC_USE_NONE              = 0x00000001,
413     CAMERASRC_FCC_USE_REC_PREVIEW       = 0x00000010,
414     CAMERASRC_FCC_USE_CAP_PREVIEW       = 0x00000100,
415     CAMERASRC_FCC_USE_RECORDING         = 0x00001000,
416     CAMERASRC_FCC_USE_NORMAL_CAPTURE    = 0x00010000,
417     CAMERASRC_FCC_USE_CONT_CAPTURE      = 0x00100000,
418     CAMERASRC_FCC_USE_NUM               = 6,
419 };
420
421 /*! @struct camerasrc_tpf_frac_t
422  *  @brief For timeperframe as fraction type
423  *  Elapse time consumed by one frame, reverse of FPS
424  */
425 typedef struct {
426     int num;
427     int den;
428 }camerasrc_tpf_frac_t;
429
430 /*! @struct camerasrc_resolution_t
431  *  @brief For querying supported resolutions
432  */
433 typedef struct {
434     int w;
435     int h;
436
437     /* Available time per frame(tpf) as each pixelformat */
438     int num_avail_tpf;
439     camerasrc_tpf_frac_t tpf[MAX_NUM_AVAILABLE_TPF];
440 } camerasrc_resolution_t;
441
442 /*! @struct camerasrc_fmt_desc_t
443  *  @brief For querying supported format type
444  */
445 typedef struct {
446     /* fourcc name of each pixelformat */
447     unsigned int fcc;
448     int fcc_use;
449
450     /* Available resolutions as each pixelformat */
451     int num_resolution;
452     camerasrc_resolution_t resolutions[MAX_NUM_RESOLUTION];
453 } camerasrc_fmt_desc_t;
454
455 /*! @struct camerasrc_caps_info_t
456  *  @brief For querying image input capabilities
457  */
458 typedef struct {
459     char dev_name[MAX_SZ_DEV_NAME_STRING];
460     camerasrc_dev_id_t input_id;
461     int num_fmt_desc;
462     camerasrc_fmt_desc_t fmt_desc[MAX_NUM_FMT_DESC];
463
464     int num_preview_resolution;
465     int preview_resolution_width[MAX_NUM_RESOLUTION];
466     int preview_resolution_height[MAX_NUM_RESOLUTION];
467
468     int num_capture_resolution;
469     int capture_resolution_width[MAX_NUM_RESOLUTION];
470     int capture_resolution_height[MAX_NUM_RESOLUTION];
471
472     int num_preview_fmt;
473     unsigned int preview_fmt[MAX_NUM_FMT_DESC];
474
475     int num_capture_fmt;
476     unsigned int capture_fmt[MAX_NUM_FMT_DESC];
477
478     int num_fps;
479     camerasrc_frac_t fps[MAX_NUM_AVAILABLE_FPS];
480 } camerasrc_caps_info_t;
481
482 /* For Querying controls */
483 enum {
484     CTRL_TYPE_RANGE = 0,                                        /**< Integer, range type */
485     CTRL_TYPE_BOOL,                                             /**< Boolean type, 1 equals positive and 0 is negative */
486     CTRL_TYPE_ARRAY,                                            /**< Array type, also called menu type. each integer(enumeration) value can be set */
487     CTRL_TYPE_UNKNOWN,                                          /**< Unknown type, for error control */
488     CTRL_TYPE_NUM,
489 };
490
491 /*! @struct camerasrc_ctrl_menu_t
492  *  @brief For querying menu of specified controls
493  */
494 typedef struct {
495     int menu_index;                                             /**< What number is used for accessing this menu */
496     char menu_name[MAX_SZ_CTRL_NAME_STRING];                    /**< name of each menu */
497 }camerasrc_ctrl_menu_t;
498
499 /*! @struct camerasrc_ctrl_info_t
500  *  @brief For querying controls detail
501  */
502 typedef struct {
503     camerasrc_ctrl_t camsrc_ctrl_id;                             /**< camsrc camera control ID for controlling this */
504     int v4l2_ctrl_id;                                           /**< v4l2 ctrl id, user not need to use this. see @struct camerasrc_ctrl_t */
505     int ctrl_type;                                              /**< Type of this control */
506     char ctrl_name[MAX_SZ_CTRL_NAME_STRING];                    /**< Name of this control */
507     int min;                                                    /**< minimum value */
508     int max;                                                    /**< maximum value */
509     int step;                                                   /**< unit of the values */
510     int default_val;                                            /**< Default value of the array or range */
511     int num_ctrl_menu;                                          /**< In the case of array type control, number of supported menu information */
512     camerasrc_ctrl_menu_t ctrl_menu[MAX_NUM_CTRL_MENU];         /**< @struct camerasrc_ctrl_menu_t for detailed each menu information*/
513 } camerasrc_ctrl_info_t;
514
515 /*! @struct camerasrc_ctrl_list_info_t
516  *  @brief For querying controls
517  */
518 typedef struct {
519     int num_ctrl_list_info;                                     /**< Number of supported controls */
520     camerasrc_ctrl_info_t ctrl_info[MAX_NUM_CTRL_LIST_INFO];    /**< @struct camerasrc_ctrl_info_t for each control information */
521 } camerasrc_ctrl_list_info_t;
522
523
524 /* capabilities field */
525 #define CAMERASRC_STROBE_CAP_NONE               0x0000  /* No strobe supported */
526 #define CAMERASRC_STROBE_CAP_OFF                0x0001  /* Always flash off mode */
527 #define CAMERASRC_STROBE_CAP_ON                 0x0002  /* Always use flash light mode */
528 #define CAMERASRC_STROBE_CAP_AUTO               0x0004  /* Flashlight works automatic */
529 #define CAMERASRC_STROBE_CAP_REDEYE             0x0008  /* Red-eye reduction */
530 #define CAMERASRC_STROBE_CAP_SLOWSYNC           0x0010  /* Slow sync */
531 #define CAMERASRC_STROBE_CAP_FRONT_CURTAIN      0x0020  /* Front curtain */
532 #define CAMERASRC_STROBE_CAP_REAR_CURTAIN       0x0040  /* Rear curtain */
533 #define CAMERASRC_STROBE_CAP_PERMANENT          0x0080  /* keep turned on until turning off */
534 #define CAMERASRC_STROBE_CAP_EXTERNAL           0x0100  /* use external strobe */
535
536 typedef struct _camerasrc_extra_info_t{
537     unsigned int strobe_caps;                                   /**< Use above caps field */
538     unsigned int detection_caps;                                /**< Just boolean */
539     unsigned int reserved[4];
540 } camerasrc_extra_info_t;
541 /* END For Query functionalities */
542
543 /*! @def CAMERASRC_SET_SIZE_BY_DIMENSION
544  *  @brief Utility definitions for setting non-regular size
545  */
546 #define CAMERASRC_SET_SIZE_BY_DIMENSION(format, img_width, img_height) { \
547     format.img_size.dim.width = img_width; \
548     format.img_size.dim.height = img_height; \
549 }
550
551
552 /* CALLBACK DEFINITIONS */
553 /*! @typedef camerasrc_callback_t
554  *  @brief Called back when auto-focusing returns
555  *  This callback will be called when the lens properly auto-focused
556  */
557 typedef int (*camerasrc_callback_t) (camsrc_handle_t handle, int state, void* usr_data);
558
559 /* Static variables */
560 /**
561  * Label for camera control. This static variable has a label for each of camerasrc_ctrl_t enumeration.
562  * When enumeration of camerasrc_ctrl_t is increased, this variable should be increased, too.
563  * This string could be used as a key by user.
564  * Reference : camerasrc_ctrl_t, _camerasrc_ctrl_list
565  */
566
567 static char *camerasrc_ctrl_label[CAMERASRC_CTRL_NUM] =
568 {
569     "brightness",               /**< label for CAMERASRC_CTRL_BRIGHTNESS */
570     "contrast",                 /**< label for CAMERASRC_CTRL_CONTRAST */
571     "digital zoom",             /**< label for CAMERASRC_CTRL_DIGITAL_ZOOM */
572     "optical zoom",             /**< label for CAMERASRC_CTRL_OPTICAL_ZOOM */
573     "white balance",            /**< label for CAMERASRC_CTRL_WHITE_BALANCE */
574     "color tone",               /**< label for CAMERASRC_CTRL_COLOR_TONE */
575     "program mode",             /**< label for CAMERASRC_CTRL_PROGRAM_MODE */
576     "flip",                     /**< label for CAMERASRC_CTRL_FLIP */
577     "partcolor src",            /**< label for CAMERASRC_CTRL_PARTCOLOR_SRC */
578     "partcolor dst",            /**< label for CAMERASRC_CTRL_PARTCOLOR_DST */
579     "partcolor mode",           /**< label for CAMERASRC_CTRL_PARTCOLOR_MODE */
580     "anti handshake",           /**< label for CAMERASRC_CTRL_ANTI_HANDSHAKE */
581     "wide dynamic range",       /**< label for CAMERASRC_CTRL_WIDE_DYNAMIC_RANGE */
582     "saturation",               /**< label for CAMERASRC_CTRL_SATURATION */
583     "sharpness",                /**< label for CAMERASRC_CTRL_SHARPNESS */
584     "iso",                      /**< label for CAMERASRC_CTRL_ISO */
585     "photometry",               /**< label for CAMERASRC_CTRL_PHOTOMETRY */
586 };
587
588 /* FUNCTION DEFINITIONS */
589
590 /**** M A I N    O P E R A T I O N ****/
591
592 /**
593  * allocate the handle, set initial state & settings
594  *
595  * @param[in]           phandle ::camsrc_handle_t camerasrc context handle to be created
596  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t code
597  * @see                 camerasrc_destroy
598  * @note                State transition : [CAMERASRC_STATE_NONE] => [CAMERASRC_STATE_CREATED]
599  *                      Phase description : Non-running phase
600  */
601 int camerasrc_create(camsrc_handle_t *phandle);
602
603 /**
604  * proceed fd close, other finalization routines
605  *
606  * @param[in] handle ::camsrc_handle_t camerasrc context handle
607  *
608  * @return Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t code
609  *
610  * @see <camerasrc_create>
611  *
612  * @note State transition : [CAMERASRC_STATE_UNREALIZED] => [CAMERASRC_STATE_DESTROYED]
613  *       Phase description : Non-running phase
614  */
615 int camerasrc_destroy(camsrc_handle_t handle);
616
617 /**
618  * free device context handle, other finalization routines
619  *
620  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
621  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t code
622  * @see                 camerasrc_create
623  * @note                State transition : [CAMERASRC_STATE_UNREALIZED] => [CAMERASRC_STATE_DESTROYED]
624  *                      Phase description : Non-running phase
625  */
626 int camerasrc_close_device(camsrc_handle_t handle);
627
628 /**
629  * Get the state of camerasrc context handle
630  *
631  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
632  * @param[out]          state  ::camerasrc_state_t camerasrc context current state
633  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t code
634  *
635  */
636 int camerasrc_get_state(camsrc_handle_t handle, camerasrc_state_t* state);
637
638 /**
639  * Allocate the device context handle, open device node and do the miscellaneous settings
640  *
641  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
642  * @return              Success on ::camerasrc_handle_t or returns NULL code, and displays debug message
643  * @see                 camerasrc_unrealize
644  * @note                State transition : [CAMERASRC_STATE_CREATED] => [CAMERASRC_STATE_REALIZED]
645  *                      Phase description : Non-running phase
646  *                      device name can be dependent on kernel module
647  */
648 int camerasrc_realize(camsrc_handle_t handle);
649
650 /**
651  * Deallocate the device structure of buffers, close device
652  *
653  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
654  * @return              Success on ::camerasrc_handle_t or returns NULL code, and displays debug message
655  * @see                 camerasrc_realize
656  * @note                State transition : [CAMERASRC_STATE_READY] => [CAMERASRC_STATE_UNREALIZED]
657  *                      Phase description : Transit to Non-running phase
658  */
659 int camerasrc_unrealize(camsrc_handle_t handle);
660
661 /**
662  * Prepare Handle to be ready to capture
663  * Can change settings like below at this state
664  * - camera device ID setting
665  * - color format setting
666  * - image size setting
667  * - image storing method
668  *
669  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
670  * @return              Success on ::camerasrc_handle_t or returns NULL code, and displays debug message
671  * @see                 camerasrc_stop
672  * @note                State transition : [CAMERASRC_STATE_REALIZED] => [CAMERASRC_STATE_READY]
673  *                      Phase description : Running phase
674  */
675 int camerasrc_start(camsrc_handle_t handle);
676
677 /**
678  * Present user buffer to camerasrc and force to use that buffer.
679  * After calling this API, all core routine of camerasrc camera will use
680  * User pointer method for managing buffers.
681  *
682  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
683  * @param[in]           present_buf ::camerasrc_usr_buf_t Buffer set to present to camerasrc
684  * @param[in]           io_method ::camerasrc_io_method_t Enum type represent to IO method
685  * @return Success on ::camsrc_handle_t or returns NULL code, and displays debug message
686  * @see                 camerasrc_io_method_t
687  *
688  */
689 int camerasrc_present_usr_buffer(camsrc_handle_t handle, camerasrc_usr_buf_t* present_buf, camerasrc_io_method_t io_method);
690
691 /**
692  * Get total number of buffer which managed in camerasrc currently.
693  * If this called, it will return default number of buffer in MMAP mode.
694  * but use this API after calling ::camerasrc_present_usr_buffer , It will
695  * return User specfied buffer number.
696  *
697  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
698  * @param[in]           num_buffer Number of buffer that's managed in camerasrc currently
699  * @return              Success on ::camsrc_handle_t or returns NULL code, and displays debug message
700  * @see                 camerasrc_io_method_t
701  *
702  */
703 int camerasrc_get_num_buffer(camsrc_handle_t handle, unsigned int* num_buffer);
704
705 /**
706  * Get Input/Output method which is used when access camera driver
707  *
708  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
709  * @param[in]           io_method ::camerasrc_io_method_t method enum value
710  * @return              Success on ::camsrc_handle_t or returns NULL code, and displays debug message
711  * @see                 camerasrc_io_method_t
712  *
713  */
714 int camerasrc_get_io_method(camsrc_handle_t handle, camerasrc_io_method_t* io_method);
715
716 /**
717  * Inner ring buffer start refreshing. refresh process occurs asynchronously, and
718  * ::camerasrc_wait_frame_available function can anounce when it is available.
719  *
720  * Camera is grabbing High quality, maybe low speed frame(dependent on device)
721  * - Cant approach the [AF] state
722  * - preview frames arent always automatically fed. If not, must request repeatedly
723  * - If device supports continuous focusing, it can be enabled at this state in case
724  *   of multishot.
725  *
726  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
727  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
728  * @note                State transition : [CAMERASRC_STATE_READY] => [CAMERASRC_STATE_STILL]
729  *                      Phase description : Running phase
730  */
731 int camerasrc_start_still_stream(camsrc_handle_t handle);
732
733 /**
734  * Inner ring buffer start refreshing. refresh process occurs asynchronously, and
735  * ::camerasrc_wait_frame_available function can anounce when it is available.
736  *
737  * Camera is grabbing low quality, high speed frame
738  * - Can attempt the [AF] state only at this state
739  * - preview frames are always automatically fed
740  *
741  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
742  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
743  * @note                State transition : [CAMERASRC_STATE_READY] => [CAMERASRC_STATE_PREVIEW]
744  *                      Phase description : Running phase
745  */
746 int camerasrc_start_preview_stream(camsrc_handle_t handle);
747
748 /**
749  * Stop frame refreshing. Ring buffers don't be refreshed any more
750  *
751  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
752  * @return              Success on ::camerasrc_handle_t or returns NULL code, and displays debug message
753  * @see                 camerasrc_stop
754  * @note                State transition : [CAMERASRC_STATE_STILL/PREVIEW/VIDEO] => [CAMERASRC_STATE_READY]
755  *                      Phase description : Running phase
756  */
757 int camerasrc_stop_stream(camsrc_handle_t handle);
758
759 /**
760  * Query image buffer size. buffer allocation guide function.
761  *
762  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
763  * @param[out]          main_img_size main image maximum size
764  * @param[out]          thm_img_size thumb nail image maximum size
765  * @return              Success on ::camsrc_handle_t or returns NULL code, and displays debug message
766  *
767  */
768 int camerasrc_query_img_buf_size(camsrc_handle_t handle, unsigned int* main_img_size, unsigned int* thm_img_size);
769
770 /**
771  * non-busy waiting function for image frame available
772  *
773  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
774  * @param[in]           timeout main image maximum size
775  * @return              Success on ::camsrc_handle_t or returns NULL code, and displays debug message
776  *
777  */
778 int camerasrc_wait_frame_available(camsrc_handle_t handle, long int timeout);
779
780 /**
781  * Check emp shock status
782  *
783  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
784  * @param[out]          check_val
785  * @return Success on ::camsrc_handle_t or returns NULL code, and displays debug message
786  *
787  */
788 int camerasrc_check_esd_shock(camsrc_handle_t *handle, int *check_val);
789
790 /**
791  * Queue(in user space, almost same with free buffer) buffer to dev's ring buffer
792  *
793  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
794  * @param[in]           buffer ::camerasrc_buffer_t buffer
795  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
796  *
797  */
798 int camerasrc_queue_buffer(camsrc_handle_t handle, int buf_index, camerasrc_buffer_t *buffer);
799
800 /**
801  * Dequeue(Pop) buffer from v4l2 driver to usr space.
802  *
803  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
804  * @param[out]          buf_index main buffer index number to be dequeued.
805  * @param[out]          buffer main image buffer
806  * @param[out]          thm_buffer thumbnail image buffer
807  * @return              Success on ::camsrc_handle_t or returns NULL code, and displays debug message
808  *
809  */
810 int camerasrc_dequeue_buffer(camsrc_handle_t handle, int *buf_index, camerasrc_buffer_t *buffer, camerasrc_buffer_t *thm_buffer);
811
812 /**
813  * Read frame from camera device.
814  *
815  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
816  * @param[out]          buffer ::camerasrc_buffer_t main image buffer to be get.
817  * @param[out]          thm_buffer ::camerasrc_buffer_t thumbnail image buffer to be get.
818  * @param[out]          buffer_index ::int v4l2 buffer index.
819  * @note                if thm_buffer is NULL, thumbnail image will be discarded
820  *
821  */
822 int camerasrc_read_frame(camsrc_handle_t handle, camerasrc_buffer_t *main_img_buffer, camerasrc_buffer_t *thm_img_buffer, int *buffer_index);
823
824 /**
825  * Get screennail buffer
826  *
827  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
828  * @param[out]          scrnl_buf ::camerasrc_buffer_t screennail buffer to be gotten
829  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
830  */
831 int camerasrc_get_screennail_buffer(camsrc_handle_t handle, camerasrc_buffer_t *scrnl_buf);
832
833 /**
834  * Set autofocus callback. ::camerasrc_callback_t type defined function can be set
835  *
836  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
837  * @param[in]           cb ::camerasrc_callback_t callback after focusing over
838  * @param[in]           use_data ::void * user data pointer that will be passed to callback
839  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
840  * @note                Callback function can be set on READY or REALIZED state
841  *
842  */
843 int camerasrc_set_focused_callback(camsrc_handle_t handle, camerasrc_callback_t cb, void *usr_data);
844
845 /**
846  * Set autofocusing area. autofocusing will be performed refer this rect of the preview
847  *
848  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
849  * @param[in]           rect ::camerasrc_rect_t rectangle area for auto focusing
850  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
851  */
852 int camerasrc_set_autofocusing_area(camsrc_handle_t handle, camerasrc_rect_t* rect);
853
854 /**
855  * Get autofocusing area.
856  *
857  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
858  * @param[out]          rect ::camerasrc_rect_t rectangle area for auto focusing
859  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
860  */
861 int camerasrc_get_autofocusing_area(camsrc_handle_t handle, camerasrc_rect_t* rect);
862
863 /**
864  * Start auto focusing with ::camerasrc_af_mode. After ::interval time, call the callback
865  * function with ::camerasrc_af_status value.
866  * Auto-focus is in progress. Cant return preview state
867  * before time-out, success, call camerasrc_autofocus_stop
868  * - If focused, focus status will be locked at preview state
869  *
870  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
871  * @param[in]           af_mode Auto focusing operation mode see ::camerasrc_af_mode
872  * @param[in]           interval interval time in millisecond
873  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
874  * @note                State transition : [CAMERASRC_STATE_PREVIEW] => [CAMERASRC_STATE_AF_IN_PROGRESS]
875  *                      Phase description : Running phase
876  */
877 int camerasrc_start_autofocusing(camsrc_handle_t handle);
878
879 /**
880  * Stop auto focusing
881  *
882  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
883  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
884  * @note                State transition : [CAMERASRC_STATE_AF_IN_PROGRESS] => [CAMERASRC_STATE_PREVIEW]
885  *                      Phase description : Running phase
886  */
887 int camerasrc_stop_autofocusing(camsrc_handle_t handle);
888
889 /**
890  * Release auto focusing
891  *
892  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
893  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
894  * @note                State transition : [CAMERASRC_STATE_AF_IN_PROGRESS] => [CAMERASRC_STATE_PREVIEW]
895  *                      Phase description : Running phase
896  */
897 int camerasrc_release_autofocusing(camsrc_handle_t handle);
898
899 /**
900  * Initialize auto focusing mode to specified focal length
901  *
902  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
903  * @param[in]           af_mode ::camerasrc_af_mode_t Auto focusing mode
904  * @param[in]           af_range ::camerasrc_af_scan_range_t Auto focusing range
905  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
906  */
907 int camerasrc_init_autofocusing_mode(camsrc_handle_t handle, camerasrc_af_mode_t af_mode, camerasrc_af_scan_range_t af_range);
908
909 /**
910  * Get current auto focusing mode
911  *
912  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
913  * @param[out]          af_mode ::camerasrc_af_mode_t Auto focusing mode
914  * @param[out]          af_range ::camerasrc_af_scan_range_t Auto focusing range
915  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
916  */
917 int camerasrc_get_autofocusing_mode(camsrc_handle_t handle, camerasrc_af_mode_t* af_mode, camerasrc_af_scan_range_t* af_range);
918
919 /**
920  * Get current auto focusing status
921  *
922  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
923  * @param[out]          af_status ::camerasrc_auto_focus_status_t Auto focusing status
924  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
925  *
926  */
927 int camerasrc_get_autofocusing_status(camsrc_handle_t handle, camerasrc_auto_focus_status_t* af_status);
928 /**** M I S C E L L A N E O U S    O P E R A T I O N ****/
929
930 /**** I N P U T ( C A M D E V I C E )    O P E R A T I O N ****/
931
932 /**
933  * Get input camera ID just like ioctl (fd, VIDIOC_G_INPUT, &index)
934  *
935  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
936  * @param[out]          id Camera ID currently set
937  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
938  * @note                This function is only effective at CAMERASRC_PHASE_RUNNING
939  */
940 int camerasrc_get_input(camsrc_handle_t handle, camerasrc_dev_id_t* camera_id);
941
942 /**
943  * Set input camera ID just like ioctl (fd, VIDIOC_S_INPUT, &index)
944  *
945  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
946  * @param[out]          camera_id Camera ID currently set
947  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
948  * @note                This function is only effective at CAMERASRC_STATE_READY
949  *                      If you use set_input(), handle will be initiated.
950  */
951 int camerasrc_set_input(camsrc_handle_t handle, camerasrc_dev_id_t camera_id);
952
953
954 /**** E F F E C T    C O N T R O L    O P E R A T I O N ****/
955
956 /**
957  * Check support controls with ::camerasrc_ctrl_t ID
958  *
959  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
960  * @param[in]           ctrl_id control ID to be checked
961  * @param[out]          ctrl_info control information to be got
962  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
963  */
964 int camerasrc_query_control(camsrc_handle_t handle, camerasrc_ctrl_t ctrl_id, camerasrc_ctrl_info_t* ctrl_info);
965
966 /**
967  * Check support controls with ::camerasrc_ctrl_t ID
968  *
969  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
970  * @param[in]           ctrl_id control ID to be checked
971  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
972  */
973 int camerasrc_support_control(camsrc_handle_t handle, camerasrc_ctrl_t ctrl_id);
974
975 /**
976  * Start facedetection
977  *
978  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
979  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
980  * @note                State transition : [CAMERASRC_STATE_AF_IN_PROGRESS] => [CAMERASRC_STATE_PREVIEW]
981  *                      Phase description : Running phase
982  */
983 int camerasrc_start_facedetection(camsrc_handle_t handle);
984
985 /**
986  * Stop face detection
987  *
988  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
989  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
990  * @note                State transition : [CAMERASRC_STATE_AF_IN_PROGRESS] => [CAMERASRC_STATE_PREVIEW]
991  *                      Phase description : Running phase
992  */
993 int camerasrc_stop_facedetection(camsrc_handle_t handle);
994
995 /**
996  * Get face detection status
997  *
998  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
999  * @param[out]          is_detecting whether it is detecting or not
1000  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1001  * @note                State transition : [CAMERASRC_STATE_AF_IN_PROGRESS] => [CAMERASRC_STATE_PREVIEW]
1002  *                      Phase description : Running phase
1003  */
1004 int camerasrc_get_facedetection(camsrc_handle_t handle, int* is_detecting);
1005
1006 /**
1007  * Control miscellaneous settings through ::camerasrc_ctrl_t IDs
1008  *
1009  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
1010  * @param[in]           ctrl_id control ID to be checked
1011  * @param[in]           value value to be set
1012  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1013  * @note                This function is only effective at CAMERASRC_STATE_READY
1014  */
1015 int camerasrc_set_control(camsrc_handle_t handle, camerasrc_ctrl_t ctrl_id, int value);
1016
1017 /**
1018  * Get the value of miscellaneous settings through ::camerasrc_ctrl_t IDs
1019  *
1020  * @param[in]           handle ::camsrc_handle_t camerasrc context handle
1021  * @param[in]           ctrl_id control ID to be checked
1022  * @param[out]          value value to be stored
1023  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1024  * @note                This function is only effective at CAMERASRC_STATE_READY
1025  */
1026 int camerasrc_get_control(camsrc_handle_t handle, camerasrc_ctrl_t ctrl_id, int* value);
1027
1028 /**** O U T P U T    C O N T R O L    O P E R A T I O N ****/
1029
1030 /**
1031  * Control frame refresh rate setting
1032  *
1033  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
1034  * @param[in]           frac ::camsrc_frac_t time per frame
1035  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1036  * @note                This function is only effective at CAMERASRC_STATE_READY
1037  */
1038 int camerasrc_set_timeperframe(camsrc_handle_t handle, camerasrc_frac_t* frac);
1039
1040 /**
1041  * Set output format of camera device just like ioctl VIDIOC_S_FMT
1042  *
1043  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
1044  * @param[in]           fmt ::camerasrc_format_t output format description to be set
1045  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1046  * @note                This function is only effective at CAMERASRC_STATE_READY.
1047  *                      device dependent function.
1048  */
1049 int camerasrc_set_format(camsrc_handle_t handle, camerasrc_format_t* fmt);
1050
1051 /**
1052  * Get output format of camera device just like ioctl VIDIOC_G_FMT
1053  *
1054  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
1055  * @param[in]           fmt ::camerasrc_format_t output format description to be set
1056  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1057  * @note                This function is only effective at CAMERASRC_PHASE_RUNNING
1058  */
1059 int camerasrc_get_format(camsrc_handle_t handle, camerasrc_format_t* fmt);
1060
1061 /**
1062  * Try output format of camera device just like ioctl VIDIOC_TRY_FMT
1063  * In this function, it doesn't change any format, only just try. just test
1064  * the combinations of format setting
1065  *
1066  * @param[in]           handle ::camerasrc_handle_t camerasrc context handle
1067  * @param[in]           fmt ::camerasrc_format_t output format description to be set
1068  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1069  * @note                This function is only effective at CAMERASRC_STATE_READY.
1070  *                      device dependent function.
1071  */
1072 int camerasrc_try_format(camsrc_handle_t handle, camerasrc_format_t* fmt);
1073
1074 /**
1075  * Get virtual/physical address of data frame
1076  *
1077  * @param[in]           handle ::camsrc_handle_t handle
1078  * @param[in]           ae_lock ::camerasrc_ae_lock_t Auto exposure lock/unlock
1079  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1080  */
1081 int camerasrc_get_frame_data(camsrc_handle_t handle, camerasrc_frame_data_t * data);
1082
1083 /****  S H U T T E R   S P E E D   &   A P E R T U R E   M O D U L A T I O N  ****/
1084 /**
1085  * Get exif string to be combined with jpg image from camerasrc
1086  *
1087  * @param[in]           handle ::camsrc_handle_t handle
1088  * @param[out]          exif_string exif information string
1089  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1090  */
1091 int camerasrc_get_exif_info(camsrc_handle_t handle, camerasrc_exif_t* exif_struct);
1092
1093 /**
1094  * Check whether camera device is opened
1095  *
1096  * @param[in]           handle ::camsrc_handle_t handle
1097  * @return              0 when camera is not opened else return non-zero value.
1098  */
1099  int camerasrc_device_is_open(camsrc_handle_t handle);
1100
1101 /**
1102  * Set the camera device file decriptor
1103
1104  * @param[in]           handle ::camsrc_handle_t handle
1105  * @param[in]           videofd ::file descriptor of camera device
1106  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1107  */
1108 int camerasrc_set_videofd(camsrc_handle_t handle,int videofd);
1109
1110 /**
1111  * Set AF behaviour after capturing
1112
1113  * @param[in]           handle ::camsrc_handle_t handle
1114  * @param[in]           hold_af ::whether holding af after capturing
1115  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1116  */
1117 int camerasrc_set_af_hold_after_capture(camsrc_handle_t handle, int hold_af);
1118
1119 /**
1120  * Set Sensor mode to camera driver
1121
1122  * @param[in]           handle ::camsrc_handle_t handle
1123  * @param[in]           sensor_mode ::int mode
1124  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1125  */
1126 int camerasrc_set_sensor_mode(camsrc_handle_t handle, int mode);
1127
1128 /**
1129  * Set vflip to camera driver
1130
1131  * @param[in]           handle ::camsrc_handle_t handle
1132  * @param[in]           vflip ::int vflip
1133  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1134  */
1135 int camerasrc_set_vflip(camsrc_handle_t handle, int vflip);
1136
1137 /**
1138  * Set hflip to camera driver
1139
1140  * @param[in]           handle ::camsrc_handle_t handle
1141  * @param[in]           hflip ::int hflip
1142  * @return              Success on CAMERASRC_ERR_NONE or returns with ::camerasrc_error_t error code
1143  */
1144 int camerasrc_set_hflip(camsrc_handle_t handle, int hflip);
1145
1146 /* W I L L   B E   D E P R E C A T E D */
1147
1148 /*! @enum camerasrc_colortone_t
1149  *  @brief Enumeration type for camera colortone
1150  *
1151  *  Colortone entries for camera effects. This can be used with CAMERASRC_CTRL_COLOR_TONE
1152  *  This values are defined for utility. It's dependent on the device/camera module.
1153  */
1154 typedef enum {
1155     CAMERASRC_COLORTONE_NONE = 0,
1156     CAMERASRC_COLORTONE_NEGATIVE,
1157     CAMERASRC_COLORTONE_SOLARIZATION_1,
1158     CAMERASRC_COLORTONE_SOLARIZATION_2,
1159     CAMERASRC_COLORTONE_SOLARIZATION_3,
1160     CAMERASRC_COLORTONE_SOLARIZATION_4,
1161     CAMERASRC_COLORTONE_EMBOSS,
1162     CAMERASRC_COLORTONE_OUTLINE,
1163     CAMERASRC_COLORTONE_AQUA,
1164     CAMERASRC_COLORTONE_SEPHIA,
1165     CAMERASRC_COLORTONE_GRAY,
1166     CAMERASRC_COLORTONE_B_N_W,
1167     CAMERASRC_COLORTONE_RED,
1168     CAMERASRC_COLORTONE_GREEN,
1169     CAMERASRC_COLORTONE_BLUE,
1170     CAMERASRC_COLORTONE_ANTIQUE,
1171     CAMERASRC_COLORTONE_SKETCH1,
1172     CAMERASRC_COLORTONE_SKETCH2,
1173     CAMERASRC_COLORTONE_SKETCH3,
1174     CAMERASRC_COLORTONE_SKETCH4,
1175     CAMERASRC_COLORTONE_NUM,
1176 }camerasrc_colortone_t;
1177
1178 /*! @enum camerasrc_program_mode_t
1179  *  @brief Enumeration type for preset program mode
1180  *
1181  *  WRITEME
1182  */
1183 typedef enum {
1184     CAMERASRC_PROGRAM_MODE_NORMAL = 0,
1185     CAMERASRC_PROGRAM_MODE_PORTRAIT,
1186     CAMERASRC_PROGRAM_MODE_LANDSCAPE,
1187     CAMERASRC_PROGRAM_MODE_SPORTS,
1188     CAMERASRC_PROGRAM_MODE_PARTY_N_INDOOR,
1189     CAMERASRC_PROGRAM_MODE_BEACH_N_INDOOR,
1190     CAMERASRC_PROGRAM_MODE_SUNSET,
1191     CAMERASRC_PROGRAM_MODE_DUSK_N_DAWN,
1192     CAMERASRC_PROGRAM_MODE_FALL_COLOR,
1193     CAMERASRC_PROGRAM_MODE_NIGHT_SCENE,
1194     CAMERASRC_PROGRAM_MODE_FIREWORK,
1195     CAMERASRC_PROGRAM_MODE_TEXT,
1196     CAMERASRC_PROGRAM_MODE_SHOW_WINDOW,
1197     CAMERASRC_PROGRAM_MODE_CANDLE_LIGHT,
1198     CAMERASRC_PROGRAM_MODE_BACK_LIGHT,
1199     CAMERASRC_PROGRAM_MODE_NUM,
1200 }camerasrc_program_mode_t;
1201
1202 /*! @enum camerasrc_whitebalance_t
1203  *  @brief Enumeration type for preset whitebalance
1204  *
1205  *  WRITEME
1206  */
1207 typedef enum {
1208     CAMERASRC_WHITEBALANCE_AUTO = 0,
1209     CAMERASRC_WHITEBALANCE_INCANDESCENT,
1210     CAMERASRC_WHITEBALANCE_FLUORESCENT,
1211     CAMERASRC_WHITEBALANCE_DAYLIGHT,
1212     CAMERASRC_WHITEBALANCE_CLOUDY,
1213     CAMERASRC_WHITEBALANCE_SHADE,
1214     CAMERASRC_WHITEBALANCE_HORIZON,
1215     CAMERASRC_WHITEBALANCE_FLASH,
1216     CAMERASRC_WHITEBALANCE_CUSTOM,
1217     CAMERASRC_WHITEBALANCE_NUM,
1218 }camerasrc_whitebalance_t;
1219
1220 /**
1221  * Enumerations for flip.
1222  */
1223 typedef enum {
1224     CAMERASRC_FILP_NONE = 0,            /**< Not flipped */
1225     CAMERASRC_FILP_VERTICAL,            /**< Flip vertically */
1226     CAMERASRC_FILP_HORIZONTAL,          /**< Flip horizontally */
1227     CAMERASRC_FILP_NUM,                 /**< Number of flip status */
1228 }camerasrc_flip_t;
1229
1230 /*! @enum camerasrc_strobo_status_t
1231  *  @brief strobo status
1232  *  strobo status
1233  */
1234 typedef enum {
1235     CAMERASRC_STROBO_STATUS_BANNED = 0, /**< strobo off*/
1236     CAMERASRC_STROBO_STATUS_FORCE_ON,   /**< strobo on.*/
1237     CAMERASRC_STROBO_STATUS_AUTO,       /**< control strobo automatically*/
1238     CAMERASRC_STROBO_STATUS_MOVIE_ON,   /**< control strobo automatically*/
1239     CAMERASRC_STROBO_STATUS_NUM,        /**< Number of AF status*/
1240 }camerasrc_strobo_status_t;
1241 /*! @enum camerasrc_strobe_mode_t
1242  *  @brief strobe mode
1243  *  strobe mode
1244  */
1245 typedef enum {
1246     CAMERASRC_STROBE_MODE_OFF = 1,      /**< off */
1247     CAMERASRC_STROBE_MODE_AUTO,         /**< auto */
1248     CAMERASRC_STROBE_MODE_ON,           /**< on */
1249     CAMERASRC_STROBE_MODE_PERMANENT,    /**< permanent */
1250     CAMERASRC_STROBE_MODE_NUM,          /**< Number of strobe mode */
1251 }camerasrc_strobe_mode_t;
1252
1253 /*! @enum camerasrc_ae_mode_t
1254  *  @brief Auto exposure mode
1255  *  Auto exposure operation mode
1256  */
1257 typedef enum {
1258     CAMERASRC_AE_MODE_OFF = 0,
1259     CAMERASRC_AE_MODE_ALL,
1260     CAMERASRC_AE_MODE_CENTER_WEIGHTED_AVR_1,
1261     CAMERASRC_AE_MODE_CENTER_WEIGHTED_AVR_2,
1262     CAMERASRC_AE_MODE_CENTER_WEIGHTED_AVR_3,
1263     CAMERASRC_AE_MODE_SPOT_1,
1264     CAMERASRC_AE_MODE_SPOT_2,
1265     CAMERASRC_AE_MODE_CUSTOM_1,
1266     CAMERASRC_AE_MODE_CUSTOM_2,
1267 } camerasrc_ae_mode_t;
1268
1269 /*! @enum camerasrc_iso_t
1270  *  @brief Reserved iso number in definition
1271  *  Traditionally predefined ISO values
1272  */
1273 typedef enum {
1274     CAMERASRC_ISO_AUTO = 0,
1275     CAMERASRC_ISO_50,
1276     CAMERASRC_ISO_100,
1277     CAMERASRC_ISO_200,
1278     CAMERASRC_ISO_400,
1279     CAMERASRC_ISO_800,
1280     CAMERASRC_ISO_1600,
1281     CAMERASRC_ISO_3200,
1282 } camerasrc_iso_t;
1283
1284 /*! @enum camerasrc_sensor_mode_t
1285  *  @brief Sensor mode in driver
1286  *  Sensor mode
1287  */
1288 typedef enum {
1289     CAMERASRC_SENSOR_MODE_CAMERA = 0,
1290     CAMERASRC_SENSOR_MODE_MOVIE,
1291 } camerasrc_sensor_mode_t;
1292
1293 /*! @def CAMERASRC_SET_SIZE_BY_PRESET_RESOLUTION
1294  *  @brief Utility definitions for setting regular size with ::camerasrc_resol_name_t
1295  */
1296 #define CAMERASRC_SET_SIZE_BY_PRESET_RESOLUTION(format, resolution) { \
1297     memset(&(format.img_size), 0, sizeof(camerasrc_size_t)); \
1298     format.img_size.res = resolution; \
1299 }
1300
1301 /**
1302  * Set the mode of strobe
1303  *
1304  * @param[in]           handle ::camsrc_handle_t handle
1305  * @param[in]           mode ::camerasrc_strobe_mode_t mode of strobe
1306  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1307  */
1308 int camerasrc_set_strobe_mode(camsrc_handle_t handle, camerasrc_strobe_mode_t mode);
1309
1310 /**
1311  * Get the mode of strobe
1312  *
1313  * @param[in]           handle ::camsrc_handle_t handle
1314  * @param[out]          mode ::camerasrc_strobe_mode_t mode of strobe
1315  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1316  */
1317 int camerasrc_get_strobe_mode(camsrc_handle_t handle, camerasrc_strobe_mode_t* mode);
1318
1319 /**
1320  * Set the mode of auto-exposure processing
1321  *
1322  * @param[in]           handle ::camsrc_handle_t handle
1323  * @param[in]           ae_mode ::camerasrc_ae_mode_t AE mode to be set
1324  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1325  */
1326 int camerasrc_set_exposure_mode(camsrc_handle_t handle, camerasrc_ae_mode_t ae_mode);
1327
1328 /**
1329  * Get the mode of auto-exposure processing
1330  *
1331  * @param[in]           handle ::camsrc_handle_t handle
1332  * @param[out]          ae_mode ::camerasrc_ae_mode_t AE mode to be got
1333  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1334  */
1335 int camerasrc_get_exposure_mode(camsrc_handle_t handle, camerasrc_ae_mode_t* ae_mode);
1336
1337 /**
1338  * Set the shutter speed
1339  *
1340  * @param[in]           handle ::camsrc_handle_t handle
1341  * @param[in]           frac ::camerasrc_frac_t shutter speed to be set
1342  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1343  */
1344 int camerasrc_set_shutter_speed(camsrc_handle_t handle, camerasrc_frac_t frac);
1345
1346 /**
1347  * Get the shutter speed
1348  *
1349  * @param[in]           handle ::camsrc_handle_t handle
1350  * @param[out]          frac ::camerasrc_frac_t shutter speed to be got
1351  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1352  */
1353 int camerasrc_get_shutter_speed(camsrc_handle_t handle, camerasrc_frac_t* frac);
1354
1355 /**
1356  * Set the exposure value
1357  *
1358  * @param[in]           handle ::camsrc_handle_t handle
1359  * @param[in]           frac ::camerasrc_frac_t exposure value to be set
1360  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1361  */
1362 int camerasrc_set_exposure_value(camsrc_handle_t handle, camerasrc_frac_t frac);
1363
1364 /**
1365  * Get the exposure value
1366  *
1367  * @param[in]           handle ::camsrc_handle_t handle
1368  * @param[out]          frac ::camerasrc_frac_t exposure value to be got
1369  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1370  */
1371 int camerasrc_get_exposure_value(camsrc_handle_t handle, camerasrc_frac_t* frac);
1372
1373 /**
1374  * Check whether supports exif embed in jpg or not
1375  *
1376  * @param[in]           handle ::camsrc_handle_t handle
1377  * @param[out]          support_exif ::if supports, returns 1 or 0
1378  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1379  */
1380 int camerasrc_support_embed_exif(camsrc_handle_t handle, int* support_exif);
1381
1382 /**
1383  * Check whether supports jpeg encoding inside camera driver
1384  *
1385  * @param[in]           handle ::camsrc_handle_t handle
1386  * @param[out]          support_jpeg_encoding ::if supports, returns 1. If not, return 0
1387  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1388  */
1389 int camerasrc_support_jpeg_encoding(camsrc_handle_t handle, int* support_jpeg_encoding);
1390
1391
1392
1393 /* For Query functionalities */
1394 /**
1395  * Query basic device info of device
1396  *
1397  * @param[in]           handle ::camsrc_handle_t handle
1398  * @param[out]          camerasrc_caps_info_t device information structure
1399  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1400  */
1401 int camerasrc_read_basic_dev_info(camerasrc_dev_id_t dev_id, camerasrc_caps_info_t* caps_info);
1402
1403 /**
1404  * Query miscellaneous device info(effect, WB, preset values, etc.) of device
1405  *
1406  * @param[in]           handle ::camsrc_handle_t handle
1407  * @param[out]          camerasrc_ctrl_list_info_t device capabilities structure
1408  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1409  */
1410 int camerasrc_read_misc_dev_info(camerasrc_dev_id_t dev_id, camerasrc_ctrl_list_info_t* ctrl_info);
1411
1412 /**
1413  * Query extra device info(face detection, strobe, etc.) of device
1414  *
1415  * @param[in]           handle ::camsrc_handle_t handle
1416  * @param[out]          camerasrc_extra_info_t device capabilities structure
1417  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1418  */
1419 int camerasrc_read_extra_dev_info(camerasrc_dev_id_t dev_id, camerasrc_extra_info_t* extra_info);
1420
1421 /**
1422  * Record miscellaneous device info(effect, WB, preset values, etc.) of device
1423  *
1424  * @param[in]           handle ::camsrc_handle_t handle
1425  * @param[in]           camerasrc_ctrl_list_info_t device capabilities structure
1426  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1427  */
1428 int camerasrc_write_basic_dev_info(camsrc_handle_t handle, camerasrc_caps_info_t* caps_info);
1429
1430 /**
1431  * Record miscellaneous device info(effect, WB, preset values, etc.) of device
1432  *
1433  * @param[in]           handle ::camsrc_handle_t handle
1434  * @param[in]           camerasrc_ctrl_list_info_t device capabilities structure
1435  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1436  */
1437 int camerasrc_write_misc_dev_info(camsrc_handle_t handle, camerasrc_ctrl_list_info_t* ctrl_info);
1438
1439 /**
1440  * Record extra device info(face detection, strobe, etc.) of device
1441  *
1442  * @param[in]           handle ::camsrc_handle_t handle
1443  * @param[out]          camerasrc_extra_info_t device capabilities structure
1444  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1445  */
1446 int camerasrc_write_extra_dev_info(camsrc_handle_t handle, camerasrc_extra_info_t* extra_info);
1447
1448 /**
1449  * Query to device driver about basic device info
1450  *
1451  * @param[in]           handle ::camsrc_handle_t handle
1452  * @param[out]          camerasrc_ctrl_list_info_t device capabilities structure
1453  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1454  */
1455 int camerasrc_query_basic_dev_info(camsrc_handle_t handle, camerasrc_caps_info_t* caps_info);
1456
1457 /**
1458  * Query to device driver about miscellaneous device info(effect, WB, preset values, etc.) of device
1459  *
1460  * @param[in]           handle ::camsrc_handle_t handle
1461  * @param[out]          camerasrc_ctrl_list_info_t device capabilities structure
1462  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1463  */
1464 int camerasrc_query_misc_dev_info(camsrc_handle_t handle, camerasrc_ctrl_list_info_t* ctrl_list_info);
1465 int camerasrc_query_misc_dev_ctrl_info(camsrc_handle_t handle, camerasrc_ctrl_t ctrl_id, camerasrc_ctrl_info_t* ctrl_info);
1466
1467 /**
1468  * Query to device driver about extra device info(face detection, strobe, etc.) of device
1469  *
1470  * @param[in]           handle ::camsrc_handle_t handle
1471  * @param[out]          camerasrc_extra_info_t device capabilities structure
1472  * @return              Success(Support) on CAMERASRC_ERR_NONE or returns with ::camerasrc_error error code
1473  */
1474 int camerasrc_query_extra_dev_info(camsrc_handle_t handle, camerasrc_extra_info_t* extra_info);
1475
1476 /**
1477  * Dump functions for debugging
1478  */
1479 int camerasrc_dump_basic_dev_info(camsrc_handle_t handle, camerasrc_caps_info_t* caps_info);
1480 int camerasrc_dump_misc_dev_info(camsrc_handle_t handle, camerasrc_ctrl_list_info_t* ctrl_list_info);
1481 int camerasrc_dump_extra_dev_info(camsrc_handle_t handle, camerasrc_extra_info_t* extra_info);
1482 /* END For Query functionalities */
1483
1484 #ifdef __cplusplus
1485 }
1486 #endif
1487
1488 #endif /*__CAMERASRC_H__*/