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