• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2013, 2016, The Linux Foundation. All rights reserved.
2  *
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are
5  * met:
6  *     * Redistributions of source code must retain the above copyright
7  *       notice, this list of conditions and the following disclaimer.
8  *     * Redistributions in binary form must reproduce the above
9  *       copyright notice, this list of conditions and the following
10  *       disclaimer in the documentation and/or other materials provided
11  *       with the distribution.
12  *     * Neither the name of The Linux Foundation nor the names of its
13  *       contributors may be used to endorse or promote products derived
14  *       from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
19  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
23  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
25  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
26  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  */
29 
30 #ifndef __MM_QCAMERA_MAIN_MENU_H__
31 #define __MM_QCAMERA_MAIN_MENU_H__
32 
33 // Camera dependencies
34 #include "mm_camera_interface.h"
35 #include "mm_jpeg_interface.h"
36 
37 #define VIDEO_BUFFER_SIZE       (PREVIEW_WIDTH * PREVIEW_HEIGHT * 3/2)
38 #define THUMBNAIL_BUFFER_SIZE   (THUMBNAIL_WIDTH * THUMBNAIL_HEIGHT * 3/2)
39 #define SNAPSHOT_BUFFER_SIZE    (PICTURE_WIDTH * PICTURE_HEIGHT * 3/2)
40 
41 /*===========================================================================
42  * Macro
43  *===========================================================================*/
44 #define PREVIEW_FRAMES_NUM    5
45 #define VIDEO_FRAMES_NUM      5
46 #define THUMBNAIL_FRAMES_NUM  1
47 #define SNAPSHOT_FRAMES_NUM   1
48 #define MAX_NUM_FORMAT        32
49 
50 typedef enum
51 {
52   START_PREVIEW,
53   STOP_PREVIEW,
54   SET_WHITE_BALANCE,
55   SET_TINTLESS_ENABLE,
56   SET_TINTLESS_DISABLE,
57   SET_EXP_METERING,
58   GET_CTRL_VALUE,
59   TOGGLE_AFR,
60   SET_ISO,
61   BRIGHTNESS_GOTO_SUBMENU,
62   CONTRAST_GOTO_SUBMENU,
63   EV_GOTO_SUBMENU,
64   SATURATION_GOTO_SUBMENU,
65   SET_ZOOM,
66   SET_SHARPNESS,
67   TAKE_JPEG_SNAPSHOT,
68   START_RECORDING,
69   STOP_RECORDING,
70   BEST_SHOT,
71   LIVE_SHOT,
72   FLASH_MODES,
73   TOGGLE_ZSL,
74   TAKE_RAW_SNAPSHOT,
75   SWITCH_SNAP_RESOLUTION,
76   TOGGLE_WNR,
77   EXIT
78 } Camera_main_menu_t;
79 
80 typedef enum
81 {
82   ACTION_NO_ACTION,
83   ACTION_START_PREVIEW,
84   ACTION_STOP_PREVIEW,
85   ACTION_SET_WHITE_BALANCE,
86   ACTION_SET_TINTLESS_ENABLE,
87   ACTION_SET_TINTLESS_DISABLE,
88   ACTION_SET_EXP_METERING,
89   ACTION_GET_CTRL_VALUE,
90   ACTION_TOGGLE_AFR,
91   ACTION_SET_ISO,
92   ACTION_BRIGHTNESS_INCREASE,
93   ACTION_BRIGHTNESS_DECREASE,
94   ACTION_CONTRAST_INCREASE,
95   ACTION_CONTRAST_DECREASE,
96   ACTION_EV_INCREASE,
97   ACTION_EV_DECREASE,
98   ACTION_SATURATION_INCREASE,
99   ACTION_SATURATION_DECREASE,
100   ACTION_SET_ZOOM,
101   ACTION_SHARPNESS_INCREASE,
102   ACTION_SHARPNESS_DECREASE,
103   ACTION_TAKE_JPEG_SNAPSHOT,
104   ACTION_START_RECORDING,
105   ACTION_STOP_RECORDING,
106   ACTION_SET_BESTSHOT_MODE,
107   ACTION_TAKE_LIVE_SNAPSHOT,
108   ACTION_SET_FLASH_MODE,
109   ACTION_SWITCH_CAMERA,
110   ACTION_TOGGLE_ZSL,
111   ACTION_TAKE_RAW_SNAPSHOT,
112   ACTION_SWITCH_RESOLUTION,
113   ACTION_TOGGLE_WNR,
114   ACTION_EXIT
115 } camera_action_t;
116 
117 #define INVALID_KEY_PRESS 0
118 #define BASE_OFFSET  ('Z' - 'A' + 1)
119 #define BASE_OFFSET_NUM  ('Z' - 'A' + 2)
120 #define PAD_TO_WORD(a)  (((a)+3)&~3)
121 
122 
123 #define SQCIF_WIDTH     128
124 #define SQCIF_HEIGHT     96
125 #define QCIF_WIDTH      176
126 #define QCIF_HEIGHT     144
127 #define QVGA_WIDTH      320
128 #define QVGA_HEIGHT     240
129 #define HD_THUMBNAIL_WIDTH      256
130 #define HD_THUMBNAIL_HEIGHT     144
131 #define CIF_WIDTH       352
132 #define CIF_HEIGHT      288
133 #define VGA_WIDTH       640
134 #define VGA_HEIGHT      480
135 #define WVGA_WIDTH      800
136 #define WVGA_HEIGHT     480
137 #define WVGA_PLUS_WIDTH      960
138 #define WVGA_PLUS_HEIGHT     720
139 
140 #define MP1_WIDTH      1280
141 #define MP1_HEIGHT      960
142 #define MP2_WIDTH      1600
143 #define MP2_HEIGHT     1200
144 #define MP3_WIDTH      2048
145 #define MP3_HEIGHT     1536
146 #define MP5_WIDTH      2592
147 #define MP5_HEIGHT     1944
148 #define MP8_WIDTH      3264
149 #define MP8_HEIGHT     2448
150 #define MP12_WIDTH     4000
151 #define MP12_HEIGHT    3000
152 
153 #define SVGA_WIDTH      800
154 #define SVGA_HEIGHT     600
155 #define XGA_WIDTH      1024
156 #define XGA_HEIGHT      768
157 #define HD720_WIDTH    1280
158 #define HD720_HEIGHT    720
159 #define HD720_PLUS_WIDTH    1440
160 #define HD720_PLUS_HEIGHT   1080
161 #define WXGA_WIDTH     1280
162 #define WXGA_HEIGHT     768
163 #define HD1080_WIDTH   1920
164 #define HD1080_HEIGHT  1080
165 
166 
167 #define ONEMP_WIDTH    1280
168 #define SXGA_WIDTH     1280
169 #define UXGA_WIDTH     1600
170 #define QXGA_WIDTH     2048
171 #define FIVEMP_WIDTH   2560
172 
173 
174 #define ONEMP_HEIGHT    960
175 #define SXGA_HEIGHT     1024
176 #define UXGA_HEIGHT     1200
177 #define QXGA_HEIGHT     1536
178 #define FIVEMP_HEIGHT   1920
179 
180 
181 typedef enum
182 {
183   RESOLUTION_MIN,
184   QCIF                  = RESOLUTION_MIN,
185   QVGA,
186   VGA,
187   WVGA,
188   WVGA_PLUS ,
189   HD720,
190   HD720_PLUS,
191   HD1080,
192   RESOLUTION_PREVIEW_VIDEO_MAX = HD1080,
193   WXGA,
194   MP1,
195   MP2,
196   MP3,
197   MP5,
198   MP8,
199   MP12,
200   RESOLUTION_MAX         = MP12,
201 } Camera_Resolution;
202 
203 typedef struct{
204     uint16_t width;
205     uint16_t  height;
206     char * name;
207     char * str_name;
208     int supported;
209 } DIMENSION_TBL_T;
210 
211 typedef enum {
212     WHITE_BALANCE_STATE,
213     WHITE_BALANCE_TEMPERATURE,
214     BRIGHTNESS_CTRL,
215     EV,
216     CONTRAST_CTRL,
217     SATURATION_CTRL,
218     SHARPNESS_CTRL
219 } Get_Ctrl_modes;
220 
221 typedef enum {
222     AUTO_EXP_FRAME_AVG,
223     AUTO_EXP_CENTER_WEIGHTED,
224     AUTO_EXP_SPOT_METERING,
225     AUTO_EXP_SMART_METERING,
226     AUTO_EXP_USER_METERING,
227     AUTO_EXP_SPOT_METERING_ADV,
228     AUTO_EXP_CENTER_WEIGHTED_ADV,
229     AUTO_EXP_MAX
230 } Exp_Metering_modes;
231 
232 typedef enum {
233   ISO_AUTO,
234   ISO_DEBLUR,
235   ISO_100,
236   ISO_200,
237   ISO_400,
238   ISO_800,
239   ISO_1600,
240   ISO_MAX
241 } ISO_modes;
242 
243 typedef enum {
244   BESTSHOT_AUTO,
245   BESTSHOT_ACTION,
246   BESTSHOT_PORTRAIT,
247   BESTSHOT_LANDSCAPE,
248   BESTSHOT_NIGHT,
249   BESTSHOT_NIGHT_PORTRAIT,
250   BESTSHOT_THEATRE,
251   BESTSHOT_BEACH,
252   BESTSHOT_SNOW,
253   BESTSHOT_SUNSET,
254   BESTSHOT_ANTISHAKE,
255   BESTSHOT_FIREWORKS,
256   BESTSHOT_SPORTS,
257   BESTSHOT_PARTY,
258   BESTSHOT_CANDLELIGHT,
259   BESTSHOT_ASD,
260   BESTSHOT_BACKLIGHT,
261   BESTSHOT_FLOWERS,
262   BESTSHOT_AR,
263   BESTSHOT_HDR,
264   BESTSHOT_MAX
265 }Bestshot_modes;
266 
267 typedef enum {
268     FLASH_MODE_OFF,
269     FLASH_MODE_AUTO,
270     FLASH_MODE_ON,
271     FLASH_MODE_TORCH,
272     FLASH_MODE_MAX,
273 }Flash_modes;
274 
275 typedef enum {
276   WB_AUTO,
277   WB_INCANDESCENT,
278   WB_FLUORESCENT,
279   WB_WARM_FLUORESCENT,
280   WB_DAYLIGHT,
281   WB_CLOUDY_DAYLIGHT,
282   WB_TWILIGHT,
283   WB_SHADE,
284   WB_MAX
285 } White_Balance_modes;
286 
287 typedef enum
288 {
289   MENU_ID_MAIN,
290   MENU_ID_WHITEBALANCECHANGE,
291   MENU_ID_EXPMETERINGCHANGE,
292   MENU_ID_GET_CTRL_VALUE,
293   MENU_ID_TOGGLEAFR,
294   MENU_ID_ISOCHANGE,
295   MENU_ID_BRIGHTNESSCHANGE,
296   MENU_ID_CONTRASTCHANGE,
297   MENU_ID_EVCHANGE,
298   MENU_ID_SATURATIONCHANGE,
299   MENU_ID_ZOOMCHANGE,
300   MENU_ID_SHARPNESSCHANGE,
301   MENU_ID_BESTSHOT,
302   MENU_ID_FLASHMODE,
303   MENU_ID_SENSORS,
304   MENU_ID_SWITCH_RES,
305   MENU_ID_INVALID,
306 } menu_id_change_t;
307 
308 typedef enum
309 {
310   DECREASE_ZOOM,
311   INCREASE_ZOOM,
312   INCREASE_STEP_ZOOM,
313   DECREASE_STEP_ZOOM,
314 } Camera_Zoom;
315 
316 typedef enum
317 {
318   INC_CONTRAST,
319   DEC_CONTRAST,
320 } Camera_Contrast_changes;
321 
322 typedef enum
323 {
324   INC_BRIGHTNESS,
325   DEC_BRIGHTNESS,
326 } Camera_Brightness_changes;
327 
328 typedef enum
329 {
330   INCREASE_EV,
331   DECREASE_EV,
332 } Camera_EV_changes;
333 
334 typedef enum {
335   INC_SATURATION,
336   DEC_SATURATION,
337 } Camera_Saturation_changes;
338 
339 typedef enum
340 {
341   INC_ISO,
342   DEC_ISO,
343 } Camera_ISO_changes;
344 
345 typedef enum
346 {
347   INC_SHARPNESS,
348   DEC_SHARPNESS,
349 } Camera_Sharpness_changes;
350 
351 typedef enum {
352   ZOOM_IN,
353   ZOOM_OUT,
354 } Zoom_direction;
355 
356 typedef struct{
357     Camera_main_menu_t main_menu;
358     char * menu_name;
359 } CAMERA_MAIN_MENU_TBL_T;
360 
361 typedef struct{
362     char * menu_name;
363     int present;
364 } CAMERA_SENSOR_MENU_TLB_T;
365 
366 typedef struct{
367     Camera_Resolution cs_id;
368     uint16_t width;
369     uint16_t  height;
370     char * name;
371     char * str_name;
372 } PREVIEW_DIMENSION_TBL_T;
373 
374 typedef struct {
375   White_Balance_modes wb_id;
376   char * wb_name;
377 } WHITE_BALANCE_TBL_T;
378 
379 typedef struct {
380   Get_Ctrl_modes get_ctrl_id;
381   char * get_ctrl_name;
382 } GET_CTRL_TBL_T;
383 
384 typedef struct{
385   Exp_Metering_modes exp_metering_id;
386   char * exp_metering_name;
387 } EXP_METERING_TBL_T;
388 
389 typedef struct {
390   Bestshot_modes bs_id;
391   char *name;
392 } BESTSHOT_MODE_TBT_T;
393 
394 typedef struct {
395   Flash_modes bs_id;
396   char *name;
397 } FLASH_MODE_TBL_T;
398 
399 typedef struct {
400   ISO_modes iso_modes;
401   char *iso_modes_name;
402 } ISO_TBL_T;
403 
404 typedef struct {
405   Zoom_direction zoom_direction;
406   char * zoom_direction_name;
407 } ZOOM_TBL_T;
408 
409 typedef struct {
410   Camera_Sharpness_changes sharpness_change;
411   char *sharpness_change_name;
412 } SHARPNESS_TBL_T;
413 
414 typedef struct {
415   Camera_Brightness_changes bc_id;
416   char * brightness_name;
417 } CAMERA_BRIGHTNESS_TBL_T;
418 
419 typedef struct {
420   Camera_Contrast_changes cc_id;
421   char * contrast_name;
422 } CAMERA_CONTRST_TBL_T;
423 
424 typedef struct {
425   Camera_EV_changes ec_id;
426   char * EV_name;
427 } CAMERA_EV_TBL_T;
428 
429 typedef struct {
430   Camera_Saturation_changes sc_id;
431   char * saturation_name;
432 } CAMERA_SATURATION_TBL_T;
433 
434 typedef struct {
435   Camera_Sharpness_changes bc_id;
436   char * sharpness_name;
437 } CAMERA_SHARPNESS_TBL_T;
438 
439 #endif /* __MM_QCAMERA_MAIN_MENU_H__ */
440