QCameraParameters.h revision 1687b440bcda598006d1950f74915f0cea3b66a3
1/* 2** Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. 3** Not a Contribution. Apache license notifications and license are 4** retained for attribution purposes only. 5** 6** Copyright 2008, The Android Open Source Project 7** Licensed under the Apache License, Version 2.0 (the "License"); 8** you may not use this file except in compliance with the License. 9** You may obtain a copy of the License at 10** 11** http://www.apache.org/licenses/LICENSE-2.0 12** 13** Unless required by applicable law or agreed to in writing, software 14** distributed under the License is distributed on an "AS IS" BASIS, 15** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16** See the License for the specific language governing permissions and 17** limitations under the License. 18*/ 19 20#ifndef ANDROID_HARDWARE_QCAMERA_PARAMETERS_H 21#define ANDROID_HARDWARE_QCAMERA_PARAMETERS_H 22 23// To remove 24#include <cutils/properties.h> 25 26// System dependencies 27#include <camera/CameraParameters.h> 28#include <utils/Errors.h> 29 30// Camera dependencies 31#include "camera.h" 32#include "QCameraMem.h" 33#include "QCameraParametersIntf.h" 34#include "QCameraThermalAdapter.h" 35 36extern "C" { 37#include "mm_jpeg_interface.h" 38} 39 40using namespace android; 41 42namespace qcamera { 43 44//EXIF globals 45static const char ExifAsciiPrefix[] = { 0x41, 0x53, 0x43, 0x49, 0x49, 0x0, 0x0, 0x0 }; // "ASCII\0\0\0" 46static const char ExifUndefinedPrefix[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // "\0\0\0\0\0\0\0\0" 47 48#define FOCAL_LENGTH_DECIMAL_PRECISION 100 49 50#define CAMERA_MIN_BATCH_COUNT 4 51 52#define QCAMERA_MAX_EXP_TIME_LEVEL1 100 53#define QCAMERA_MAX_EXP_TIME_LEVEL2 500 54#define QCAMERA_MAX_EXP_TIME_LEVEL3 1000 55#define QCAMERA_MAX_EXP_TIME_LEVEL4 10000 56 57class QCameraParameters: private CameraParameters 58{ 59 60private: 61 62 class QCameraReprocScaleParam{ 63 public: 64 65 QCameraReprocScaleParam(); 66 ~QCameraReprocScaleParam(); 67 68 void setScaleEnable(bool enabled); 69 int32_t setScaleSizeTbl(size_t scale_cnt, 70 cam_dimension_t *scale_tbl, size_t org_cnt, 71 cam_dimension_t *org_tbl); 72 int32_t setValidatePicSize(int &width, int &height); 73 74 bool isScaleEnabled(); 75 bool isUnderScaling(); 76 77 size_t getScaleSizeTblCnt(); 78 cam_dimension_t *getScaledSizeTbl(); 79 size_t getTotalSizeTblCnt(); 80 cam_dimension_t *getTotalSizeTbl(); 81 int32_t getPicSizeFromAPK(int &width, int &height); 82 int32_t getPicSizeSetted(int &width, int &height); 83 84 private: 85 bool isScalePicSize(int width, int height); 86 bool isValidatePicSize(int width, int height); 87 int32_t setSensorSupportedPicSize(); 88 size_t checkScaleSizeTable(size_t scale_cnt, cam_dimension_t *scale_tbl, 89 size_t org_cnt, cam_dimension_t *org_tbl); 90 91 bool mScaleEnabled; 92 bool mIsUnderScaling; //if in scale status 93 94 // picture size cnt that need scale operation 95 size_t mNeedScaleCnt; 96 cam_dimension_t mNeedScaledSizeTbl[MAX_SCALE_SIZES_CNT]; 97 98 // sensor supported size cnt and table 99 size_t mSensorSizeTblCnt; 100 cam_dimension_t *mSensorSizeTbl; 101 102 // Total size cnt (sensor supported + need scale cnt) 103 size_t mTotalSizeTblCnt; 104 cam_dimension_t mTotalSizeTbl[MAX_SIZES_CNT]; 105 106 cam_dimension_t mPicSizeFromAPK; // dimension that APK is expected 107 cam_dimension_t mPicSizeSetted; // dimension that config vfe 108 }; 109 110 // Supported PREVIEW/RECORDING SIZES IN HIGH FRAME RATE recording, sizes in pixels. 111 // Example value: "800x480,432x320". Read only. 112 static const char KEY_QC_SUPPORTED_HFR_SIZES[]; 113 // The mode of preview frame rate. 114 // Example value: "frame-rate-auto, frame-rate-fixed". 115 static const char KEY_QC_PREVIEW_FRAME_RATE_MODE[]; 116 static const char KEY_QC_SUPPORTED_PREVIEW_FRAME_RATE_MODES[]; 117 static const char KEY_QC_PREVIEW_FRAME_RATE_AUTO_MODE[]; 118 static const char KEY_QC_PREVIEW_FRAME_RATE_FIXED_MODE[]; 119 static const char KEY_QC_SUPPORTED_SKIN_TONE_ENHANCEMENT_MODES[] ; 120 121 // Supported live snapshot sizes 122 static const char KEY_QC_SUPPORTED_LIVESNAPSHOT_SIZES[]; 123 124 // Supported Raw formats 125 static const char KEY_QC_SUPPORTED_RAW_FORMATS[]; 126 static const char KEY_QC_RAW_FORMAT[]; 127 128 //Touch Af/AEC settings. 129 static const char KEY_QC_TOUCH_AF_AEC[]; 130 static const char KEY_QC_SUPPORTED_TOUCH_AF_AEC[]; 131 //Touch Index for AEC. 132 static const char KEY_QC_TOUCH_INDEX_AEC[]; 133 //Touch Index for AF. 134 static const char KEY_QC_TOUCH_INDEX_AF[]; 135 // Current auto scene detection mode. 136 // Example value: "off" or "on" constants. Read/write. 137 static const char KEY_QC_SCENE_DETECT[]; 138 // Supported auto scene detection settings. 139 // Example value: "off,on". Read only. 140 static const char KEY_QC_SUPPORTED_SCENE_DETECT[]; 141 static const char KEY_QC_SELECTABLE_ZONE_AF[]; 142 143 static const char KEY_QC_ISO_MODE[]; 144 static const char KEY_QC_CONTINUOUS_ISO[]; 145 static const char KEY_QC_MIN_ISO[]; 146 static const char KEY_QC_MAX_ISO[]; 147 static const char KEY_QC_SUPPORTED_ISO_MODES[]; 148 static const char KEY_QC_EXPOSURE_TIME[]; 149 static const char KEY_QC_MIN_EXPOSURE_TIME[]; 150 static const char KEY_QC_MAX_EXPOSURE_TIME[]; 151 static const char KEY_QC_LENSSHADE[] ; 152 static const char KEY_QC_SUPPORTED_LENSSHADE_MODES[] ; 153 static const char KEY_QC_AUTO_EXPOSURE[]; 154 static const char KEY_QC_SUPPORTED_AUTO_EXPOSURE[]; 155 156 static const char KEY_QC_GPS_LATITUDE_REF[]; 157 static const char KEY_QC_GPS_LONGITUDE_REF[]; 158 static const char KEY_QC_GPS_ALTITUDE_REF[]; 159 static const char KEY_QC_GPS_STATUS[]; 160 static const char KEY_QC_MEMORY_COLOR_ENHANCEMENT[]; 161 static const char KEY_QC_SUPPORTED_MEM_COLOR_ENHANCE_MODES[]; 162 static const char KEY_QC_DIS[]; 163 static const char KEY_QC_OIS[]; 164 static const char KEY_QC_SUPPORTED_DIS_MODES[]; 165 static const char KEY_QC_SUPPORTED_OIS_MODES[]; 166 167 static const char KEY_QC_ZSL[]; 168 static const char KEY_QC_SUPPORTED_ZSL_MODES[]; 169 static const char KEY_QC_ZSL_BURST_INTERVAL[]; 170 static const char KEY_QC_ZSL_BURST_LOOKBACK[]; 171 static const char KEY_QC_ZSL_QUEUE_DEPTH[]; 172 173 static const char KEY_QC_CAMERA_MODE[]; 174 static const char KEY_QC_ORIENTATION[]; 175 176 static const char KEY_QC_VIDEO_HIGH_FRAME_RATE[]; 177 static const char KEY_QC_VIDEO_HIGH_SPEED_RECORDING[]; 178 static const char KEY_QC_SUPPORTED_VIDEO_HIGH_FRAME_RATE_MODES[]; 179 static const char KEY_QC_HIGH_DYNAMIC_RANGE_IMAGING[]; 180 static const char KEY_QC_SUPPORTED_HDR_IMAGING_MODES[]; 181 static const char KEY_QC_AE_BRACKET_HDR[]; 182 static const char KEY_QC_SUPPORTED_AE_BRACKET_MODES[]; 183 static const char KEY_QC_CAPTURE_BURST_EXPOSURE[]; 184 static const char KEY_QC_NUM_SNAPSHOT_PER_SHUTTER[]; 185 static const char KEY_QC_NUM_RETRO_BURST_PER_SHUTTER[]; 186 static const char KEY_QC_SNAPSHOT_BURST_LED_ON_PERIOD[]; 187 static const char KEY_QC_SNAPSHOT_BURST_NUM[]; 188 static const char KEY_QC_NO_DISPLAY_MODE[]; 189 static const char KEY_QC_RAW_PICUTRE_SIZE[]; 190 static const char KEY_QC_TINTLESS_ENABLE[]; 191 static const char KEY_QC_SCENE_SELECTION[]; 192 static const char KEY_QC_CDS_MODE[]; 193 static const char KEY_QC_VIDEO_CDS_MODE[]; 194 static const char KEY_QC_SUPPORTED_CDS_MODES[]; 195 static const char KEY_QC_SUPPORTED_VIDEO_CDS_MODES[]; 196 static const char KEY_QC_TNR_MODE[]; 197 static const char KEY_QC_VIDEO_TNR_MODE[]; 198 static const char KEY_QC_SUPPORTED_TNR_MODES[]; 199 static const char KEY_QC_SUPPORTED_VIDEO_TNR_MODES[]; 200 201 static const char KEY_INTERNAL_PERVIEW_RESTART[]; 202 static const char KEY_QC_WB_MANUAL_CCT[]; 203 static const char KEY_QC_MIN_WB_CCT[]; 204 static const char KEY_QC_MAX_WB_CCT[]; 205 static const char KEY_QC_MANUAL_WB_GAINS[]; 206 static const char KEY_QC_MIN_WB_GAIN[]; 207 static const char KEY_QC_MAX_WB_GAIN[]; 208 static const char WHITE_BALANCE_MANUAL[]; 209 static const char FOCUS_MODE_MANUAL_POSITION[]; 210 static const char KEY_QC_LONG_SHOT[]; 211 static const char KEY_QC_INITIAL_EXPOSURE_INDEX[]; 212 213 static const char KEY_QC_MANUAL_FOCUS_POSITION[]; 214 static const char KEY_QC_MANUAL_FOCUS_POS_TYPE[]; 215 static const char KEY_QC_MIN_FOCUS_POS_INDEX[]; 216 static const char KEY_QC_MAX_FOCUS_POS_INDEX[]; 217 static const char KEY_QC_MIN_FOCUS_POS_DAC[]; 218 static const char KEY_QC_MAX_FOCUS_POS_DAC[]; 219 static const char KEY_QC_MIN_FOCUS_POS_RATIO[]; 220 static const char KEY_QC_MAX_FOCUS_POS_RATIO[]; 221 static const char KEY_QC_MIN_FOCUS_POS_DIOPTER[]; 222 static const char KEY_QC_MAX_FOCUS_POS_DIOPTER[]; 223 static const char KEY_QC_FOCUS_POSITION_SCALE[]; 224 static const char KEY_QC_FOCUS_POSITION_DIOPTER[]; 225 226 static const char KEY_QC_SUPPORTED_MANUAL_FOCUS_MODES[]; 227 static const char KEY_QC_SUPPORTED_MANUAL_EXPOSURE_MODES[]; 228 static const char KEY_QC_SUPPORTED_MANUAL_WB_MODES[]; 229 static const char KEY_QC_FOCUS_SCALE_MODE[]; 230 static const char KEY_QC_FOCUS_DIOPTER_MODE[]; 231 static const char KEY_QC_ISO_PRIORITY[]; 232 static const char KEY_QC_EXP_TIME_PRIORITY[]; 233 static const char KEY_QC_USER_SETTING[]; 234 static const char KEY_QC_WB_CCT_MODE[]; 235 static const char KEY_QC_WB_GAIN_MODE[]; 236 static const char KEY_QC_MANUAL_WB_TYPE[]; 237 static const char KEY_QC_MANUAL_WB_VALUE[]; 238 static const char KEY_QC_CURRENT_EXPOSURE_TIME[]; 239 static const char KEY_QC_CURRENT_ISO[]; 240 static const char KEY_QC_CACHE_VIDEO_BUFFERS[]; 241 242 // DENOISE 243 static const char KEY_QC_DENOISE[]; 244 static const char KEY_QC_SUPPORTED_DENOISE[]; 245 246 //Selectable zone AF. 247 static const char KEY_QC_FOCUS_ALGO[]; 248 static const char KEY_QC_SUPPORTED_FOCUS_ALGOS[]; 249 250 //Face Detection 251 static const char KEY_QC_FACE_DETECTION[]; 252 static const char KEY_QC_SUPPORTED_FACE_DETECTION[]; 253 254 //Face Recognition 255 static const char KEY_QC_FACE_RECOGNITION[]; 256 static const char KEY_QC_SUPPORTED_FACE_RECOGNITION[]; 257 258 // supported camera features to be queried by Snapdragon SDK 259 //Read only 260 static const char KEY_QC_SUPPORTED_CAMERA_FEATURES[]; 261 262 //Indicates number of faces requested by the application. 263 //This value will be rejected if the requested faces 264 //greater than supported by hardware. 265 //Write only. 266 static const char KEY_QC_MAX_NUM_REQUESTED_FACES[]; 267 268 //preview flip 269 static const char KEY_QC_PREVIEW_FLIP[]; 270 //video flip 271 static const char KEY_QC_VIDEO_FLIP[]; 272 //snapshot picture flip 273 static const char KEY_QC_SNAPSHOT_PICTURE_FLIP[]; 274 275 static const char KEY_QC_SUPPORTED_FLIP_MODES[]; 276 277 //Face Detection, Facial processing requirement 278 static const char KEY_QC_SNAPSHOT_FD_DATA[]; 279 280 //Auto HDR enable 281 static const char KEY_QC_AUTO_HDR_ENABLE[]; 282 // video rotation 283 static const char KEY_QC_VIDEO_ROTATION[]; 284 static const char KEY_QC_SUPPORTED_VIDEO_ROTATION_VALUES[]; 285 286 //Redeye Reduction 287 static const char KEY_QC_REDEYE_REDUCTION[]; 288 static const char KEY_QC_SUPPORTED_REDEYE_REDUCTION[]; 289 static const char EFFECT_EMBOSS[]; 290 static const char EFFECT_SKETCH[]; 291 static const char EFFECT_NEON[]; 292 static const char EFFECT_BEAUTY[]; 293 294 //AF Bracketing 295 static const char KEY_QC_AF_BRACKET[]; 296 static const char KEY_QC_SUPPORTED_AF_BRACKET_MODES[]; 297 298 //Refocus 299 static const char KEY_QC_RE_FOCUS[]; 300 static const char KEY_QC_SUPPORTED_RE_FOCUS_MODES[]; 301 302 //Chroma Flash 303 static const char KEY_QC_CHROMA_FLASH[]; 304 static const char KEY_QC_SUPPORTED_CHROMA_FLASH_MODES[]; 305 306 //Opti Zoom 307 static const char KEY_QC_OPTI_ZOOM[]; 308 static const char KEY_QC_SUPPORTED_OPTI_ZOOM_MODES[]; 309 310 // Auto HDR supported 311 static const char KEY_QC_AUTO_HDR_SUPPORTED[]; 312 313 // HDR modes 314 static const char KEY_QC_HDR_MODE[]; 315 static const char KEY_QC_SUPPORTED_KEY_QC_HDR_MODES[]; 316 317 //True Portrait 318 static const char KEY_QC_TRUE_PORTRAIT[]; 319 static const char KEY_QC_SUPPORTED_TRUE_PORTRAIT_MODES[]; 320 321 //See more 322 static const char KEY_QC_SEE_MORE[]; 323 static const char KEY_QC_SUPPORTED_SEE_MORE_MODES[]; 324 325 //Still more 326 static const char KEY_QC_STILL_MORE[]; 327 static const char KEY_QC_SUPPORTED_STILL_MORE_MODES[]; 328 329 //Noise reduction mode 330 static const char KEY_QC_NOISE_REDUCTION_MODE[]; 331 static const char KEY_QC_NOISE_REDUCTION_MODE_VALUES[]; 332 333 //Longshot 334 static const char KEY_QC_LONGSHOT_SUPPORTED[]; 335 336 //ZSL+HDR 337 static const char KEY_QC_ZSL_HDR_SUPPORTED[]; 338 339 // Values for Touch AF/AEC 340 static const char TOUCH_AF_AEC_OFF[]; 341 static const char TOUCH_AF_AEC_ON[]; 342 343 // Values for Scene mode 344 static const char SCENE_MODE_ASD[]; 345 static const char SCENE_MODE_BACKLIGHT[]; 346 static const char SCENE_MODE_FLOWERS[]; 347 static const char SCENE_MODE_AR[]; 348 static const char SCENE_MODE_HDR[]; 349 static const char PIXEL_FORMAT_YUV420SP_ADRENO[]; // ADRENO 350 static const char PIXEL_FORMAT_YV12[]; // NV12 351 static const char PIXEL_FORMAT_NV12[]; //NV12 352 static const char QC_PIXEL_FORMAT_NV12_VENUS[]; //NV12 VENUS 353 354 // Values for raw picture format 355 static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_YUYV[]; 356 static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_YVYU[]; 357 static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_UYVY[]; 358 static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_VYUY[]; 359 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8GBRG[]; 360 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8GRBG[]; 361 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8RGGB[]; 362 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8BGGR[]; 363 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10GBRG[]; 364 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10GRBG[]; 365 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10RGGB[]; 366 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10BGGR[]; 367 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12GBRG[]; 368 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12GRBG[]; 369 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12RGGB[]; 370 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12BGGR[]; 371 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14GBRG[]; 372 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14GRBG[]; 373 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14RGGB[]; 374 static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14BGGR[]; 375 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8GBRG[]; 376 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8GRBG[]; 377 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8RGGB[]; 378 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8BGGR[]; 379 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10GBRG[]; 380 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10GRBG[]; 381 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10RGGB[]; 382 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10BGGR[]; 383 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12GBRG[]; 384 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12GRBG[]; 385 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12RGGB[]; 386 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12BGGR[]; 387 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14GBRG[]; 388 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14GRBG[]; 389 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14RGGB[]; 390 static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14BGGR[]; 391 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8GBRG[]; 392 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8GRBG[]; 393 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8RGGB[]; 394 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8BGGR[]; 395 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10GBRG[]; 396 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10GRBG[]; 397 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10RGGB[]; 398 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10BGGR[]; 399 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12GBRG[]; 400 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12GRBG[]; 401 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12RGGB[]; 402 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12BGGR[]; 403 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14GBRG[]; 404 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14GRBG[]; 405 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14RGGB[]; 406 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14BGGR[]; 407 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8GBRG[]; 408 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8GRBG[]; 409 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8RGGB[]; 410 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8BGGR[]; 411 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10GBRG[]; 412 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10GRBG[]; 413 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10RGGB[]; 414 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10BGGR[]; 415 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12GBRG[]; 416 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12GRBG[]; 417 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12RGGB[]; 418 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12BGGR[]; 419 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14GBRG[]; 420 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14GRBG[]; 421 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14RGGB[]; 422 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14BGGR[]; 423 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8GBRG[]; 424 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8GRBG[]; 425 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8RGGB[]; 426 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8BGGR[]; 427 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8GBRG[]; 428 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8GRBG[]; 429 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8RGGB[]; 430 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8BGGR[]; 431 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10GBRG[]; 432 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10GRBG[]; 433 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10RGGB[]; 434 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10BGGR[]; 435 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12GBRG[]; 436 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12GRBG[]; 437 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12RGGB[]; 438 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12BGGR[]; 439 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14GBRG[]; 440 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14GRBG[]; 441 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14RGGB[]; 442 static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14BGGR[]; 443 444 // ISO values 445 static const char ISO_AUTO[]; 446 static const char ISO_HJR[]; 447 static const char ISO_100[]; 448 static const char ISO_200[]; 449 static const char ISO_400[]; 450 static const char ISO_800[]; 451 static const char ISO_1600[]; 452 static const char ISO_3200[]; 453 static const char ISO_MANUAL[]; 454 455 // Values for auto exposure settings. 456 static const char AUTO_EXPOSURE_FRAME_AVG[]; 457 static const char AUTO_EXPOSURE_CENTER_WEIGHTED[]; 458 static const char AUTO_EXPOSURE_SPOT_METERING[]; 459 static const char AUTO_EXPOSURE_SMART_METERING[]; 460 static const char AUTO_EXPOSURE_USER_METERING[]; 461 static const char AUTO_EXPOSURE_SPOT_METERING_ADV[]; 462 static const char AUTO_EXPOSURE_CENTER_WEIGHTED_ADV[]; 463 464 static const char KEY_QC_SHARPNESS[]; 465 static const char KEY_QC_MIN_SHARPNESS[]; 466 static const char KEY_QC_MAX_SHARPNESS[]; 467 static const char KEY_QC_SHARPNESS_STEP[]; 468 static const char KEY_QC_CONTRAST[]; 469 static const char KEY_QC_MIN_CONTRAST[]; 470 static const char KEY_QC_MAX_CONTRAST[]; 471 static const char KEY_QC_CONTRAST_STEP[]; 472 static const char KEY_QC_SATURATION[]; 473 static const char KEY_QC_MIN_SATURATION[]; 474 static const char KEY_QC_MAX_SATURATION[]; 475 static const char KEY_QC_SATURATION_STEP[]; 476 static const char KEY_QC_BRIGHTNESS[]; 477 static const char KEY_QC_MIN_BRIGHTNESS[]; 478 static const char KEY_QC_MAX_BRIGHTNESS[]; 479 static const char KEY_QC_BRIGHTNESS_STEP[]; 480 static const char KEY_QC_SCE_FACTOR[]; 481 static const char KEY_QC_MIN_SCE_FACTOR[]; 482 static const char KEY_QC_MAX_SCE_FACTOR[]; 483 static const char KEY_QC_SCE_FACTOR_STEP[]; 484 485 static const char KEY_QC_HISTOGRAM[] ; 486 static const char KEY_QC_SUPPORTED_HISTOGRAM_MODES[] ; 487 static const char KEY_QC_SUPPORTED_HDR_NEED_1X[]; 488 static const char KEY_QC_HDR_NEED_1X[]; 489 static const char KEY_QC_VIDEO_HDR[]; 490 static const char KEY_QC_VT_ENABLE[]; 491 static const char KEY_QC_SUPPORTED_VIDEO_HDR_MODES[]; 492 static const char KEY_QC_SENSOR_HDR[]; 493 static const char KEY_QC_SUPPORTED_SENSOR_HDR_MODES[]; 494 static const char KEY_QC_RDI_MODE[]; 495 static const char KEY_QC_SUPPORTED_RDI_MODES[]; 496 static const char KEY_QC_SECURE_MODE[]; 497 static const char KEY_QC_SUPPORTED_SECURE_MODES[]; 498 499 // Values for SKIN TONE ENHANCEMENT 500 static const char SKIN_TONE_ENHANCEMENT_ENABLE[] ; 501 static const char SKIN_TONE_ENHANCEMENT_DISABLE[] ; 502 503 // Values for Denoise 504 static const char DENOISE_OFF[] ; 505 static const char DENOISE_ON[] ; 506 507 // Values for auto exposure settings. 508 static const char FOCUS_ALGO_AUTO[]; 509 static const char FOCUS_ALGO_SPOT_METERING[]; 510 static const char FOCUS_ALGO_CENTER_WEIGHTED[]; 511 static const char FOCUS_ALGO_FRAME_AVERAGE[]; 512 513 // Values for AE Bracketing settings. 514 static const char AE_BRACKET_OFF[]; 515 static const char AE_BRACKET[]; 516 517 // Values for AF Bracketing settings. 518 static const char AF_BRACKET_OFF[]; 519 static const char AF_BRACKET_ON[]; 520 521 // Values for Refocus settings. 522 static const char RE_FOCUS_OFF[]; 523 static const char RE_FOCUS_ON[]; 524 525 // Values for Chroma Flash settings. 526 static const char CHROMA_FLASH_OFF[]; 527 static const char CHROMA_FLASH_ON[]; 528 529 // Values for Opti Zoom settings. 530 static const char OPTI_ZOOM_OFF[]; 531 static const char OPTI_ZOOM_ON[]; 532 533 // Values for Still More settings. 534 static const char STILL_MORE_OFF[]; 535 static const char STILL_MORE_ON[]; 536 537 // Values for HDR mode settings. 538 static const char HDR_MODE_SENSOR[]; 539 static const char HDR_MODE_MULTI_FRAME[]; 540 541 // Values for True Portrait settings. 542 static const char TRUE_PORTRAIT_OFF[]; 543 static const char TRUE_PORTRAIT_ON[]; 544 545 // Values for HFR settings. 546 static const char VIDEO_HFR_OFF[]; 547 static const char VIDEO_HFR_2X[]; 548 static const char VIDEO_HFR_3X[]; 549 static const char VIDEO_HFR_4X[]; 550 static const char VIDEO_HFR_5X[]; 551 static const char VIDEO_HFR_6X[]; 552 static const char VIDEO_HFR_7X[]; 553 static const char VIDEO_HFR_8X[]; 554 static const char VIDEO_HFR_9X[]; 555 556 // Values for feature on/off settings. 557 static const char VALUE_OFF[]; 558 static const char VALUE_ON[]; 559 560 // Values for feature enable/disable settings. 561 static const char VALUE_ENABLE[]; 562 static const char VALUE_DISABLE[]; 563 564 // Values for feature true/false settings. 565 static const char VALUE_FALSE[]; 566 static const char VALUE_TRUE[]; 567 568 //Values for flip settings 569 static const char FLIP_MODE_OFF[]; 570 static const char FLIP_MODE_V[]; 571 static const char FLIP_MODE_H[]; 572 static const char FLIP_MODE_VH[]; 573 574 //Values for CDS Mode 575 static const char CDS_MODE_OFF[]; 576 static const char CDS_MODE_ON[]; 577 static const char CDS_MODE_AUTO[]; 578 579 static const char VALUE_FAST[]; 580 static const char VALUE_HIGH_QUALITY[]; 581 582 static const char KEY_SELECTED_AUTO_SCENE[]; 583 584 // Values for Video rotation 585 static const char VIDEO_ROTATION_0[]; 586 static const char VIDEO_ROTATION_90[]; 587 static const char VIDEO_ROTATION_180[]; 588 static const char VIDEO_ROTATION_270[]; 589 590#ifdef TARGET_TS_MAKEUP 591 static const char KEY_TS_MAKEUP[]; 592 static const char KEY_TS_MAKEUP_WHITEN[]; 593 static const char KEY_TS_MAKEUP_CLEAN[]; 594#endif 595 //param key for HFR batch size 596 static const char KEY_QC_VIDEO_BATCH_SIZE[]; 597 enum { 598 CAMERA_ORIENTATION_UNKNOWN = 0, 599 CAMERA_ORIENTATION_PORTRAIT = 1, 600 CAMERA_ORIENTATION_LANDSCAPE = 2, 601 }; 602 603 template <typename valueType> struct QCameraMap { 604 const char *const desc; 605 valueType val; 606 }; 607 608public: 609 QCameraParameters(); 610 QCameraParameters(const String8 ¶ms); 611 ~QCameraParameters(); 612 613 int32_t allocate(); 614 int32_t init(cam_capability_t *, 615 mm_camera_vtbl_t *, 616 QCameraAdjustFPS *); 617 void deinit(); 618 int32_t initDefaultParameters(); 619 int32_t updateParameters(const String8& params, bool &needRestart); 620 int32_t commitParameters(); 621 622 char* getParameters(); 623 void getPreviewFpsRange(int *min_fps, int *max_fps) const { 624 CameraParameters::getPreviewFpsRange(min_fps, max_fps); 625 } 626#ifdef TARGET_TS_MAKEUP 627 bool getTsMakeupInfo(int &whiteLevel, int &cleanLevel) const; 628#endif 629 630 int getPreviewHalPixelFormat(); 631 int32_t getStreamRotation(cam_stream_type_t streamType, 632 cam_pp_feature_config_t &featureConfig, 633 cam_dimension_t &dim); 634 int32_t getStreamFormat(cam_stream_type_t streamType, 635 cam_format_t &format); 636 int32_t getStreamDimension(cam_stream_type_t streamType, 637 cam_dimension_t &dim); 638 void getThumbnailSize(int *width, int *height) const; 639 640 641 uint8_t getZSLBurstInterval(); 642 uint8_t getZSLQueueDepth(); 643 uint8_t getZSLBackLookCount(); 644 uint8_t getMaxUnmatchedFramesInQueue(); 645 bool isZSLMode() {return m_bZslMode;}; 646 bool isRdiMode() {return m_bRdiMode;}; 647 bool isSecureMode() {return m_bSecureMode;}; 648 bool isNoDisplayMode() {return m_bNoDisplayMode;}; 649 bool isWNREnabled() {return m_bWNROn;}; 650 bool isTNRSnapshotEnabled() {return m_bTNRSnapshotOn;}; 651 int32_t getCDSMode() {return mCds_mode;}; 652 bool isLTMForSeeMoreEnabled() {return m_bLtmForSeeMoreEnabled;}; 653 bool isHfrMode() {return m_bHfrMode;}; 654 void getHfrFps(cam_fps_range_t &pFpsRange) { pFpsRange = m_hfrFpsRange;}; 655 uint8_t getNumOfSnapshots(); 656 uint8_t getNumOfRetroSnapshots(); 657 uint8_t getNumOfExtraHDRInBufsIfNeeded(); 658 uint8_t getNumOfExtraHDROutBufsIfNeeded(); 659 660 bool getRecordingHintValue() {return m_bRecordingHint;}; // return local copy of video hint 661 uint32_t getJpegQuality(); 662 uint32_t getRotation(); 663 uint32_t getDeviceRotation(); 664 uint32_t getJpegExifRotation(); 665 bool useJpegExifRotation(); 666 int32_t getEffectValue(); 667 668 int32_t getExifDateTime(String8 &dateTime, String8 &subsecTime); 669 int32_t getExifFocalLength(rat_t *focalLenght); 670 uint16_t getExifIsoSpeed(); 671 int32_t getExifGpsProcessingMethod(char *gpsProcessingMethod, uint32_t &count); 672 int32_t getExifLatitude(rat_t *latitude, char *latRef); 673 int32_t getExifLongitude(rat_t *longitude, char *lonRef); 674 int32_t getExifAltitude(rat_t *altitude, char *altRef); 675 int32_t getExifGpsDateTimeStamp(char *gpsDateStamp, uint32_t bufLen, rat_t *gpsTimeStamp); 676 bool isVideoBuffersCached(); 677 int32_t updateFocusDistances(cam_focus_distances_info_t *focusDistances); 678 679 bool isAEBracketEnabled(); 680 int32_t setAEBracketing(); 681 bool isFpsDebugEnabled() {return m_bDebugFps;}; 682 bool isHistogramEnabled() {return m_bHistogramEnabled;}; 683 bool isSceneSelectionEnabled() {return m_bSceneSelection;}; 684 int32_t setSelectedScene(cam_scene_mode_type scene); 685 cam_scene_mode_type getSelectedScene(); 686 bool isFaceDetectionEnabled() {return ((m_nFaceProcMask & 687 (CAM_FACE_PROCESS_MASK_DETECTION | CAM_FACE_PROCESS_MASK_FOCUS)) != 0);}; 688 int32_t setFaceDetectionOption(bool enabled); 689 int32_t setHistogram(bool enabled); 690 int32_t setFaceDetection(bool enabled, bool initCommit); 691 int32_t setFrameSkip(enum msm_vfe_frame_skip_pattern pattern); 692 qcamera_thermal_mode getThermalMode() {return m_ThermalMode;}; 693 int32_t updateRecordingHintValue(int32_t value); 694 int32_t setHDRAEBracket(cam_exp_bracketing_t hdrBracket); 695 bool isHDREnabled(); 696 bool isAutoHDREnabled(); 697 int32_t stopAEBracket(); 698 int32_t updateRAW(cam_dimension_t max_dim); 699 bool isDISEnabled(); 700 cam_is_type_t getISType(); 701 uint8_t getMobicatMask(); 702 703 cam_focus_mode_type getFocusMode() const {return mFocusMode;}; 704 int32_t setNumOfSnapshot(); 705 int32_t adjustPreviewFpsRange(cam_fps_range_t *fpsRange); 706 bool isJpegPictureFormat() {return (mPictureFormat == CAM_FORMAT_JPEG);}; 707 bool isNV16PictureFormat() {return (mPictureFormat == CAM_FORMAT_YUV_422_NV16);}; 708 bool isNV21PictureFormat() {return (mPictureFormat == CAM_FORMAT_YUV_420_NV21);}; 709 cam_denoise_process_type_t getDenoiseProcessPlate(cam_intf_parm_type_t type); 710 int32_t getMaxPicSize(cam_dimension_t &dim) { dim = m_maxPicSize; return NO_ERROR; }; 711 int getFlipMode(cam_stream_type_t streamType); 712 bool isSnapshotFDNeeded(); 713 714 bool isHDR1xFrameEnabled() {return m_bHDR1xFrameEnabled;} 715 bool isSupportedSensorHdrSize(const QCameraParameters& params); 716 bool isYUVFrameInfoNeeded(); 717 const char*getFrameFmtString(cam_format_t fmt); 718 bool isHDR1xExtraBufferNeeded() {return m_bHDR1xExtraBufferNeeded;} 719 bool isHDROutputCropEnabled() {return m_bHDROutputCropEnabled;} 720 721 bool isPreviewFlipChanged() { return m_bPreviewFlipChanged; }; 722 bool isVideoFlipChanged() { return m_bVideoFlipChanged; }; 723 bool isSnapshotFlipChanged() { return m_bSnapshotFlipChanged; }; 724 void setHDRSceneEnable(bool bflag); 725 int32_t updateAWBParams(cam_awb_params_t &awb_params); 726 727 const char *getASDStateString(cam_auto_scene_t scene); 728 bool isHDRThumbnailProcessNeeded() { return m_bHDRThumbnailProcessNeeded; }; 729 void setMinPpMask(uint32_t min_pp_mask) { m_nMinRequiredPpMask = min_pp_mask; }; 730 bool setStreamConfigure(bool isCapture, bool previewAsPostview, bool resetConfig); 731 int32_t addOnlineRotation(uint32_t rotation, uint32_t streamId, int32_t device_rotation); 732 uint8_t getNumOfExtraBuffersForImageProc(); 733 uint8_t getNumOfExtraBuffersForVideo(); 734 uint8_t getNumOfExtraBuffersForPreview(); 735 uint32_t getExifBufIndex(uint32_t captureIndex); 736 bool needThumbnailReprocess(uint32_t *pFeatureMask); 737 inline bool isUbiFocusEnabled() {return m_bAFBracketingOn && !m_bReFocusOn;}; 738 inline bool isChromaFlashEnabled() {return m_bChromaFlashOn;}; 739 inline bool isHighQualityNoiseReductionMode() {return m_bHighQualityNoiseReductionMode;}; 740 inline bool isTruePortraitEnabled() {return m_bTruePortraitOn;}; 741 inline size_t getTPMaxMetaSize() { 742 return m_pCapability->true_portrait_settings_need.meta_max_size;}; 743 inline bool isSeeMoreEnabled() {return m_bSeeMoreOn;}; 744 inline bool isStillMoreEnabled() {return m_bStillMoreOn;}; 745 bool isOptiZoomEnabled(); 746 747 int32_t commitAFBracket(cam_af_bracketing_t afBracket); 748 int32_t set3ALock(bool lock3A); 749 int32_t setAndCommitZoom(int zoom_level); 750 uint8_t getBurstCountForAdvancedCapture(); 751 uint32_t getNumberInBufsForSingleShot(); 752 uint32_t getNumberOutBufsForSingleShot(); 753 int32_t setLongshotEnable(bool enable); 754 String8 dump(); 755 inline bool isUbiRefocus() {return m_bReFocusOn && 756 (m_pCapability->refocus_af_bracketing_need.output_count > 1);}; 757 inline uint32_t getRefocusMaxMetaSize() { 758 return m_pCapability->refocus_af_bracketing_need.meta_max_size;}; 759 inline uint8_t getRefocusOutputCount() { 760 return m_pCapability->refocus_af_bracketing_need.output_count;}; 761 inline bool generateThumbFromMain() {return isUbiFocusEnabled() || 762 isChromaFlashEnabled() || isOptiZoomEnabled() || isUbiRefocus() 763 || isHDREnabled() || isStillMoreEnabled() || isTruePortraitEnabled(); } 764 void updateCurrentFocusPosition(cam_focus_pos_info_t &cur_pos_info); 765 void updateAEInfo(cam_3a_params_t &ae_params); 766 bool isAdvCamFeaturesEnabled() {return isUbiFocusEnabled() || 767 isChromaFlashEnabled() || m_bOptiZoomOn || isHDREnabled() || 768 isAEBracketEnabled() || isStillMoreEnabled() || isUbiRefocus();} 769 int32_t setAecLock(const char *aecStr); 770 int32_t updateDebugLevel(); 771 bool is4k2kVideoResolution(); 772 bool isUBWCEnabled(); 773 774 int getBrightness(); 775 int32_t updateOisValue(bool oisValue); 776 int32_t setIntEvent(cam_int_evt_params_t params); 777 bool getofflineRAW() {return mOfflineRAW;} 778 int32_t updatePpFeatureMask(cam_stream_type_t stream_type); 779 int32_t getStreamPpMask(cam_stream_type_t stream_type, uint32_t &pp_mask); 780 int32_t getSharpness() {return m_nSharpness;}; 781 int32_t getEffect() {return mParmEffect;}; 782 int32_t updateFlashMode(cam_flash_mode_t flash_mode); 783 int32_t configureAEBracketing(cam_capture_frame_config_t &frame_config); 784 int32_t configureHDRBracketing(cam_capture_frame_config_t &frame_config); 785 int32_t configFrameCapture(bool commitSettings); 786 int32_t resetFrameCapture(bool commitSettings); 787 cam_still_more_t getStillMoreSettings() {return m_stillmore_config;}; 788 void setStillMoreSettings(cam_still_more_t stillmore_config) 789 {m_stillmore_config = stillmore_config;}; 790 cam_still_more_t getStillMoreCapability() 791 {return m_pCapability->stillmore_settings_need;}; 792 cam_dyn_img_data_t getDynamicImgData() { return m_DynamicImgData; } 793 void setDynamicImgData(cam_dyn_img_data_t d) { m_DynamicImgData = d; } 794 795 int32_t getParmZoomLevel(){return mParmZoomLevel;}; 796 int8_t getReprocCount(){return mTotalPPCount;}; 797 bool isMultiPassReprocessing(); 798 int8_t getCurPPCount(){return mCurPPCount;}; 799 void setReprocCount(); 800 bool isPostProcScaling(); 801 bool isLLNoiseEnabled(); 802 void setCurPPCount(int8_t count) {mCurPPCount = count;}; 803 int32_t setToneMapMode(uint32_t value, bool initCommit); 804 void setTintless(bool enable); 805 uint8_t getLongshotStages(); 806 int8_t getBufBatchCount() {return mBufBatchCnt;}; 807 int8_t getVideoBatchSize() {return mVideoBatchSize;}; 808 809 int32_t setManualCaptureMode( 810 QCameraManualCaptureModes value = CAM_MANUAL_CAPTURE_TYPE_OFF); 811 QCameraManualCaptureModes getManualCaptureMode() 812 {return m_ManualCaptureMode;}; 813 int64_t getExposureTime() {return m_expTime;}; 814 815 cam_capture_frame_config_t getCaptureFrameConfig() 816 { return m_captureFrameConfig; }; 817 void setJpegRotation(int rotation); 818 uint32_t getJpegRotation() { return mJpegRotation;}; 819 820 void setLowLightLevel(cam_low_light_mode_t value) 821 { m_LowLightLevel = value; }; 822 cam_low_light_mode_t getLowLightLevel() {return m_LowLightLevel;}; 823 bool getLowLightCapture() { return m_LLCaptureEnabled; }; 824 825 /* Dual camera specific */ 826 bool getDcrf() { return m_bDcrfEnabled; } 827 int32_t setRelatedCamSyncInfo( 828 cam_sync_related_sensors_event_info_t* info); 829 const cam_sync_related_sensors_event_info_t* 830 getRelatedCamSyncInfo(void); 831 int32_t getRelatedCamCalibration( 832 cam_related_system_calibration_data_t* calib); 833 int32_t bundleRelatedCameras(bool sync, uint32_t sessionid); 834 bool isFDInVideoEnabled(); 835 bool isOEMFeatEnabled() { return m_bOEMFeatEnabled; } 836 837 int32_t setZslMode(bool value); 838 int32_t updateZSLModeValue(bool value); 839 840 bool isReprocScaleEnabled(); 841 bool isUnderReprocScaling(); 842 int32_t getPicSizeFromAPK(int &width, int &height); 843 844 int32_t checkFeatureConcurrency(); 845private: 846 int32_t setPreviewSize(const QCameraParameters& ); 847 int32_t setVideoSize(const QCameraParameters& ); 848 int32_t setPictureSize(const QCameraParameters& ); 849 int32_t setLiveSnapshotSize(const QCameraParameters& ); 850 int32_t setPreviewFormat(const QCameraParameters& ); 851 int32_t setPictureFormat(const QCameraParameters& ); 852 int32_t setOrientation(const QCameraParameters& ); 853 int32_t setJpegThumbnailSize(const QCameraParameters& ); 854 int32_t setJpegQuality(const QCameraParameters& ); 855 int32_t setPreviewFpsRange(const QCameraParameters& ); 856 int32_t setPreviewFrameRate(const QCameraParameters& ); 857 int32_t setAutoExposure(const QCameraParameters& ); 858 int32_t setEffect(const QCameraParameters& ); 859 int32_t setBrightness(const QCameraParameters& ); 860 int32_t setFocusMode(const QCameraParameters& ); 861 int32_t setFocusPosition(const QCameraParameters& ); 862 int32_t setSharpness(const QCameraParameters& ); 863 int32_t setSaturation(const QCameraParameters& ); 864 int32_t setContrast(const QCameraParameters& ); 865 int32_t setSkinToneEnhancement(const QCameraParameters& ); 866 int32_t setSceneDetect(const QCameraParameters& ); 867 int32_t setVideoHDR(const QCameraParameters& ); 868 int32_t setVtEnable(const QCameraParameters& ); 869 int32_t setZoom(const QCameraParameters& ); 870 int32_t setISOValue(const QCameraParameters& ); 871 int32_t setContinuousISO(const QCameraParameters& ); 872 int32_t setExposureTime(const QCameraParameters& ); 873 int32_t setRotation(const QCameraParameters& ); 874 int32_t setVideoRotation(const QCameraParameters& ); 875 int32_t setFlash(const QCameraParameters& ); 876 int32_t setAecLock(const QCameraParameters& ); 877 int32_t setAwbLock(const QCameraParameters& ); 878 int32_t setMCEValue(const QCameraParameters& ); 879 int32_t setDISValue(const QCameraParameters& params); 880 int32_t setLensShadeValue(const QCameraParameters& ); 881 int32_t setExposureCompensation(const QCameraParameters& ); 882 int32_t setWhiteBalance(const QCameraParameters& ); 883 int32_t setManualWhiteBalance(const QCameraParameters& ); 884 int32_t setAntibanding(const QCameraParameters& ); 885 int32_t setFocusAreas(const QCameraParameters& ); 886 int32_t setMeteringAreas(const QCameraParameters& ); 887 int32_t setSceneMode(const QCameraParameters& ); 888 int32_t setSelectableZoneAf(const QCameraParameters& ); 889 int32_t setAEBracket(const QCameraParameters& ); 890 int32_t setAFBracket(const QCameraParameters& ); 891 int32_t setReFocus(const QCameraParameters& ); 892 int32_t setChromaFlash(const QCameraParameters& ); 893 int32_t setOptiZoom(const QCameraParameters& ); 894 int32_t setHDRMode(const QCameraParameters& ); 895 int32_t setHDRNeed1x(const QCameraParameters& ); 896 int32_t setTruePortrait(const QCameraParameters& ); 897 int32_t setSeeMore(const QCameraParameters& ); 898 int32_t setStillMore(const QCameraParameters& ); 899 int32_t setNoiseReductionMode(const QCameraParameters& ); 900 int32_t setRedeyeReduction(const QCameraParameters& ); 901 int32_t setGpsLocation(const QCameraParameters& ); 902 int32_t setRecordingHint(const QCameraParameters& ); 903 int32_t setNoDisplayMode(const QCameraParameters& ); 904 int32_t setWaveletDenoise(const QCameraParameters& ); 905 int32_t setTemporalDenoise(const QCameraParameters&); 906 int32_t setZslMode(const QCameraParameters& ); 907 int32_t setZslAttributes(const QCameraParameters& ); 908 int32_t setAutoHDR(const QCameraParameters& params); 909 int32_t setCameraMode(const QCameraParameters& ); 910 int32_t setSceneSelectionMode(const QCameraParameters& params); 911 int32_t setFaceRecognition(const QCameraParameters& ); 912 int32_t setFlip(const QCameraParameters& ); 913 int32_t setBurstNum(const QCameraParameters& params); 914 int32_t setRetroActiveBurstNum(const QCameraParameters& params); 915 int32_t setBurstLEDOnPeriod(const QCameraParameters& params); 916 int32_t setSnapshotFDReq(const QCameraParameters& ); 917 int32_t setStatsDebugMask(); 918 int32_t setPAAF(); 919 int32_t setTintlessValue(const QCameraParameters& params); 920 int32_t setCDSMode(const QCameraParameters& params); 921 int32_t setInitialExposureIndex(const QCameraParameters& params); 922 int32_t setMobicat(const QCameraParameters& params); 923 int32_t setRdiMode(const QCameraParameters& ); 924 int32_t setSecureMode(const QCameraParameters& ); 925 int32_t setCacheVideoBuffers(const QCameraParameters& params); 926 int32_t setCustomParams(const QCameraParameters& params); 927 int32_t setAutoExposure(const char *autoExp); 928 int32_t setPreviewFpsRange(int min_fps,int max_fps, 929 int vid_min_fps,int vid_max_fps); 930 int32_t setEffect(const char *effect); 931 int32_t setBrightness(int brightness); 932 int32_t setFocusMode(const char *focusMode); 933 int32_t setFocusPosition(const char *typeStr, const char *posStr); 934 int32_t setSharpness(int sharpness); 935 int32_t setSaturation(int saturation); 936 int32_t setContrast(int contrast); 937 int32_t setSkinToneEnhancement(int sceFactor); 938 int32_t setSceneDetect(const char *scendDetect); 939 int32_t setVideoHDR(const char *videoHDR); 940 int32_t setSensorSnapshotHDR(const char *snapshotHDR); 941 int32_t setVtEnable(const char *vtEnable); 942 int32_t setZoom(int zoom_level); 943 int32_t setISOValue(const char *isoValue); 944 int32_t setContinuousISO(const char *isoValue); 945 int32_t setExposureTime(const char *expTimeStr); 946 int32_t setFlash(const char *flashStr); 947 int32_t setAwbLock(const char *awbStr); 948 int32_t setMCEValue(const char *mceStr); 949 int32_t setDISValue(const char *disStr); 950 int32_t setHighFrameRate(const int32_t hfrMode); 951 int32_t setLensShadeValue(const char *lensShadeStr); 952 int32_t setExposureCompensation(int expComp); 953 int32_t setWhiteBalance(const char *wbStr); 954 int32_t setWBManualCCT(const char *cctStr); 955 int32_t setManualWBGains(const char *gainStr); 956 int32_t setAntibanding(const char *antiBandingStr); 957 int32_t setFocusAreas(const char *focusAreasStr); 958 int32_t setMeteringAreas(const char *meteringAreasStr); 959 int32_t setSceneMode(const char *sceneModeStr); 960 int32_t setSelectableZoneAf(const char *selZoneAFStr); 961 int32_t setAEBracket(const char *aecBracketStr); 962 int32_t setAFBracket(const char *afBracketStr); 963 int32_t setReFocus(const char *reFocusStr); 964 int32_t setChromaFlash(const char *chromaFlashStr); 965 int32_t setOptiZoom(const char *optiZoomStr); 966 int32_t setHDRMode(const char *optiZoomStr); 967 int32_t setHDRNeed1x(const char *optiZoomStr); 968 int32_t setTruePortrait(const char *truePortraitStr); 969 int32_t setSeeMore(const char *SeeMoreStr); 970 int32_t setStillMore(const char *StillMoreStr); 971 int32_t setNoiseReductionMode(const char *noiseReductionModeStr); 972 int32_t setRedeyeReduction(const char *redeyeStr); 973 int32_t setWaveletDenoise(const char *wnrStr); 974 int32_t setFaceRecognition(const char *faceRecog, uint32_t maxFaces); 975 int32_t setTintlessValue(const char *tintStr); 976 bool UpdateHFRFrameRate(const QCameraParameters& params); 977 int32_t setRdiMode(const char *str); 978 int32_t setSecureMode(const char *str); 979 int32_t setLongshotParam(const QCameraParameters& params); 980 int32_t parseGains(const char *gainStr, double &r_gain, 981 double &g_gain, double &b_gain); 982 int32_t setCacheVideoBuffers(const char *cacheVideoBufStr); 983 int32_t setCDSMode(int32_t cds_mode, bool initCommit); 984 int32_t setEztune(); 985 void setLowLightCapture(); 986 int setRecordingHintValue(int32_t value); // set local copy of video hint and send to server 987 // no change in parameters value 988 int32_t updateFlash(bool commitSettings); 989 int32_t setRawSize(cam_dimension_t &dim); 990 int32_t setMaxPicSize(cam_dimension_t &dim) { m_maxPicSize = dim; return NO_ERROR; }; 991 void setBufBatchCount(int8_t buf_cnt); 992 void setVideoBatchSize(); 993 void setDcrf(); 994 int32_t setStreamPpMask(cam_stream_type_t stream_type, uint32_t pp_mask); 995 void setOfflineRAW(bool value = 0); 996 int32_t configureFlash(cam_capture_frame_config_t &frame_config); 997 int32_t configureLowLight(cam_capture_frame_config_t &frame_config); 998 int32_t configureManualCapture(cam_capture_frame_config_t &frame_config); 999 1000 bool isTNRPreviewEnabled() {return m_bTNRPreviewOn;}; 1001 bool isTNRVideoEnabled() {return m_bTNRVideoOn;}; 1002 uint8_t getBurstNum(); 1003 bool getFaceDetectionOption() { return m_bFaceDetectionOn;} 1004 bool isAVTimerEnabled(); 1005 void getLiveSnapshotSize(cam_dimension_t &dim); 1006 int32_t getRawSize(cam_dimension_t &dim) {dim = m_rawSize; return NO_ERROR;}; 1007 int getAutoFlickerMode(); 1008 bool sendStreamConfigInfo(cam_stream_size_info_t &stream_config_info); 1009 inline bool isLowMemoryDevice() {return m_bIsLowMemoryDevice;}; 1010 bool isPreviewSeeMoreRequired(); 1011 bool isEztuneEnabled() { return m_bEztuneEnabled; }; 1012 int32_t getZoomLevel(){return mZoomLevel;}; 1013 int32_t parse_pair(const char *str, int *first, int *second, 1014 char delim, char **endptr); 1015 void parseSizesList(const char *sizesStr, Vector<Size> &sizes); 1016 int32_t parseNDimVector(const char *str, int *num, int N, char delim); 1017 int32_t parseCameraAreaString(const char *str, int max_num_areas, 1018 cam_area_t *pAreas, int& num_areas_found); 1019 bool validateCameraAreas(cam_area_t *areas, int num_areas); 1020 int parseGPSCoordinate(const char *coord_str, rat_t *coord); 1021 int32_t getRational(rat_t *rat, int num, int denom); 1022 String8 createSizesString(const cam_dimension_t *sizes, size_t len); 1023 String8 createHfrValuesString(const cam_hfr_info_t *values, size_t len, 1024 const QCameraMap<cam_hfr_mode_t> *map, size_t map_len); 1025 String8 createHfrSizesString(const cam_hfr_info_t *values, size_t len); 1026 String8 createFpsRangeString(const cam_fps_range_t *fps, 1027 size_t len, int &default_fps_index); 1028 String8 createFpsString(cam_fps_range_t &fps); 1029 String8 createZoomRatioValuesString(uint32_t *zoomRatios, size_t length); 1030 int32_t setDualLedCalibration(const QCameraParameters& params); 1031 1032 // ops for batch set/get params with server 1033 int32_t initBatchUpdate(parm_buffer_t *p_table); 1034 int32_t commitSetBatch(); 1035 int32_t commitGetBatch(); 1036 1037 // ops to tempororily update parameter entries and commit 1038 int32_t updateParamEntry(const char *key, const char *value); 1039 int32_t commitParamChanges(); 1040 void updateViewAngles(); 1041 1042 // Map from strings to values 1043 static const cam_dimension_t THUMBNAIL_SIZES_MAP[]; 1044 static const QCameraMap<cam_auto_exposure_mode_type> AUTO_EXPOSURE_MAP[]; 1045 static const QCameraMap<cam_format_t> PREVIEW_FORMATS_MAP[]; 1046 static const QCameraMap<cam_format_t> PICTURE_TYPES_MAP[]; 1047 static const QCameraMap<cam_focus_mode_type> FOCUS_MODES_MAP[]; 1048 static const QCameraMap<cam_effect_mode_type> EFFECT_MODES_MAP[]; 1049 static const QCameraMap<cam_scene_mode_type> SCENE_MODES_MAP[]; 1050 static const QCameraMap<cam_flash_mode_t> FLASH_MODES_MAP[]; 1051 static const QCameraMap<cam_focus_algorithm_type> FOCUS_ALGO_MAP[]; 1052 static const QCameraMap<cam_wb_mode_type> WHITE_BALANCE_MODES_MAP[]; 1053 static const QCameraMap<cam_antibanding_mode_type> ANTIBANDING_MODES_MAP[]; 1054 static const QCameraMap<cam_iso_mode_type> ISO_MODES_MAP[]; 1055 static const QCameraMap<cam_hfr_mode_t> HFR_MODES_MAP[]; 1056 static const QCameraMap<cam_bracket_mode> BRACKETING_MODES_MAP[]; 1057 static const QCameraMap<int> ON_OFF_MODES_MAP[]; 1058 static const QCameraMap<int> ENABLE_DISABLE_MODES_MAP[]; 1059 static const QCameraMap<int> DENOISE_ON_OFF_MODES_MAP[]; 1060 static const QCameraMap<int> TRUE_FALSE_MODES_MAP[]; 1061 static const QCameraMap<int> TOUCH_AF_AEC_MODES_MAP[]; 1062 static const QCameraMap<cam_flip_t> FLIP_MODES_MAP[]; 1063 static const QCameraMap<int> AF_BRACKETING_MODES_MAP[]; 1064 static const QCameraMap<int> RE_FOCUS_MODES_MAP[]; 1065 static const QCameraMap<int> CHROMA_FLASH_MODES_MAP[]; 1066 static const QCameraMap<int> OPTI_ZOOM_MODES_MAP[]; 1067 static const QCameraMap<int> TRUE_PORTRAIT_MODES_MAP[]; 1068 static const QCameraMap<cam_cds_mode_type_t> CDS_MODES_MAP[]; 1069 static const QCameraMap<int> HDR_MODES_MAP[]; 1070 static const QCameraMap<int> VIDEO_ROTATION_MODES_MAP[]; 1071 static const QCameraMap<int> SEE_MORE_MODES_MAP[]; 1072 static const QCameraMap<int> STILL_MORE_MODES_MAP[]; 1073 static const QCameraMap<int> NOISE_REDUCTION_MODES_MAP[]; 1074 1075 QCameraReprocScaleParam m_reprocScaleParam; 1076 1077 cam_capability_t *m_pCapability; 1078 mm_camera_vtbl_t *m_pCamOpsTbl; 1079 QCameraHeapMemory *m_pParamHeap; 1080 parm_buffer_t *m_pParamBuf; // ptr to param buf in m_pParamHeap 1081 /* heap for mapping dual cam event info */ 1082 QCameraHeapMemory *m_pRelCamSyncHeap; 1083 /* ptr to sync buffer in m_pRelCamSyncHeap */ 1084 cam_sync_related_sensors_event_info_t *m_pRelCamSyncBuf; 1085 cam_sync_related_sensors_event_info_t m_relCamSyncInfo; 1086 cam_is_type_t mIsType; 1087 1088 bool m_bZslMode; // if ZSL is enabled 1089 bool m_bZslMode_new; 1090 bool m_bForceZslMode; 1091 bool m_bRecordingHint; // local copy of recording hint 1092 bool m_bRecordingHint_new; 1093 bool m_bHistogramEnabled; // if histogram is enabled 1094 bool m_bLongshotEnabled; // if longshot is enabled 1095 uint32_t m_nFaceProcMask; // face process mask 1096 bool m_bFaceDetectionOn; // if face Detection turned on by user 1097 bool m_bDebugFps; // if FPS need to be logged 1098 cam_focus_mode_type mFocusMode; 1099 cam_format_t mPreviewFormat; 1100 cam_format_t mAppPreviewFormat; 1101 int32_t mPictureFormat; // could be CAMERA_PICTURE_TYPE_JPEG or cam_format_t 1102 bool m_bNeedRestart; // if preview needs restart after parameters updated 1103 bool m_bNoDisplayMode; 1104 bool m_bWNROn; 1105 bool m_bTNRPreviewOn; 1106 bool m_bTNRVideoOn; 1107 bool m_bTNRSnapshotOn; 1108 bool m_bInited; 1109 uint8_t m_nBurstNum; 1110 int m_nRetroBurstNum; 1111 int m_nBurstLEDOnPeriod; 1112 cam_exp_bracketing_t m_AEBracketingClient; 1113 bool m_bUpdateEffects; // Cause reapplying of effects 1114 bool m_bSceneTransitionAuto; // Indicate that scene has changed to Auto 1115 bool m_bPreviewFlipChanged; // if flip setting for preview changed 1116 bool m_bVideoFlipChanged; // if flip setting for video changed 1117 bool m_bSnapshotFlipChanged; // if flip setting for snapshot changed 1118 bool m_bFixedFrameRateSet; // Indicates that a fixed frame rate is set 1119 qcamera_thermal_mode m_ThermalMode; // adjust fps vs adjust frameskip 1120 cam_dimension_t m_LiveSnapshotSize; // live snapshot size 1121 cam_dimension_t m_rawSize; // live snapshot size 1122 cam_dimension_t m_maxPicSize; 1123 bool m_bHDREnabled; // if HDR is enabled 1124 bool m_bAVTimerEnabled; //if AVTimer is enabled 1125 bool m_bDISEnabled; 1126 bool m_bOISEnabled; 1127 cam_still_more_t m_stillmore_config; 1128 1129 uint8_t m_MobiMask; 1130 QCameraAdjustFPS *m_AdjustFPS; 1131 bool m_bHDR1xFrameEnabled; // if frame with exposure compensation 0 during HDR is enabled 1132 bool m_HDRSceneEnabled; // Auto HDR indication 1133 bool m_bHDRThumbnailProcessNeeded; // if thumbnail need to be processed for HDR 1134 bool m_bHDR1xExtraBufferNeeded; // if extra frame with exposure compensation 0 during HDR is needed 1135 bool m_bHDROutputCropEnabled; // if HDR output frame need to be scaled to user resolution 1136 DefaultKeyedVector<String8,String8> m_tempMap; // map for temororily store parameters to be set 1137 cam_fps_range_t m_default_fps_range; 1138 bool m_bAFBracketingOn; 1139 bool m_bReFocusOn; 1140 bool m_bChromaFlashOn; 1141 bool m_bOptiZoomOn; 1142 bool m_bSceneSelection; 1143 Mutex m_SceneSelectLock; 1144 cam_scene_mode_type m_SelectedScene; 1145 bool m_bSeeMoreOn; 1146 bool m_bStillMoreOn; 1147 bool m_bHighQualityNoiseReductionMode; 1148 cam_fps_range_t m_hfrFpsRange; 1149 bool m_bHfrMode; 1150 bool m_bSensorHDREnabled; // if HDR is enabled 1151 bool m_bRdiMode; // if RDI mode 1152 bool m_bSecureMode; 1153 bool m_bAeBracketingEnabled; 1154 int32_t mFlashValue; 1155 int32_t mFlashDaemonValue; 1156 int32_t mHfrMode; 1157 bool m_bHDRModeSensor; 1158 bool mOfflineRAW; 1159 bool m_bTruePortraitOn; 1160 uint32_t m_nMinRequiredPpMask; 1161 uint32_t mStreamPpMask[CAM_STREAM_TYPE_MAX]; 1162 int32_t m_nSharpness; 1163 int8_t mTotalPPCount; 1164 int8_t mCurPPCount; 1165 int32_t mZoomLevel; 1166 bool m_bStreamsConfigured; 1167 int32_t mParmZoomLevel; 1168 bool m_bIsLowMemoryDevice; 1169 int32_t mCds_mode; 1170 int32_t mParmEffect; 1171 cam_capture_frame_config_t m_captureFrameConfig; 1172 int8_t mBufBatchCnt; 1173 bool m_bEztuneEnabled; 1174 bool m_bDcrfEnabled; 1175 uint32_t mRotation; 1176 uint32_t mJpegRotation; 1177 int8_t mVideoBatchSize; 1178 bool m_LLCaptureEnabled; 1179 cam_low_light_mode_t m_LowLightLevel; 1180 bool m_bLtmForSeeMoreEnabled; 1181 int64_t m_expTime; 1182 bool m_bOEMFeatEnabled; 1183 int32_t m_isoValue; 1184 QCameraManualCaptureModes m_ManualCaptureMode; 1185 cam_dyn_img_data_t m_DynamicImgData; 1186 int32_t m_dualLedCalibration; 1187}; 1188 1189}; // namespace qcamera 1190 1191#endif 1192