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