QCameraParameters.h revision 2f073d4cfa214187fc326377a1e0eecad84eaf3d
1/*
2**
3** Copyright 2008, The Android Open Source Project
4** Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
5** Not a Contribution. Apache license notifications and license are
6** retained for attribution purposes only.
7**
8** Licensed under the Apache License, Version 2.0 (the "License");
9** you may not use this file except in compliance with the License.
10** You may obtain a copy of the License at
11**
12**     http://www.apache.org/licenses/LICENSE-2.0
13**
14** Unless required by applicable law or agreed to in writing, software
15** distributed under the License is distributed on an "AS IS" BASIS,
16** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17** See the License for the specific language governing permissions and
18** limitations under the License.
19*/
20#ifndef ANDROID_HARDWARE_QCAMERA_PARAMETERS_H
21#define ANDROID_HARDWARE_QCAMERA_PARAMETERS_H
22
23#include <camera/CameraParameters.h>
24#include <cutils/properties.h>
25#include <hardware/camera.h>
26#include <stdlib.h>
27#include <utils/Errors.h>
28#include "cam_intf.h"
29#include "QCameraMem.h"
30#include "QCameraThermalAdapter.h"
31
32extern "C" {
33#include <mm_jpeg_interface.h>
34}
35
36using namespace android;
37
38namespace qcamera {
39
40//EXIF globals
41static const char ExifAsciiPrefix[] = { 0x41, 0x53, 0x43, 0x49, 0x49, 0x0, 0x0, 0x0 };          // "ASCII\0\0\0"
42static const char ExifUndefinedPrefix[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };   // "\0\0\0\0\0\0\0\0"
43
44#define GPS_PROCESSING_METHOD_SIZE       101
45#define EXIF_ASCII_PREFIX_SIZE           8   //(sizeof(ExifAsciiPrefix))
46#define FOCAL_LENGTH_DECIMAL_PRECISION   100
47
48class QCameraParameters: public CameraParameters
49{
50public:
51    QCameraParameters();
52    QCameraParameters(const String8 &params);
53    ~QCameraParameters();
54
55    // Supported PREVIEW/RECORDING SIZES IN HIGH FRAME RATE recording, sizes in pixels.
56    // Example value: "800x480,432x320". Read only.
57    static const char KEY_QC_SUPPORTED_HFR_SIZES[];
58    // The mode of preview frame rate.
59    // Example value: "frame-rate-auto, frame-rate-fixed".
60    static const char KEY_QC_PREVIEW_FRAME_RATE_MODE[];
61    static const char KEY_QC_SUPPORTED_PREVIEW_FRAME_RATE_MODES[];
62    static const char KEY_QC_PREVIEW_FRAME_RATE_AUTO_MODE[];
63    static const char KEY_QC_PREVIEW_FRAME_RATE_FIXED_MODE[];
64    static const char KEY_QC_SUPPORTED_SKIN_TONE_ENHANCEMENT_MODES[] ;
65
66    // Supported live snapshot sizes
67    static const char KEY_QC_SUPPORTED_LIVESNAPSHOT_SIZES[];
68
69    // Supported Raw formats
70    static const char KEY_QC_SUPPORTED_RAW_FORMATS[];
71    static const char KEY_QC_RAW_FORMAT[];
72
73    //Touch Af/AEC settings.
74    static const char KEY_QC_TOUCH_AF_AEC[];
75    static const char KEY_QC_SUPPORTED_TOUCH_AF_AEC[];
76    //Touch Index for AEC.
77    static const char KEY_QC_TOUCH_INDEX_AEC[];
78    //Touch Index for AF.
79    static const char KEY_QC_TOUCH_INDEX_AF[];
80    // Current auto scene detection mode.
81    // Example value: "off" or "on" constants. Read/write.
82    static const char KEY_QC_SCENE_DETECT[];
83    // Supported auto scene detection settings.
84    // Example value: "off,on". Read only.
85    static const char KEY_QC_SUPPORTED_SCENE_DETECT[];
86    static const char KEY_QC_SELECTABLE_ZONE_AF[];
87
88    static const char KEY_QC_ISO_MODE[];
89    static const char KEY_QC_SUPPORTED_ISO_MODES[];
90    static const char KEY_QC_LENSSHADE[] ;
91    static const char KEY_QC_SUPPORTED_LENSSHADE_MODES[] ;
92    static const char KEY_QC_AUTO_EXPOSURE[];
93    static const char KEY_QC_SUPPORTED_AUTO_EXPOSURE[];
94
95    static const char KEY_QC_GPS_LATITUDE_REF[];
96    static const char KEY_QC_GPS_LONGITUDE_REF[];
97    static const char KEY_QC_GPS_ALTITUDE_REF[];
98    static const char KEY_QC_GPS_STATUS[];
99    static const char KEY_QC_MEMORY_COLOR_ENHANCEMENT[];
100    static const char KEY_QC_SUPPORTED_MEM_COLOR_ENHANCE_MODES[];
101    static const char KEY_QC_DIS[];
102    static const char KEY_QC_SUPPORTED_DIS_MODES[];
103
104    static const char KEY_QC_ZSL[];
105    static const char KEY_QC_SUPPORTED_ZSL_MODES[];
106    static const char KEY_QC_ZSL_BURST_INTERVAL[];
107    static const char KEY_QC_ZSL_BURST_LOOKBACK[];
108    static const char KEY_QC_ZSL_QUEUE_DEPTH[];
109
110    static const char KEY_QC_CAMERA_MODE[];
111    static const char KEY_QC_ORIENTATION[];
112
113    static const char KEY_QC_VIDEO_HIGH_FRAME_RATE[];
114    static const char KEY_QC_SUPPORTED_VIDEO_HIGH_FRAME_RATE_MODES[];
115    static const char KEY_QC_HIGH_DYNAMIC_RANGE_IMAGING[];
116    static const char KEY_QC_SUPPORTED_HDR_IMAGING_MODES[];
117    static const char KEY_QC_AE_BRACKET_HDR[];
118    static const char KEY_QC_SUPPORTED_AE_BRACKET_MODES[];
119    static const char KEY_QC_CAPTURE_BURST_EXPOSURE[];
120    static const char KEY_QC_NUM_SNAPSHOT_PER_SHUTTER[];
121    static const char KEY_QC_NO_DISPLAY_MODE[];
122    static const char KEY_QC_RAW_PICUTRE_SIZE[];
123
124    // DENOISE
125    static const char KEY_QC_DENOISE[];
126    static const char KEY_QC_SUPPORTED_DENOISE[];
127
128    //Selectable zone AF.
129    static const char KEY_QC_FOCUS_ALGO[];
130    static const char KEY_QC_SUPPORTED_FOCUS_ALGOS[];
131
132    //Face Detection
133    static const char KEY_QC_FACE_DETECTION[];
134    static const char KEY_QC_SUPPORTED_FACE_DETECTION[];
135
136    //Face Recognition
137    static const char KEY_QC_FACE_RECOGNITION[];
138    static const char KEY_QC_SUPPORTED_FACE_RECOGNITION[];
139
140    // supported camera features to be queried by Snapdragon SDK
141    //Read only
142    static const char KEY_QC_SUPPORTED_CAMERA_FEATURES[];
143
144    //Indicates number of faces requested by the application.
145    //This value will be rejected if the requested faces
146    //greater than supported by hardware.
147    //Write only.
148    static const char KEY_QC_MAX_NUM_REQUESTED_FACES[];
149
150    //preview flip
151    static const char KEY_QC_PREVIEW_FLIP[];
152    //video flip
153    static const char KEY_QC_VIDEO_FLIP[];
154    //snapshot picture flip
155    static const char KEY_QC_SNAPSHOT_PICTURE_FLIP[];
156
157    static const char KEY_QC_SUPPORTED_FLIP_MODES[];
158
159    //Redeye Reduction
160    static const char KEY_QC_REDEYE_REDUCTION[];
161    static const char KEY_QC_SUPPORTED_REDEYE_REDUCTION[];
162    static const char EFFECT_EMBOSS[];
163    static const char EFFECT_SKETCH[];
164    static const char EFFECT_NEON[];
165
166    // Values for Touch AF/AEC
167    static const char TOUCH_AF_AEC_OFF[];
168    static const char TOUCH_AF_AEC_ON[];
169
170    // Values for Scene mode
171    static const char SCENE_MODE_ASD[];
172    static const char SCENE_MODE_BACKLIGHT[];
173    static const char SCENE_MODE_FLOWERS[];
174    static const char SCENE_MODE_AR[];
175    static const char SCENE_MODE_HDR[];
176    static const char PIXEL_FORMAT_YUV420SP_ADRENO[]; // ADRENO
177    static const char PIXEL_FORMAT_YV12[]; // NV12
178    static const char PIXEL_FORMAT_NV12[]; //NV12
179
180    // Values for raw picture format
181    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_YUYV[];
182    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_YVYU[];
183    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_UYVY[];
184    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_VYUY[];
185    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8GBRG[];
186    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8GRBG[];
187    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8RGGB[];
188    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8BGGR[];
189    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10GBRG[];
190    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10GRBG[];
191    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10RGGB[];
192    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10BGGR[];
193    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12GBRG[];
194    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12GRBG[];
195    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12RGGB[];
196    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12BGGR[];
197    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8GBRG[];
198    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8GRBG[];
199    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8RGGB[];
200    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8BGGR[];
201    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10GBRG[];
202    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10GRBG[];
203    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10RGGB[];
204    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10BGGR[];
205    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12GBRG[];
206    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12GRBG[];
207    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12RGGB[];
208    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12BGGR[];
209    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8GBRG[];
210    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8GRBG[];
211    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8RGGB[];
212    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8BGGR[];
213    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10GBRG[];
214    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10GRBG[];
215    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10RGGB[];
216    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10BGGR[];
217    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12GBRG[];
218    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12GRBG[];
219    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12RGGB[];
220    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12BGGR[];
221    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8GBRG[];
222    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8GRBG[];
223    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8RGGB[];
224    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8BGGR[];
225    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10GBRG[];
226    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10GRBG[];
227    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10RGGB[];
228    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10BGGR[];
229    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12GBRG[];
230    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12GRBG[];
231    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12RGGB[];
232    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12BGGR[];
233    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8GBRG[];
234    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8GRBG[];
235    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8RGGB[];
236    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8BGGR[];
237    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8GBRG[];
238    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8GRBG[];
239    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8RGGB[];
240    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8BGGR[];
241    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10GBRG[];
242    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10GRBG[];
243    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10RGGB[];
244    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10BGGR[];
245    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12GBRG[];
246    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12GRBG[];
247    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12RGGB[];
248    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12BGGR[];
249
250    // ISO values
251    static const char ISO_AUTO[];
252    static const char ISO_HJR[];
253    static const char ISO_100[];
254    static const char ISO_200[];
255    static const char ISO_400[];
256    static const char ISO_800[];
257    static const char ISO_1600[];
258
259    // Values for auto exposure settings.
260    static const char AUTO_EXPOSURE_FRAME_AVG[];
261    static const char AUTO_EXPOSURE_CENTER_WEIGHTED[];
262    static const char AUTO_EXPOSURE_SPOT_METERING[];
263    static const char AUTO_EXPOSURE_SMART_METERING[];
264    static const char AUTO_EXPOSURE_USER_METERING[];
265    static const char AUTO_EXPOSURE_SPOT_METERING_ADV[];
266    static const char AUTO_EXPOSURE_CENTER_WEIGHTED_ADV[];
267
268    static const char KEY_QC_SHARPNESS[];
269    static const char KEY_QC_MIN_SHARPNESS[];
270    static const char KEY_QC_MAX_SHARPNESS[];
271    static const char KEY_QC_SHARPNESS_STEP[];
272    static const char KEY_QC_CONTRAST[];
273    static const char KEY_QC_MIN_CONTRAST[];
274    static const char KEY_QC_MAX_CONTRAST[];
275    static const char KEY_QC_CONTRAST_STEP[];
276    static const char KEY_QC_SATURATION[];
277    static const char KEY_QC_MIN_SATURATION[];
278    static const char KEY_QC_MAX_SATURATION[];
279    static const char KEY_QC_SATURATION_STEP[];
280    static const char KEY_QC_BRIGHTNESS[];
281    static const char KEY_QC_MIN_BRIGHTNESS[];
282    static const char KEY_QC_MAX_BRIGHTNESS[];
283    static const char KEY_QC_BRIGHTNESS_STEP[];
284    static const char KEY_QC_SCE_FACTOR[];
285    static const char KEY_QC_MIN_SCE_FACTOR[];
286    static const char KEY_QC_MAX_SCE_FACTOR[];
287    static const char KEY_QC_SCE_FACTOR_STEP[];
288
289    static const char KEY_QC_HISTOGRAM[] ;
290    static const char KEY_QC_SUPPORTED_HISTOGRAM_MODES[] ;
291    static const char KEY_QC_HDR_NEED_1X[];
292    static const char KEY_QC_VIDEO_HDR[];
293    static const char KEY_QC_SUPPORTED_VIDEO_HDR_MODES[];
294
295    // Values for SKIN TONE ENHANCEMENT
296    static const char SKIN_TONE_ENHANCEMENT_ENABLE[] ;
297    static const char SKIN_TONE_ENHANCEMENT_DISABLE[] ;
298
299    // Values for Denoise
300    static const char DENOISE_OFF[] ;
301    static const char DENOISE_ON[] ;
302
303    // Values for auto exposure settings.
304    static const char FOCUS_ALGO_AUTO[];
305    static const char FOCUS_ALGO_SPOT_METERING[];
306    static const char FOCUS_ALGO_CENTER_WEIGHTED[];
307    static const char FOCUS_ALGO_FRAME_AVERAGE[];
308
309    // Values for AE Bracketing settings.
310    static const char AE_BRACKET_OFF[];
311    static const char AE_BRACKET[];
312
313    // Values for HFR settings.
314    static const char VIDEO_HFR_OFF[];
315    static const char VIDEO_HFR_2X[];
316    static const char VIDEO_HFR_3X[];
317    static const char VIDEO_HFR_4X[];
318    static const char VIDEO_HFR_5X[];
319
320    // Values for feature on/off settings.
321    static const char VALUE_OFF[];
322    static const char VALUE_ON[];
323
324    // Values for feature enable/disable settings.
325    static const char VALUE_ENABLE[];
326    static const char VALUE_DISABLE[];
327
328    // Values for feature true/false settings.
329    static const char VALUE_FALSE[];
330    static const char VALUE_TRUE[];
331
332    //Values for flip settings
333    static const char FLIP_MODE_OFF[];
334    static const char FLIP_MODE_V[];
335    static const char FLIP_MODE_H[];
336    static const char FLIP_MODE_VH[];
337
338    enum {
339        CAMERA_ORIENTATION_UNKNOWN = 0,
340        CAMERA_ORIENTATION_PORTRAIT = 1,
341        CAMERA_ORIENTATION_LANDSCAPE = 2,
342    };
343    typedef struct {
344        const char *const desc;
345        int val;
346    } QCameraMap;
347
348    void getSupportedHfrSizes(Vector<Size> &sizes);
349    void setPreviewFrameRateMode(const char *mode);
350    const char *getPreviewFrameRateMode() const;
351    void setTouchIndexAec(int x, int y);
352    void getTouchIndexAec(int *x, int *y);
353    void setTouchIndexAf(int x, int y);
354    void getTouchIndexAf(int *x, int *y);
355
356    int32_t init(cam_capability_t *, mm_camera_vtbl_t *);
357    void deinit();
358    int32_t assign(QCameraParameters& params);
359    int32_t initDefaultParameters();
360    int32_t updateParameters(QCameraParameters&, bool &needRestart);
361    int32_t commitParameters();
362    int getPreviewHalPixelFormat() const;
363    int32_t getStreamFormat(cam_stream_type_t streamType,
364                             cam_format_t &format);
365    int32_t getStreamDimension(cam_stream_type_t streamType,
366                                cam_dimension_t &dim);
367    void getThumbnailSize(int *width, int *height) const;
368
369    int getZSLBurstInterval();
370    int getZSLQueueDepth();
371    int getZSLBackLookCount();
372    int getMaxUnmatchedFramesInQueue();
373    bool isZSLMode() {return m_bZslMode;};
374    bool isNoDisplayMode() {return m_bNoDisplayMode;};
375    bool isWNREnabled() {return m_bWNROn;};
376    uint8_t getNumOfSnapshots();
377    uint8_t getNumOfExtraHDRBufsIfNeeded();
378    uint8_t getNumOfHDRBufsIfNeeded();
379    int getBurstNum();
380    bool getRecordingHintValue() {return m_bRecordingHint;}; // return local copy of video hint
381    int setRecordingHintValue(int32_t value); // set local copy of video hint and send to server
382                                              // no change in parameters value
383    int getJpegQuality();
384    int getJpegRotation();
385
386    int32_t getExifDateTime(char *dateTime, uint32_t &count);
387    int32_t getExifFocalLength(rat_t *focalLenght);
388    uint16_t getExifIsoSpeed();
389    int32_t getExifGpsProcessingMethod(char *gpsProcessingMethod, uint32_t &count);
390    int32_t getExifLatitude(rat_t *latitude, char *latRef);
391    int32_t getExifLongitude(rat_t *longitude, char *lonRef);
392    int32_t getExifAltitude(rat_t *altitude, char *altRef);
393    int32_t getExifGpsDateTimeStamp(char *gpsDateStamp, uint32_t bufLen, rat_t *gpsTimeStamp);
394    int32_t updateFocusDistances(cam_focus_distances_info_t *focusDistances);
395
396    bool isFpsDebugEnabled() {return m_bDebugFps;};
397    bool isHistogramEnabled() {return m_bHistogramEnabled;};
398    bool isFaceDetectionEnabled() {return ((m_nFaceProcMask & CAM_FACE_PROCESS_MASK_DETECTION) != 0);};
399    int32_t setHistogram(bool enabled);
400    int32_t setFaceDetection(bool enabled);
401    int32_t setLockCAF(bool bLock);
402    int32_t setBundleInfo(cam_bundle_config_t &bundle_info);
403    int32_t setFrameSkip(enum msm_vfe_frame_skip_pattern pattern);
404    qcamera_thermal_mode getThermalMode() {return m_ThermalMode;};
405
406    cam_focus_mode_type getFocusMode() const {return mFocusMode;};
407    int32_t setNumOfSnapshot();
408    int32_t adjustPreviewFpsRange(cam_fps_range_t *fpsRange);
409    bool isJpegPictureFormat() {return (mPictureFormat == CAM_FORMAT_JPEG);};
410    cam_denoise_process_type_t getWaveletDenoiseProcessPlate();
411    int32_t getLiveSnapshotSize(cam_dimension_t &dim) {dim = m_LiveSnapshotSize; return NO_ERROR;};
412    int getFlipMode(cam_stream_type_t streamType);
413
414    void setLockCAFNeeded(bool bNeedflag) {m_bNeedLockCAF = bNeedflag;};
415    bool isLockCAFNeeded() {return m_bNeedLockCAF;};
416    bool isCAFLocked() {return m_bCAFLocked;};
417    void setAFRunning(bool bflag) {m_bAFRunning = bflag;};
418    bool isAFRunning() {return m_bAFRunning;};
419
420private:
421    int32_t setPreviewSize(const QCameraParameters& );
422    int32_t setVideoSize(const QCameraParameters& );
423    int32_t setPictureSize(const QCameraParameters& );
424    int32_t setLiveSnapshotSize(const QCameraParameters& );
425    int32_t setPreviewFormat(const QCameraParameters& );
426    int32_t setPictureFormat(const QCameraParameters& );
427    int32_t setOrientation(const QCameraParameters& );
428    int32_t setJpegThumbnailSize(const QCameraParameters& );
429    int32_t setJpegQuality(const QCameraParameters& );
430    int32_t setPreviewFpsRange(const QCameraParameters& );
431    int32_t setPreviewFrameRate(const QCameraParameters& );
432    int32_t setAutoExposure(const QCameraParameters& );
433    int32_t setEffect(const QCameraParameters& );
434    int32_t setBrightness(const QCameraParameters& );
435    int32_t setFocusMode(const QCameraParameters& );
436    int32_t setSharpness(const QCameraParameters& );
437    int32_t setSaturation(const QCameraParameters& );
438    int32_t setContrast(const QCameraParameters& );
439    int32_t setSkinToneEnhancement(const QCameraParameters& );
440    int32_t setSceneDetect(const QCameraParameters& );
441    int32_t setVideoHDR(const QCameraParameters& );
442    int32_t setZoom(const QCameraParameters& );
443    int32_t setISOValue(const QCameraParameters& );
444    int32_t setRotation(const QCameraParameters& );
445    int32_t setFlash(const QCameraParameters& );
446    int32_t setAecLock(const QCameraParameters& );
447    int32_t setAwbLock(const QCameraParameters& );
448    int32_t setMCEValue(const QCameraParameters& );
449    int32_t setDISValue(const QCameraParameters& params);
450    int32_t setHighFrameRate(const QCameraParameters& );
451    int32_t setLensShadeValue(const QCameraParameters& );
452    int32_t setExposureCompensation(const QCameraParameters& );
453    int32_t setWhiteBalance(const QCameraParameters& );
454    int32_t setAntibanding(const QCameraParameters& );
455    int32_t setFocusAreas(const QCameraParameters& );
456    int32_t setMeteringAreas(const QCameraParameters& );
457    int32_t setSceneMode(const QCameraParameters& );
458    int32_t setSelectableZoneAf(const QCameraParameters& );
459    int32_t setAEBracket(const QCameraParameters& );
460    int32_t setRedeyeReduction(const QCameraParameters& );
461    int32_t setGpsLocation(const QCameraParameters& );
462    int32_t setRecordingHint(const QCameraParameters& );
463    int32_t setNoDisplayMode(const QCameraParameters& );
464    int32_t setWaveletDenoise(const QCameraParameters& );
465    int32_t setZslMode(const QCameraParameters& );
466    int32_t setZslAttributes(const QCameraParameters& );
467    int32_t setCameraMode(const QCameraParameters& );
468    int32_t setFaceRecognition(const QCameraParameters& );
469    int32_t setFlip(const QCameraParameters& );
470
471    int32_t setAutoExposure(const char *autoExp);
472    int32_t setPreviewFpsRange(int minFPS,int maxFPS);
473    int32_t setEffect(const char *effect);
474    int32_t setBrightness(int brightness);
475    int32_t setFocusMode(const char *focusMode);
476    int32_t setSharpness(int sharpness);
477    int32_t setSaturation(int saturation);
478    int32_t setContrast(int contrast);
479    int32_t setSkinToneEnhancement(int sceFactor);
480    int32_t setSceneDetect(const char *scendDetect);
481    int32_t setVideoHDR(const char *videoHDR);
482    int32_t setZoom(int zoom_level);
483    int32_t setISOValue(const char *isoValue);
484    int32_t setFlash(const char *flashStr);
485    int32_t setAecLock(const char *aecStr);
486    int32_t setAwbLock(const char *awbStr);
487    int32_t setMCEValue(const char *mceStr);
488    int32_t setDISValue(const char *disStr);
489    int32_t setHighFrameRate(const char *hfrStr);
490    int32_t setLensShadeValue(const char *lensShadeStr);
491    int32_t setExposureCompensation(int expComp);
492    int32_t setWhiteBalance(const char *wbStr);
493    int32_t setAntibanding(const char *antiBandingStr);
494    int32_t setFocusAreas(const char *focusAreasStr);
495    int32_t setMeteringAreas(const char *meteringAreasStr);
496    int32_t setSceneMode(const char *sceneModeStr);
497    int32_t setSelectableZoneAf(const char *selZoneAFStr);
498    int32_t setAEBracket(const char *aecBracketStr);
499    int32_t setRedeyeReduction(const char *redeyeStr);
500    int32_t setWaveletDenoise(const char *wnrStr);
501    int32_t setFaceRecognition(const char *faceRecog, int maxFaces);
502
503    int32_t parse_pair(const char *str, int *first, int *second,
504                       char delim, char **endptr);
505    void parseSizesList(const char *sizesStr, Vector<Size> &sizes);
506    int32_t parseNDimVector(const char *str, int *num, int N, char delim);
507    int32_t parseCameraAreaString(const char *str, int max_num_areas,
508                                  cam_area_t *pAreas, int& num_areas_found);
509    bool validateCameraAreas(cam_area_t *areas, int num_areas);
510    int parseGPSCoordinate(const char *coord_str, rat_t *coord);
511    int32_t getRational(rat_t *rat, int num, int denom);
512    String8 createSizesString(const cam_dimension_t *sizes, int len);
513    String8 createValuesString(const int *values, int len,
514                               const QCameraMap *map, int map_len);
515    String8 createValuesStringFromMap(const QCameraMap *map,
516                                      int map_len);
517    String8 createHfrValuesString(const cam_hfr_info_t *values, int len,
518                                  const QCameraMap *map, int map_len);
519    String8 createHfrSizesString(const cam_hfr_info_t *values, int len);
520    String8 createFpsRangeString(const cam_fps_range_t *fps,
521                                 int len,
522                                 int &default_fps_index);
523    String8 createFpsString(const cam_fps_range_t *fps, int len);
524    String8 createZoomRatioValuesString(int *zoomRatios, int length);
525    int lookupAttr(const QCameraMap arr[], int len, const char *name);
526    const char *lookupNameByValue(const QCameraMap arr[], int len, int value);
527
528    // ops for batch set/get params with server
529    int32_t initBatchUpdate(parm_buffer_t *p_table);
530    int32_t AddSetParmEntryToBatch(parm_buffer_t *p_table,
531                                   cam_intf_parm_type_t paramType,
532                                   uint32_t paramLength,
533                                   void *paramValue);
534    int32_t commitSetBatch();
535    int32_t AddGetParmEntryToBatch(parm_buffer_t *p_table,
536                                   cam_intf_parm_type_t paramType);
537    int32_t commitGetBatch();
538
539    // ops to tempororily update parameter entries and commit
540    int32_t updateParamEntry(const char *key, const char *value);
541    int32_t commitParamChanges();
542
543    // Map from strings to values
544    static const cam_dimension_t THUMBNAIL_SIZES_MAP[];
545    static const QCameraMap AUTO_EXPOSURE_MAP[];
546    static const QCameraMap PREVIEW_FORMATS_MAP[];
547    static const QCameraMap PICTURE_TYPES_MAP[];
548    static const QCameraMap RAW_FORMATS_MAP[];
549    static const QCameraMap FOCUS_MODES_MAP[];
550    static const QCameraMap EFFECT_MODES_MAP[];
551    static const QCameraMap SCENE_MODES_MAP[];
552    static const QCameraMap FLASH_MODES_MAP[];
553    static const QCameraMap FOCUS_ALGO_MAP[];
554    static const QCameraMap WHITE_BALANCE_MODES_MAP[];
555    static const QCameraMap ANTIBANDING_MODES_MAP[];
556    static const QCameraMap ISO_MODES_MAP[];
557    static const QCameraMap HFR_MODES_MAP[];
558    static const QCameraMap BRACKETING_MODES_MAP[];
559    static const QCameraMap ON_OFF_MODES_MAP[];
560    static const QCameraMap ENABLE_DISABLE_MODES_MAP[];
561    static const QCameraMap DENOISE_ON_OFF_MODES_MAP[];
562    static const QCameraMap TRUE_FALSE_MODES_MAP[];
563    static const QCameraMap TOUCH_AF_AEC_MODES_MAP[];
564    static const QCameraMap FLIP_MODES_MAP[];
565
566    cam_capability_t *m_pCapability;
567    mm_camera_vtbl_t *m_pCamOpsTbl;
568    QCameraHeapMemory *m_pParamHeap;
569    parm_buffer_t     *m_pParamBuf;  // ptr to param buf in m_pParamHeap
570
571    bool m_bZslMode;                // if ZSL is enabled
572    bool m_bRecordingHint;          // local copy of recording hint
573    bool m_bHistogramEnabled;       // if histogram is enabled
574    int  m_nFaceProcMask;           // face process mask
575    bool m_bDebugFps;               // if FPS need to be logged
576    cam_focus_mode_type mFocusMode;
577    cam_format_t mPreviewFormat;
578    int32_t mPictureFormat;         // could be CAMERA_PICTURE_TYPE_JPEG or cam_format_t
579    bool m_bNeedRestart;            // if preview needs restart after parameters updated
580    bool m_bNoDisplayMode;
581    bool m_bWNROn;
582    bool m_bNeedLockCAF;
583    bool m_bCAFLocked;
584    bool m_bAFRunning;
585    qcamera_thermal_mode m_ThermalMode; // adjust fps vs adjust frameskip
586    cam_dimension_t m_LiveSnapshotSize; // live snapshot size
587
588    DefaultKeyedVector<String8,String8> m_tempMap; // map for temororily store parameters to be set
589};
590
591}; // namespace qcamera
592
593#endif
594