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