aboutsummaryrefslogtreecommitdiff
path: root/camera/QCamera2/HAL/QCameraParameters.h
blob: 3c9bac7c9ca91a15528f026e38d0a054e16c249c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
/*
** Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
** Not a Contribution. Apache license notifications and license are
** retained for attribution purposes only.
**
** Copyright 2008, The Android Open Source Project
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

#ifndef ANDROID_HARDWARE_QCAMERA_PARAMETERS_H
#define ANDROID_HARDWARE_QCAMERA_PARAMETERS_H

// To remove
#include <cutils/properties.h>

// System dependencies
#include <CameraParameters.h>
#include <utils/Errors.h>

// Camera dependencies
#include "hardware/camera.h"
#include "QCameraMem.h"
#include "QCameraParametersIntf.h"
#include "QCameraThermalAdapter.h"
#include "QCameraCommon.h"


extern "C" {
#include "mm_jpeg_interface.h"
}

using ::android::hardware::camera::common::V1_0::helper::CameraParameters;
using ::android::hardware::camera::common::V1_0::helper::Size;
using namespace android;

namespace qcamera {

//EXIF globals
static const char ExifAsciiPrefix[] = { 0x41, 0x53, 0x43, 0x49, 0x49, 0x0, 0x0, 0x0 };          // "ASCII\0\0\0"
static const char ExifUndefinedPrefix[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };   // "\0\0\0\0\0\0\0\0"

#define FOCAL_LENGTH_DECIMAL_PRECISION   100

#define CAMERA_MIN_BATCH_COUNT           4

#define QCAMERA_MAX_EXP_TIME_LEVEL1      100
#define QCAMERA_MAX_EXP_TIME_LEVEL2      500
#define QCAMERA_MAX_EXP_TIME_LEVEL3      1000
#define QCAMERA_MAX_EXP_TIME_LEVEL4      10000

class QCameraParameters: private CameraParameters
{

private:

    class QCameraReprocScaleParam{
    public:

        QCameraReprocScaleParam();
        ~QCameraReprocScaleParam();

        void setScaleEnable(bool enabled);
        int32_t setScaleSizeTbl(size_t scale_cnt,
                cam_dimension_t *scale_tbl, size_t org_cnt,
                cam_dimension_t *org_tbl);
        int32_t setValidatePicSize(int &width, int &height);

        bool isScaleEnabled();
        bool isUnderScaling();

        size_t getScaleSizeTblCnt();
        cam_dimension_t *getScaledSizeTbl();
        size_t getTotalSizeTblCnt();
        cam_dimension_t *getTotalSizeTbl();
        int32_t getPicSizeFromAPK(int &width, int &height);
        int32_t getPicSizeSetted(int &width, int &height);

    private:
        bool isScalePicSize(int width, int height);
        bool isValidatePicSize(int width, int height);
        int32_t setSensorSupportedPicSize();
        size_t checkScaleSizeTable(size_t scale_cnt, cam_dimension_t *scale_tbl,
                size_t org_cnt, cam_dimension_t *org_tbl);

        bool mScaleEnabled;
        bool mIsUnderScaling;   //if in scale status

        // picture size cnt that need scale operation
        size_t mNeedScaleCnt;
        cam_dimension_t mNeedScaledSizeTbl[MAX_SCALE_SIZES_CNT];

        // sensor supported size cnt and table
        size_t mSensorSizeTblCnt;
        cam_dimension_t *mSensorSizeTbl;

        // Total size cnt (sensor supported + need scale cnt)
        size_t mTotalSizeTblCnt;
        cam_dimension_t mTotalSizeTbl[MAX_SIZES_CNT];

        cam_dimension_t mPicSizeFromAPK;   // dimension that APK is expected
        cam_dimension_t mPicSizeSetted;    // dimension that config vfe
    };

    // Supported PREVIEW/RECORDING SIZES IN HIGH FRAME RATE recording, sizes in pixels.
    // Example value: "800x480,432x320". Read only.
    static const char KEY_QC_SUPPORTED_HFR_SIZES[];
    // The mode of preview frame rate.
    // Example value: "frame-rate-auto, frame-rate-fixed".
    static const char KEY_QC_PREVIEW_FRAME_RATE_MODE[];
    static const char KEY_QC_SUPPORTED_PREVIEW_FRAME_RATE_MODES[];
    static const char KEY_QC_PREVIEW_FRAME_RATE_AUTO_MODE[];
    static const char KEY_QC_PREVIEW_FRAME_RATE_FIXED_MODE[];
    static const char KEY_QC_SUPPORTED_SKIN_TONE_ENHANCEMENT_MODES[] ;

    // Supported live snapshot sizes
    static const char KEY_QC_SUPPORTED_LIVESNAPSHOT_SIZES[];

    // Supported Raw formats
    static const char KEY_QC_SUPPORTED_RAW_FORMATS[];
    static const char KEY_QC_RAW_FORMAT[];

    //Touch Af/AEC settings.
    static const char KEY_QC_TOUCH_AF_AEC[];
    static const char KEY_QC_SUPPORTED_TOUCH_AF_AEC[];
    //Touch Index for AEC.
    static const char KEY_QC_TOUCH_INDEX_AEC[];
    //Touch Index for AF.
    static const char KEY_QC_TOUCH_INDEX_AF[];
    // Current auto scene detection mode.
    // Example value: "off" or "on" constants. Read/write.
    static const char KEY_QC_SCENE_DETECT[];
    // Supported auto scene detection settings.
    // Example value: "off,on". Read only.
    static const char KEY_QC_SUPPORTED_SCENE_DETECT[];
    static const char KEY_QC_SELECTABLE_ZONE_AF[];

    static const char KEY_QC_ISO_MODE[];
    static const char KEY_QC_CONTINUOUS_ISO[];
    static const char KEY_QC_MIN_ISO[];
    static const char KEY_QC_MAX_ISO[];
    static const char KEY_QC_SUPPORTED_ISO_MODES[];
    static const char KEY_QC_EXPOSURE_TIME[];
    static const char KEY_QC_MIN_EXPOSURE_TIME[];
    static const char KEY_QC_MAX_EXPOSURE_TIME[];
    static const char KEY_QC_LENSSHADE[] ;
    static const char KEY_QC_SUPPORTED_LENSSHADE_MODES[] ;
    static const char KEY_QC_AUTO_EXPOSURE[];
    static const char KEY_QC_SUPPORTED_AUTO_EXPOSURE[];

    static const char KEY_QC_GPS_LATITUDE_REF[];
    static const char KEY_QC_GPS_LONGITUDE_REF[];
    static const char KEY_QC_GPS_ALTITUDE_REF[];
    static const char KEY_QC_GPS_STATUS[];
    static const char KEY_QC_MEMORY_COLOR_ENHANCEMENT[];
    static const char KEY_QC_SUPPORTED_MEM_COLOR_ENHANCE_MODES[];
    static const char KEY_QC_DIS[];
    static const char KEY_QC_OIS[];
    static const char KEY_QC_SUPPORTED_DIS_MODES[];
    static const char KEY_QC_SUPPORTED_OIS_MODES[];

    static const char KEY_QC_ZSL[];
    static const char KEY_QC_SUPPORTED_ZSL_MODES[];
    static const char KEY_QC_ZSL_BURST_INTERVAL[];
    static const char KEY_QC_ZSL_BURST_LOOKBACK[];
    static const char KEY_QC_ZSL_QUEUE_DEPTH[];

    static const char KEY_QC_CAMERA_MODE[];
    static const char KEY_QC_ORIENTATION[];

    static const char KEY_QC_VIDEO_HIGH_FRAME_RATE[];
    static const char KEY_QC_VIDEO_HIGH_SPEED_RECORDING[];
    static const char KEY_QC_SUPPORTED_VIDEO_HIGH_FRAME_RATE_MODES[];
    static const char KEY_QC_HIGH_DYNAMIC_RANGE_IMAGING[];
    static const char KEY_QC_SUPPORTED_HDR_IMAGING_MODES[];
    static const char KEY_QC_AE_BRACKET_HDR[];
    static const char KEY_QC_SUPPORTED_AE_BRACKET_MODES[];
    static const char KEY_QC_CAPTURE_BURST_EXPOSURE[];
    static const char KEY_QC_NUM_SNAPSHOT_PER_SHUTTER[];
    static const char KEY_QC_NUM_RETRO_BURST_PER_SHUTTER[];
    static const char KEY_QC_SNAPSHOT_BURST_LED_ON_PERIOD[];
    static const char KEY_QC_SNAPSHOT_BURST_NUM[];
    static const char KEY_QC_NO_DISPLAY_MODE[];
    static const char KEY_QC_RAW_PICUTRE_SIZE[];
    static const char KEY_QC_TINTLESS_ENABLE[];
    static const char KEY_QC_SCENE_SELECTION[];
    static const char KEY_QC_CDS_MODE[];
    static const char KEY_QC_VIDEO_CDS_MODE[];
    static const char KEY_QC_SUPPORTED_CDS_MODES[];
    static const char KEY_QC_SUPPORTED_VIDEO_CDS_MODES[];
    static const char KEY_QC_TNR_MODE[];
    static const char KEY_QC_VIDEO_TNR_MODE[];
    static const char KEY_QC_SUPPORTED_TNR_MODES[];
    static const char KEY_QC_SUPPORTED_VIDEO_TNR_MODES[];

    static const char KEY_INTERNAL_PERVIEW_RESTART[];
    static const char KEY_QC_WB_MANUAL_CCT[];
    static const char KEY_QC_MIN_WB_CCT[];
    static const char KEY_QC_MAX_WB_CCT[];
    static const char KEY_QC_MANUAL_WB_GAINS[];
    static const char KEY_QC_MIN_WB_GAIN[];
    static const char KEY_QC_MAX_WB_GAIN[];
    static const char WHITE_BALANCE_MANUAL[];
    static const char FOCUS_MODE_MANUAL_POSITION[];
    static const char KEY_QC_LONG_SHOT[];
    static const char KEY_QC_INITIAL_EXPOSURE_INDEX[];
    static const char KEY_QC_INSTANT_AEC[];
    static const char KEY_QC_INSTANT_CAPTURE[];
    static const char KEY_QC_INSTANT_AEC_SUPPORTED_MODES[];
    static const char KEY_QC_INSTANT_CAPTURE_SUPPORTED_MODES[];

    static const char KEY_QC_MANUAL_FOCUS_POSITION[];
    static const char KEY_QC_MANUAL_FOCUS_POS_TYPE[];
    static const char KEY_QC_MIN_FOCUS_POS_INDEX[];
    static const char KEY_QC_MAX_FOCUS_POS_INDEX[];
    static const char KEY_QC_MIN_FOCUS_POS_DAC[];
    static const char KEY_QC_MAX_FOCUS_POS_DAC[];
    static const char KEY_QC_MIN_FOCUS_POS_RATIO[];
    static const char KEY_QC_MAX_FOCUS_POS_RATIO[];
    static const char KEY_QC_MIN_FOCUS_POS_DIOPTER[];
    static const char KEY_QC_MAX_FOCUS_POS_DIOPTER[];
    static const char KEY_QC_FOCUS_POSITION_SCALE[];
    static const char KEY_QC_FOCUS_POSITION_DIOPTER[];

    static const char KEY_QC_SUPPORTED_MANUAL_FOCUS_MODES[];
    static const char KEY_QC_SUPPORTED_MANUAL_EXPOSURE_MODES[];
    static const char KEY_QC_SUPPORTED_MANUAL_WB_MODES[];
    static const char KEY_QC_FOCUS_SCALE_MODE[];
    static const char KEY_QC_FOCUS_DIOPTER_MODE[];
    static const char KEY_QC_ISO_PRIORITY[];
    static const char KEY_QC_EXP_TIME_PRIORITY[];
    static const char KEY_QC_USER_SETTING[];
    static const char KEY_QC_WB_CCT_MODE[];
    static const char KEY_QC_WB_GAIN_MODE[];
    static const char KEY_QC_MANUAL_WB_TYPE[];
    static const char KEY_QC_MANUAL_WB_VALUE[];
    static const char KEY_QC_CURRENT_EXPOSURE_TIME[];
    static const char KEY_QC_CURRENT_ISO[];
    static const char KEY_QC_CACHE_VIDEO_BUFFERS[];

    // DENOISE
    static const char KEY_QC_DENOISE[];
    static const char KEY_QC_SUPPORTED_DENOISE[];

    //Selectable zone AF.
    static const char KEY_QC_FOCUS_ALGO[];
    static const char KEY_QC_SUPPORTED_FOCUS_ALGOS[];

    //Face Detection
    static const char KEY_QC_FACE_DETECTION[];
    static const char KEY_QC_SUPPORTED_FACE_DETECTION[];

    //Face Recognition
    static const char KEY_QC_FACE_RECOGNITION[];
    static const char KEY_QC_SUPPORTED_FACE_RECOGNITION[];

    //Indicates number of faces requested by the application.
    //This value will be rejected if the requested faces
    //greater than supported by hardware.
    //Write only.
    static const char KEY_QC_MAX_NUM_REQUESTED_FACES[];

    //preview flip
    static const char KEY_QC_PREVIEW_FLIP[];
    //video flip
    static const char KEY_QC_VIDEO_FLIP[];
    //snapshot picture flip
    static const char KEY_QC_SNAPSHOT_PICTURE_FLIP[];

    static const char KEY_QC_SUPPORTED_FLIP_MODES[];

    //Face Detection, Facial processing requirement
    static const char KEY_QC_SNAPSHOT_FD_DATA[];

    //Auto HDR enable
    static const char KEY_QC_AUTO_HDR_ENABLE[];
    // video rotation
    static const char KEY_QC_VIDEO_ROTATION[];
    static const char KEY_QC_SUPPORTED_VIDEO_ROTATION_VALUES[];

    //Redeye Reduction
    static const char KEY_QC_REDEYE_REDUCTION[];
    static const char KEY_QC_SUPPORTED_REDEYE_REDUCTION[];
    static const char EFFECT_EMBOSS[];
    static const char EFFECT_SKETCH[];
    static const char EFFECT_NEON[];
    static const char EFFECT_BEAUTY[];

    //AF Bracketing
    static const char KEY_QC_AF_BRACKET[];
    static const char KEY_QC_SUPPORTED_AF_BRACKET_MODES[];

    //Refocus
    static const char KEY_QC_RE_FOCUS[];
    static const char KEY_QC_SUPPORTED_RE_FOCUS_MODES[];

    //Chroma Flash
    static const char KEY_QC_CHROMA_FLASH[];
    static const char KEY_QC_SUPPORTED_CHROMA_FLASH_MODES[];

    //Opti Zoom
    static const char KEY_QC_OPTI_ZOOM[];
    static const char KEY_QC_SUPPORTED_OPTI_ZOOM_MODES[];

    // Auto HDR supported
    static const char KEY_QC_AUTO_HDR_SUPPORTED[];

    // HDR modes
    static const char KEY_QC_HDR_MODE[];
    static const char KEY_QC_SUPPORTED_KEY_QC_HDR_MODES[];

    //True Portrait
    static const char KEY_QC_TRUE_PORTRAIT[];
    static const char KEY_QC_SUPPORTED_TRUE_PORTRAIT_MODES[];

    //See more
    static const char KEY_QC_SEE_MORE[];
    static const char KEY_QC_SUPPORTED_SEE_MORE_MODES[];

    //Still more
    static const char KEY_QC_STILL_MORE[];
    static const char KEY_QC_SUPPORTED_STILL_MORE_MODES[];

    //Noise reduction mode
    static const char KEY_QC_NOISE_REDUCTION_MODE[];
    static const char KEY_QC_NOISE_REDUCTION_MODE_VALUES[];

    //Longshot
    static const char KEY_QC_LONGSHOT_SUPPORTED[];

    //ZSL+HDR
    static const char KEY_QC_ZSL_HDR_SUPPORTED[];

    // Values for Touch AF/AEC
    static const char TOUCH_AF_AEC_OFF[];
    static const char TOUCH_AF_AEC_ON[];

    // Values for Scene mode
    static const char SCENE_MODE_ASD[];
    static const char SCENE_MODE_BACKLIGHT[];
    static const char SCENE_MODE_FLOWERS[];
    static const char SCENE_MODE_AR[];
    static const char SCENE_MODE_HDR[];
    static const char PIXEL_FORMAT_YUV420SP_ADRENO[]; // ADRENO
    static const char PIXEL_FORMAT_YV12[]; // NV12
    static const char PIXEL_FORMAT_NV12[]; //NV12
    static const char QC_PIXEL_FORMAT_NV12_VENUS[]; //NV12 VENUS

    // Values for raw picture format
    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_YUYV[];
    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_YVYU[];
    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_UYVY[];
    static const char QC_PIXEL_FORMAT_YUV_RAW_8BIT_VYUY[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_8BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_10BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_12BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_QCOM_RAW_14BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_8BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_10BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_12BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_MIPI_RAW_14BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_8BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_10BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_12BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_QCOM_14BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_8BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_10BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_12BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_MIPI_14BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN8_8BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_8BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_10BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_12BGGR[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14GBRG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14GRBG[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14RGGB[];
    static const char QC_PIXEL_FORMAT_BAYER_IDEAL_PLAIN16_14BGGR[];

    // ISO values
    static const char ISO_AUTO[];
    static const char ISO_HJR[];
    static const char ISO_100[];
    static const char ISO_200[];
    static const char ISO_400[];
    static const char ISO_800[];
    static const char ISO_1600[];
    static const char ISO_3200[];
    static const char ISO_MANUAL[];

    // Values for auto exposure settings.
    static const char AUTO_EXPOSURE_FRAME_AVG[];
    static const char AUTO_EXPOSURE_CENTER_WEIGHTED[];
    static const char AUTO_EXPOSURE_SPOT_METERING[];
    static const char AUTO_EXPOSURE_SMART_METERING[];
    static const char AUTO_EXPOSURE_USER_METERING[];
    static const char AUTO_EXPOSURE_SPOT_METERING_ADV[];
    static const char AUTO_EXPOSURE_CENTER_WEIGHTED_ADV[];

    // Values for instant AEC modes
    static const char KEY_QC_INSTANT_AEC_DISABLE[];
    static const char KEY_QC_INSTANT_AEC_AGGRESSIVE_AEC[];
    static const char KEY_QC_INSTANT_AEC_FAST_AEC[];

    // Values for instant capture modes
    static const char KEY_QC_INSTANT_CAPTURE_DISABLE[];
    static const char KEY_QC_INSTANT_CAPTURE_AGGRESSIVE_AEC[];
    static const char KEY_QC_INSTANT_CAPTURE_FAST_AEC[];

    static const char KEY_QC_SHARPNESS[];
    static const char KEY_QC_MIN_SHARPNESS[];
    static const char KEY_QC_MAX_SHARPNESS[];
    static const char KEY_QC_SHARPNESS_STEP[];
    static const char KEY_QC_CONTRAST[];
    static const char KEY_QC_MIN_CONTRAST[];
    static const char KEY_QC_MAX_CONTRAST[];
    static const char KEY_QC_CONTRAST_STEP[];
    static const char KEY_QC_SATURATION[];
    static const char KEY_QC_MIN_SATURATION[];
    static const char KEY_QC_MAX_SATURATION[];
    static const char KEY_QC_SATURATION_STEP[];
    static const char KEY_QC_BRIGHTNESS[];
    static const char KEY_QC_MIN_BRIGHTNESS[];
    static const char KEY_QC_MAX_BRIGHTNESS[];
    static const char KEY_QC_BRIGHTNESS_STEP[];
    static const char KEY_QC_SCE_FACTOR[];
    static const char KEY_QC_MIN_SCE_FACTOR[];
    static const char KEY_QC_MAX_SCE_FACTOR[];
    static const char KEY_QC_SCE_FACTOR_STEP[];

    static const char KEY_QC_HISTOGRAM[] ;
    static const char KEY_QC_SUPPORTED_HISTOGRAM_MODES[] ;
    static const char KEY_QC_SUPPORTED_HDR_NEED_1X[];
    static const char KEY_QC_HDR_NEED_1X[];
    static const char KEY_QC_VIDEO_HDR[];
    static const char KEY_QC_VT_ENABLE[];
    static const char KEY_QC_SUPPORTED_VIDEO_HDR_MODES[];
    static const char KEY_QC_SENSOR_HDR[];
    static const char KEY_QC_SUPPORTED_SENSOR_HDR_MODES[];
    static const char KEY_QC_RDI_MODE[];
    static const char KEY_QC_SUPPORTED_RDI_MODES[];
    static const char KEY_QC_SECURE_MODE[];
    static const char KEY_QC_SUPPORTED_SECURE_MODES[];

    // Values for SKIN TONE ENHANCEMENT
    static const char SKIN_TONE_ENHANCEMENT_ENABLE[] ;
    static const char SKIN_TONE_ENHANCEMENT_DISABLE[] ;

    // Values for Denoise
    static const char DENOISE_OFF[] ;
    static const char DENOISE_ON[] ;

    // Values for auto exposure settings.
    static const char FOCUS_ALGO_AUTO[];
    static const char FOCUS_ALGO_SPOT_METERING[];
    static const char FOCUS_ALGO_CENTER_WEIGHTED[];
    static const char FOCUS_ALGO_FRAME_AVERAGE[];

    // Values for AE Bracketing settings.
    static const char AE_BRACKET_OFF[];
    static const char AE_BRACKET[];

    // Values for AF Bracketing settings.
    static const char AF_BRACKET_OFF[];
    static const char AF_BRACKET_ON[];

    // Values for Refocus settings.
    static const char RE_FOCUS_OFF[];
    static const char RE_FOCUS_ON[];

    // Values for Chroma Flash settings.
    static const char CHROMA_FLASH_OFF[];
    static const char CHROMA_FLASH_ON[];

    // Values for Opti Zoom settings.
    static const char OPTI_ZOOM_OFF[];
    static const char OPTI_ZOOM_ON[];

    // Values for Still More settings.
    static const char STILL_MORE_OFF[];
    static const char STILL_MORE_ON[];

    // Values for HDR mode settings.
    static const char HDR_MODE_SENSOR[];
    static const char HDR_MODE_MULTI_FRAME[];

    // Values for True Portrait settings.
    static const char TRUE_PORTRAIT_OFF[];
    static const char TRUE_PORTRAIT_ON[];

    // Values for HFR settings.
    static const char VIDEO_HFR_OFF[];
    static const char VIDEO_HFR_2X[];
    static const char VIDEO_HFR_3X[];
    static const char VIDEO_HFR_4X[];
    static const char VIDEO_HFR_5X[];
    static const char VIDEO_HFR_6X[];
    static const char VIDEO_HFR_7X[];
    static const char VIDEO_HFR_8X[];
    static const char VIDEO_HFR_9X[];

    // Values for feature on/off settings.
    static const char VALUE_OFF[];
    static const char VALUE_ON[];

    // Values for feature enable/disable settings.
    static const char VALUE_ENABLE[];
    static const char VALUE_DISABLE[];

    // Values for feature true/false settings.
    static const char VALUE_FALSE[];
    static const char VALUE_TRUE[];

    //Values for flip settings
    static const char FLIP_MODE_OFF[];
    static const char FLIP_MODE_V[];
    static const char FLIP_MODE_H[];
    static const char FLIP_MODE_VH[];

    //Values for CDS Mode
    static const char CDS_MODE_OFF[];
    static const char CDS_MODE_ON[];
    static const char CDS_MODE_AUTO[];

    static const char VALUE_FAST[];
    static const char VALUE_HIGH_QUALITY[];

    static const char KEY_SELECTED_AUTO_SCENE[];

    // Values for Video rotation
    static const char VIDEO_ROTATION_0[];
    static const char VIDEO_ROTATION_90[];
    static const char VIDEO_ROTATION_180[];
    static const char VIDEO_ROTATION_270[];

#ifdef TARGET_TS_MAKEUP
    static const char KEY_TS_MAKEUP[];
    static const char KEY_TS_MAKEUP_WHITEN[];
    static const char KEY_TS_MAKEUP_CLEAN[];
#endif
    //param key for HFR batch size
    static const char KEY_QC_VIDEO_BATCH_SIZE[];
    enum {
        CAMERA_ORIENTATION_UNKNOWN = 0,
        CAMERA_ORIENTATION_PORTRAIT = 1,
        CAMERA_ORIENTATION_LANDSCAPE = 2,
    };

    template <typename valueType> struct QCameraMap {
        const char *const desc;
        valueType val;
    };

public:
    QCameraParameters();
    QCameraParameters(const String8 &params);
    ~QCameraParameters();

    int32_t allocate();
    int32_t init(cam_capability_t *,
                 mm_camera_vtbl_t *,
                 QCameraAdjustFPS *);
    void deinit();
    int32_t initDefaultParameters();
    int32_t updateParameters(const String8& params, bool &needRestart);
    int32_t commitParameters();

    char* getParameters();
    void getPreviewFpsRange(int *min_fps, int *max_fps) const {
            CameraParameters::getPreviewFpsRange(min_fps, max_fps);
    }
#ifdef TARGET_TS_MAKEUP
    bool getTsMakeupInfo(int &whiteLevel, int &cleanLevel) const;
#endif

    int getPreviewHalPixelFormat();
    int32_t getStreamRotation(cam_stream_type_t streamType,
                               cam_pp_feature_config_t &featureConfig,
                               cam_dimension_t &dim);
    int32_t getStreamFormat(cam_stream_type_t streamType,
                             cam_format_t &format);
    int32_t getStreamDimension(cam_stream_type_t streamType,
            cam_dimension_t &dim);
    void getThumbnailSize(int *width, int *height) const;


    uint8_t getZSLBurstInterval();
    uint8_t getZSLQueueDepth();
    uint8_t getZSLBackLookCount();
    uint8_t getMaxUnmatchedFramesInQueue();
    bool isZSLMode() {return m_bZslMode;};
    bool isRdiMode() {return m_bRdiMode;};
    bool isSecureMode() {return m_bSecureMode;};
    bool isNoDisplayMode() {return m_bNoDisplayMode;};
    bool isWNREnabled() {return m_bWNROn;};
    bool isTNRSnapshotEnabled() {return m_bTNRSnapshotOn;};
    int32_t getCDSMode() {return mCds_mode;};
    bool isLTMForSeeMoreEnabled() {return m_bLtmForSeeMoreEnabled;};
    bool isHfrMode() {return m_bHfrMode;};
    void getHfrFps(cam_fps_range_t &pFpsRange) { pFpsRange = m_hfrFpsRange;};
    uint8_t getNumOfSnapshots();
    uint8_t getNumOfRetroSnapshots();
    uint8_t getNumOfExtraHDRInBufsIfNeeded();
    uint8_t getNumOfExtraHDROutBufsIfNeeded();

    bool getRecordingHintValue() {return m_bRecordingHint;}; // return local copy of video hint
    uint32_t getJpegQuality();
    uint32_t getRotation();
    uint32_t getDeviceRotation();
    uint32_t getJpegExifRotation();
    bool useJpegExifRotation();
    int32_t getEffectValue();
    bool isInstantAECEnabled() {return m_bInstantAEC;};
    bool isInstantCaptureEnabled() {return m_bInstantCapture;};
    uint8_t getAecFrameBoundValue() {return mAecFrameBound;};
    uint8_t getAecSkipDisplayFrameBound() {return mAecSkipDisplayFrameBound;};

    int32_t getExifDateTime(String8 &dateTime, String8 &subsecTime);
    int32_t getExifFocalLength(rat_t *focalLenght);
    uint16_t getExifIsoSpeed();
    int32_t getExifGpsProcessingMethod(char *gpsProcessingMethod, uint32_t &count);
    int32_t getExifLatitude(rat_t *latitude, char *latRef);
    int32_t getExifLongitude(rat_t *longitude, char *lonRef);
    int32_t getExifAltitude(rat_t *altitude, char *altRef);
    int32_t getExifGpsDateTimeStamp(char *gpsDateStamp, uint32_t bufLen, rat_t *gpsTimeStamp);
    bool isVideoBuffersCached();
    int32_t updateFocusDistances(cam_focus_distances_info_t *focusDistances);

    bool isAEBracketEnabled();
    int32_t setAEBracketing();
    bool isFpsDebugEnabled() {return m_bDebugFps;};
    bool isHistogramEnabled() {return m_bHistogramEnabled;};
    bool isSceneSelectionEnabled() {return m_bSceneSelection;};
    int32_t setSelectedScene(cam_scene_mode_type scene);
    cam_scene_mode_type getSelectedScene();
    bool isFaceDetectionEnabled() {return ((m_nFaceProcMask &
            (CAM_FACE_PROCESS_MASK_DETECTION | CAM_FACE_PROCESS_MASK_FOCUS)) != 0);};
    int32_t setFaceDetectionOption(bool enabled);
    int32_t setHistogram(bool enabled);
    int32_t setFaceDetection(bool enabled, bool initCommit);
    int32_t setFrameSkip(enum msm_vfe_frame_skip_pattern pattern);
    qcamera_thermal_mode getThermalMode() {return m_ThermalMode;};
    int32_t updateRecordingHintValue(int32_t value);
    int32_t setHDRAEBracket(cam_exp_bracketing_t hdrBracket);
    bool isHDREnabled();
    bool isAutoHDREnabled();
    int32_t stopAEBracket();
    int32_t updateRAW(cam_dimension_t max_dim);
    bool isDISEnabled();
    cam_is_type_t getISType();
    cam_is_type_t getPreviewISType();
    uint8_t getMobicatMask();

    cam_focus_mode_type getFocusMode() const {return mFocusMode;};
    int32_t setNumOfSnapshot();
    int32_t adjustPreviewFpsRange(cam_fps_range_t *fpsRange);
    bool isJpegPictureFormat() {return (mPictureFormat == CAM_FORMAT_JPEG);};
    bool isNV16PictureFormat() {return (mPictureFormat == CAM_FORMAT_YUV_422_NV16);};
    bool isNV21PictureFormat() {return (mPictureFormat == CAM_FORMAT_YUV_420_NV21);};
    cam_denoise_process_type_t getDenoiseProcessPlate(cam_intf_parm_type_t type);
    int32_t getMaxPicSize(cam_dimension_t &dim) { dim = m_maxPicSize; return NO_ERROR; };
    int getFlipMode(cam_stream_type_t streamType);
    bool isSnapshotFDNeeded();

    bool isHDR1xFrameEnabled() {return m_bHDR1xFrameEnabled;}
    bool isSupportedSensorHdrSize(const QCameraParameters& params);
    bool isYUVFrameInfoNeeded();
    const char*getFrameFmtString(cam_format_t fmt);
    bool isHDR1xExtraBufferNeeded() {return m_bHDR1xExtraBufferNeeded;}
    bool isHDROutputCropEnabled() {return m_bHDROutputCropEnabled;}

    bool isPreviewFlipChanged() { return m_bPreviewFlipChanged; };
    bool isVideoFlipChanged() { return m_bVideoFlipChanged; };
    bool isSnapshotFlipChanged() { return m_bSnapshotFlipChanged; };
    void setHDRSceneEnable(bool bflag);
    int32_t updateAWBParams(cam_awb_params_t &awb_params);

    const char *getASDStateString(cam_auto_scene_t scene);
    bool isHDRThumbnailProcessNeeded() { return m_bHDRThumbnailProcessNeeded; };
    void setMinPpMask(cam_feature_mask_t min_pp_mask) { m_nMinRequiredPpMask = min_pp_mask; };
    bool setStreamConfigure(bool isCapture, bool previewAsPostview, bool resetConfig);
    int32_t addOnlineRotation(uint32_t rotation, uint32_t streamId, int32_t device_rotation);
    uint8_t getNumOfExtraBuffersForImageProc();
    uint8_t getNumOfExtraBuffersForVideo();
    uint8_t getNumOfExtraBuffersForPreview();
    uint32_t getExifBufIndex(uint32_t captureIndex);
    bool needThumbnailReprocess(cam_feature_mask_t *pFeatureMask);
    inline bool isUbiFocusEnabled() {return m_bAFBracketingOn && !m_bReFocusOn;};
    inline bool isChromaFlashEnabled() {return m_bChromaFlashOn;};
    inline bool isHighQualityNoiseReductionMode() {return m_bHighQualityNoiseReductionMode;};
    inline bool isTruePortraitEnabled() {return m_bTruePortraitOn;};
    inline size_t getTPMaxMetaSize() {
        return m_pCapability->true_portrait_settings_need.meta_max_size;};
    inline bool isSeeMoreEnabled() {return m_bSeeMoreOn;};
    inline bool isStillMoreEnabled() {return m_bStillMoreOn;};
    bool isOptiZoomEnabled();

    int32_t commitAFBracket(cam_af_bracketing_t afBracket);
    int32_t set3ALock(bool lock3A);
    int32_t setAndCommitZoom(int zoom_level);
    uint8_t getBurstCountForAdvancedCapture();
    uint32_t getNumberInBufsForSingleShot();
    uint32_t getNumberOutBufsForSingleShot();
    int32_t setLongshotEnable(bool enable);
    String8 dump();
    inline bool isUbiRefocus() {return m_bReFocusOn &&
            (m_pCapability->refocus_af_bracketing_need.output_count > 1);};
    inline uint32_t getRefocusMaxMetaSize() {
            return m_pCapability->refocus_af_bracketing_need.meta_max_size;};
    inline uint8_t getRefocusOutputCount() {
            return m_pCapability->refocus_af_bracketing_need.output_count;};
    inline bool generateThumbFromMain() {return isUbiFocusEnabled() ||
            isChromaFlashEnabled() || isOptiZoomEnabled() || isUbiRefocus()
            || isHDREnabled() || isStillMoreEnabled() || isTruePortraitEnabled(); }
    void updateCurrentFocusPosition(cam_focus_pos_info_t &cur_pos_info);
    void updateAEInfo(cam_3a_params_t &ae_params);
    bool isAdvCamFeaturesEnabled() {return isUbiFocusEnabled() ||
            isChromaFlashEnabled() || m_bOptiZoomOn || isHDREnabled() ||
            isAEBracketEnabled() || isStillMoreEnabled() || isUbiRefocus();}
    int32_t setAecLock(const char *aecStr);
    int32_t updateDebugLevel();
    bool is4k2kVideoResolution();
    bool isUBWCEnabled();

    int getBrightness();
    int32_t updateOisValue(bool oisValue);
    int32_t setIntEvent(cam_int_evt_params_t params);
    bool getofflineRAW() {return mOfflineRAW;}
    bool getQuadraCfa();
    int32_t updatePpFeatureMask(cam_stream_type_t stream_type);
    int32_t getStreamPpMask(cam_stream_type_t stream_type, cam_feature_mask_t &pp_mask);
    int32_t getSharpness() {return m_nSharpness;};
    int32_t getEffect() {return mParmEffect;};
    int32_t updateFlashMode(cam_flash_mode_t flash_mode);
    int32_t configureAEBracketing(cam_capture_frame_config_t &frame_config);
    int32_t configureHDRBracketing(cam_capture_frame_config_t &frame_config);
    int32_t configFrameCapture(bool commitSettings);
    int32_t resetFrameCapture(bool commitSettings);
    cam_still_more_t getStillMoreSettings() {return m_stillmore_config;};
    void setStillMoreSettings(cam_still_more_t stillmore_config)
            {m_stillmore_config = stillmore_config;};
    cam_still_more_t getStillMoreCapability()
            {return m_pCapability->stillmore_settings_need;};
    cam_dyn_img_data_t getDynamicImgData() { return m_DynamicImgData; }
    void setDynamicImgData(cam_dyn_img_data_t d) { m_DynamicImgData = d; }

    int32_t getParmZoomLevel(){return mParmZoomLevel;};
    int8_t  getReprocCount(){return mTotalPPCount;};
    bool isMultiPassReprocessing();
    int8_t  getCurPPCount(){return mCurPPCount;};
    void    setReprocCount();
    bool    isPostProcScaling();
    bool    isLLNoiseEnabled();
    void    setCurPPCount(int8_t count) {mCurPPCount = count;};
    int32_t setQuadraCfaMode(uint32_t value, bool initCommit);
    int32_t setToneMapMode(uint32_t value, bool initCommit);
    void setTintless(bool enable);
    uint8_t getLongshotStages();
    int8_t  getBufBatchCount() {return mBufBatchCnt;};
    int8_t  getVideoBatchSize() {return mVideoBatchSize;};

    int32_t setManualCaptureMode(
            QCameraManualCaptureModes value = CAM_MANUAL_CAPTURE_TYPE_OFF);
    QCameraManualCaptureModes getManualCaptureMode()
            {return m_ManualCaptureMode;};
    int64_t getExposureTime() {return m_expTime;};

    cam_capture_frame_config_t getCaptureFrameConfig()
            { return m_captureFrameConfig; };
    void setJpegRotation(int rotation);
    uint32_t getJpegRotation() { return mJpegRotation;};

    void setLowLightLevel(cam_low_light_mode_t value)
            { m_LowLightLevel = value; };
    cam_low_light_mode_t getLowLightLevel() {return m_LowLightLevel;};
    bool getLowLightCapture() { return m_LLCaptureEnabled; };

    /* Dual camera specific */
    bool getDcrf() { return m_bDcrfEnabled; }
    int32_t setRelatedCamSyncInfo(
            cam_sync_related_sensors_event_info_t* info);
    const cam_sync_related_sensors_event_info_t*
            getRelatedCamSyncInfo(void);
    int32_t setFrameSyncEnabled(bool enable);
    bool isFrameSyncEnabled(void);
    int32_t getRelatedCamCalibration(
            cam_related_system_calibration_data_t* calib);
    int32_t bundleRelatedCameras(bool sync, uint32_t sessionid);
    uint8_t fdModeInVideo();
    bool isOEMFeatEnabled() { return m_bOEMFeatEnabled; }

    int32_t setZslMode(bool value);
    int32_t updateZSLModeValue(bool value);

    bool isReprocScaleEnabled();
    bool isUnderReprocScaling();
    int32_t getPicSizeFromAPK(int &width, int &height);

    int32_t checkFeatureConcurrency();
    int32_t setInstantAEC(uint8_t enable, bool initCommit);

    int32_t getAnalysisInfo(
        bool fdVideoEnabled,
        bool hal3,
        cam_feature_mask_t featureMask,
        cam_analysis_info_t *pAnalysisInfo);
private:
    int32_t setPreviewSize(const QCameraParameters& );
    int32_t setVideoSize(const QCameraParameters& );
    int32_t setPictureSize(const QCameraParameters& );
    int32_t setLiveSnapshotSize(const QCameraParameters& );
    int32_t setPreviewFormat(const QCameraParameters& );
    int32_t setPictureFormat(const QCameraParameters& );
    int32_t setOrientation(const QCameraParameters& );
    int32_t setJpegThumbnailSize(const QCameraParameters& );
    int32_t setJpegQuality(const QCameraParameters& );
    int32_t setPreviewFpsRange(const QCameraParameters& );
    int32_t setPreviewFrameRate(const QCameraParameters& );
    int32_t setAutoExposure(const QCameraParameters& );
    int32_t setEffect(const QCameraParameters& );
    int32_t setBrightness(const QCameraParameters& );
    int32_t setFocusMode(const QCameraParameters& );
    int32_t setFocusPosition(const QCameraParameters& );
    int32_t setSharpness(const QCameraParameters& );
    int32_t setSaturation(const QCameraParameters& );
    int32_t setContrast(const QCameraParameters& );
    int32_t setSkinToneEnhancement(const QCameraParameters& );
    int32_t setSceneDetect(const QCameraParameters& );
    int32_t setVideoHDR(const QCameraParameters& );
    int32_t setVtEnable(const QCameraParameters& );
    int32_t setZoom(const QCameraParameters& );
    int32_t setISOValue(const QCameraParameters& );
    int32_t setContinuousISO(const QCameraParameters& );
    int32_t setExposureTime(const QCameraParameters& );
    int32_t setRotation(const QCameraParameters& );
    int32_t setVideoRotation(const QCameraParameters& );
    int32_t setFlash(const QCameraParameters& );
    int32_t setAecLock(const QCameraParameters& );
    int32_t setAwbLock(const QCameraParameters& );
    int32_t setMCEValue(const QCameraParameters& );
    int32_t setDISValue(const QCameraParameters& params);
    int32_t setLensShadeValue(const QCameraParameters& );
    int32_t setExposureCompensation(const QCameraParameters& );
    int32_t setWhiteBalance(const QCameraParameters& );
    int32_t setManualWhiteBalance(const QCameraParameters& );
    int32_t setAntibanding(const QCameraParameters& );
    int32_t setFocusAreas(const QCameraParameters& );
    int32_t setMeteringAreas(const QCameraParameters& );
    int32_t setSceneMode(const QCameraParameters& );
    int32_t setSelectableZoneAf(const QCameraParameters& );
    int32_t setAEBracket(const QCameraParameters& );
    int32_t setAFBracket(const QCameraParameters& );
    int32_t setReFocus(const QCameraParameters& );
    int32_t setChromaFlash(const QCameraParameters& );
    int32_t setOptiZoom(const QCameraParameters& );
    int32_t setHDRMode(const QCameraParameters& );
    int32_t setHDRNeed1x(const QCameraParameters& );
    int32_t setTruePortrait(const QCameraParameters& );
    int32_t setSeeMore(const QCameraParameters& );
    int32_t setStillMore(const QCameraParameters& );
    int32_t setNoiseReductionMode(const QCameraParameters& );
    int32_t setRedeyeReduction(const QCameraParameters& );
    int32_t setGpsLocation(const QCameraParameters& );
    int32_t setRecordingHint(const QCameraParameters& );
    int32_t setNoDisplayMode(const QCameraParameters& );
    int32_t setWaveletDenoise(const QCameraParameters& );
    int32_t setTemporalDenoise(const QCameraParameters&);
    int32_t setZslMode(const QCameraParameters& );
    int32_t setZslAttributes(const QCameraParameters& );
    int32_t setAutoHDR(const QCameraParameters& params);
    int32_t setCameraMode(const QCameraParameters& );
    int32_t setSceneSelectionMode(const QCameraParameters& params);
    int32_t setFaceRecognition(const QCameraParameters& );
    int32_t setFlip(const QCameraParameters& );
    int32_t setRetroActiveBurstNum(const QCameraParameters& params);
    int32_t setBurstLEDOnPeriod(const QCameraParameters& params);
    int32_t setSnapshotFDReq(const QCameraParameters& );
    int32_t setStatsDebugMask();
    int32_t setPAAF();
    int32_t setTintlessValue(const QCameraParameters& params);
    int32_t setCDSMode(const QCameraParameters& params);
    int32_t setInitialExposureIndex(const QCameraParameters& params);
    int32_t setInstantCapture(const QCameraParameters& params);
    int32_t setInstantAEC(const QCameraParameters& params);
    int32_t setMobicat(const QCameraParameters& params);
    int32_t setRdiMode(const QCameraParameters& );
    int32_t setSecureMode(const QCameraParameters& );
    int32_t setCacheVideoBuffers(const QCameraParameters& params);
    int32_t setCustomParams(const QCameraParameters& params);
    int32_t setAutoExposure(const char *autoExp);
    int32_t setPreviewFpsRange(int min_fps,int max_fps,
            int vid_min_fps,int vid_max_fps);
    int32_t setEffect(const char *effect);
    int32_t setBrightness(int brightness);
    int32_t setFocusMode(const char *focusMode);
    int32_t setFocusPosition(const char *typeStr, const char *posStr);
    int32_t setSharpness(int sharpness);
    int32_t setSaturation(int saturation);
    int32_t setContrast(int contrast);
    int32_t setSkinToneEnhancement(int sceFactor);
    int32_t setSceneDetect(const char *scendDetect);
    int32_t setVideoHDR(const char *videoHDR);
    int32_t setSensorSnapshotHDR(const char *snapshotHDR);
    int32_t setVtEnable(const char *vtEnable);
    int32_t setZoom(int zoom_level);
    int32_t setISOValue(const char *isoValue);
    int32_t setContinuousISO(const char *isoValue);
    int32_t setExposureTime(const char *expTimeStr);
    int32_t setFlash(const char *flashStr);
    int32_t setAwbLock(const char *awbStr);
    int32_t setMCEValue(const char *mceStr);
    int32_t setDISValue(const char *disStr);
    int32_t setHighFrameRate(const int32_t hfrMode);
    int32_t setLensShadeValue(const char *lensShadeStr);
    int32_t setExposureCompensation(int expComp);
    int32_t setWhiteBalance(const char *wbStr);
    int32_t setWBManualCCT(const char *cctStr);
    int32_t setManualWBGains(const char *gainStr);
    int32_t setAntibanding(const char *antiBandingStr);
    int32_t setFocusAreas(const char *focusAreasStr);
    int32_t setMeteringAreas(const char *meteringAreasStr);
    int32_t setSceneMode(const char *sceneModeStr);
    int32_t setSelectableZoneAf(const char *selZoneAFStr);
    int32_t setAEBracket(const char *aecBracketStr);
    int32_t setAFBracket(const char *afBracketStr);
    int32_t setReFocus(const char *reFocusStr);
    int32_t setChromaFlash(const char *chromaFlashStr);
    int32_t setOptiZoom(const char *optiZoomStr);
    int32_t setHDRMode(const char *optiZoomStr);
    int32_t setHDRNeed1x(const char *optiZoomStr);
    int32_t setTruePortrait(const char *truePortraitStr);
    int32_t setSeeMore(const char *SeeMoreStr);
    int32_t setStillMore(const char *StillMoreStr);
    int32_t setNoiseReductionMode(const char *noiseReductionModeStr);
    int32_t setRedeyeReduction(const char *redeyeStr);
    int32_t setWaveletDenoise(const char *wnrStr);
    int32_t setFaceRecognition(const char *faceRecog, uint32_t maxFaces);
    int32_t setTintlessValue(const char *tintStr);
    bool UpdateHFRFrameRate(const QCameraParameters& params);
    int32_t setRdiMode(const char *str);
    int32_t setSecureMode(const char *str);
    int32_t setLongshotParam(const QCameraParameters& params);
    int32_t parseGains(const char *gainStr, double &r_gain,
            double &g_gain, double &b_gain);
    int32_t setCacheVideoBuffers(const char *cacheVideoBufStr);
    int32_t setCDSMode(int32_t cds_mode, bool initCommit);
    int32_t setEztune();
    void setLowLightCapture();
    int setRecordingHintValue(int32_t value); // set local copy of video hint and send to server
                                              // no change in parameters value
    int32_t updateFlash(bool commitSettings);
    int32_t setRawSize(cam_dimension_t &dim);
    int32_t setMaxPicSize(cam_dimension_t &dim) { m_maxPicSize = dim; return NO_ERROR; };
    void setBufBatchCount(int8_t buf_cnt);
    void setVideoBatchSize();
    void setDcrf();
    int32_t setStreamPpMask(cam_stream_type_t stream_type, cam_feature_mask_t pp_mask);
    void setOfflineRAW(bool value = 0);
    int32_t setQuadraCfa(const QCameraParameters& params);
    int32_t configureFlash(cam_capture_frame_config_t &frame_config);
    int32_t configureLowLight(cam_capture_frame_config_t &frame_config);
    int32_t configureManualCapture(cam_capture_frame_config_t &frame_config);

    bool isTNRPreviewEnabled() {return m_bTNRPreviewOn;};
    bool isTNRVideoEnabled() {return m_bTNRVideoOn;};
    bool getFaceDetectionOption() { return  m_bFaceDetectionOn;}
    bool isAVTimerEnabled();
    void getLiveSnapshotSize(cam_dimension_t &dim);
    int32_t getRawSize(cam_dimension_t &dim) {dim = m_rawSize; return NO_ERROR;};
    int getAutoFlickerMode();
    bool sendStreamConfigInfo(cam_stream_size_info_t &stream_config_info);
    inline bool isLowMemoryDevice() {return m_bIsLowMemoryDevice;};
    bool isPreviewSeeMoreRequired();
    bool isEztuneEnabled() { return m_bEztuneEnabled; };
    int32_t getZoomLevel(){return mZoomLevel;};
    int32_t parse_pair(const char *str, int *first, int *second,
                       char delim, char **endptr);
    void parseSizesList(const char *sizesStr, Vector<Size> &sizes);
    int32_t parseNDimVector(const char *str, int *num, int N, char delim);
    int32_t parseCameraAreaString(const char *str, int max_num_areas,
                                  cam_area_t *pAreas, int& num_areas_found);
    bool validateCameraAreas(cam_area_t *areas, int num_areas);
    int parseGPSCoordinate(const char *coord_str, rat_t *coord);
    int32_t getRational(rat_t *rat, int num, int denom);
    String8 createSizesString(const cam_dimension_t *sizes, size_t len);
    String8 createHfrValuesString(const cam_hfr_info_t *values, size_t len,
            const QCameraMap<cam_hfr_mode_t> *map, size_t map_len);
    String8 createHfrSizesString(const cam_hfr_info_t *values, size_t len);
    String8 createFpsRangeString(const cam_fps_range_t *fps,
            size_t len, int &default_fps_index);
    String8 createFpsString(cam_fps_range_t &fps);
    String8 createZoomRatioValuesString(uint32_t *zoomRatios, size_t length);
    int32_t setDualLedCalibration(const QCameraParameters& params);
    int32_t setAdvancedCaptureMode();

    // ops for batch set/get params with server
    int32_t initBatchUpdate(parm_buffer_t *p_table);
    int32_t commitSetBatch();
    int32_t commitGetBatch();

    // ops to tempororily update parameter entries and commit
    int32_t updateParamEntry(const char *key, const char *value);
    int32_t commitParamChanges();
    void updateViewAngles();

    // Map from strings to values
    static const cam_dimension_t THUMBNAIL_SIZES_MAP[];
    static const QCameraMap<cam_auto_exposure_mode_type> AUTO_EXPOSURE_MAP[];
    static const QCameraMap<cam_aec_convergence_type> INSTANT_CAPTURE_MODES_MAP[];
    static const QCameraMap<cam_aec_convergence_type> INSTANT_AEC_MODES_MAP[];
    static const QCameraMap<cam_format_t> PREVIEW_FORMATS_MAP[];
    static const QCameraMap<cam_format_t> PICTURE_TYPES_MAP[];
    static const QCameraMap<cam_focus_mode_type> FOCUS_MODES_MAP[];
    static const QCameraMap<cam_effect_mode_type> EFFECT_MODES_MAP[];
    static const QCameraMap<cam_scene_mode_type> SCENE_MODES_MAP[];
    static const QCameraMap<cam_flash_mode_t> FLASH_MODES_MAP[];
    static const QCameraMap<cam_focus_algorithm_type> FOCUS_ALGO_MAP[];
    static const QCameraMap<cam_wb_mode_type> WHITE_BALANCE_MODES_MAP[];
    static const QCameraMap<cam_antibanding_mode_type> ANTIBANDING_MODES_MAP[];
    static const QCameraMap<cam_iso_mode_type> ISO_MODES_MAP[];
    static const QCameraMap<cam_hfr_mode_t> HFR_MODES_MAP[];
    static const QCameraMap<cam_bracket_mode> BRACKETING_MODES_MAP[];
    static const QCameraMap<int> ON_OFF_MODES_MAP[];
    static const QCameraMap<int> ENABLE_DISABLE_MODES_MAP[];
    static const QCameraMap<int> DENOISE_ON_OFF_MODES_MAP[];
    static const QCameraMap<int> TRUE_FALSE_MODES_MAP[];
    static const QCameraMap<int> TOUCH_AF_AEC_MODES_MAP[];
    static const QCameraMap<cam_flip_t> FLIP_MODES_MAP[];
    static const QCameraMap<int> AF_BRACKETING_MODES_MAP[];
    static const QCameraMap<int> RE_FOCUS_MODES_MAP[];
    static const QCameraMap<int> CHROMA_FLASH_MODES_MAP[];
    static const QCameraMap<int> OPTI_ZOOM_MODES_MAP[];
    static const QCameraMap<int> TRUE_PORTRAIT_MODES_MAP[];
    static const QCameraMap<cam_cds_mode_type_t> CDS_MODES_MAP[];
    static const QCameraMap<int> HDR_MODES_MAP[];
    static const QCameraMap<int> VIDEO_ROTATION_MODES_MAP[];
    static const QCameraMap<int> SEE_MORE_MODES_MAP[];
    static const QCameraMap<int> STILL_MORE_MODES_MAP[];
    static const QCameraMap<int> NOISE_REDUCTION_MODES_MAP[];

    QCameraReprocScaleParam m_reprocScaleParam;
    QCameraCommon           mCommon;

    cam_capability_t *m_pCapability;
    mm_camera_vtbl_t *m_pCamOpsTbl;
    QCameraHeapMemory *m_pParamHeap;
    parm_buffer_t     *m_pParamBuf;  // ptr to param buf in m_pParamHeap
    /* heap for mapping dual cam event info */
    QCameraHeapMemory *m_pRelCamSyncHeap;
    /* ptr to sync buffer in m_pRelCamSyncHeap */
    cam_sync_related_sensors_event_info_t *m_pRelCamSyncBuf;
    cam_sync_related_sensors_event_info_t m_relCamSyncInfo;
    bool m_bFrameSyncEnabled;
    cam_is_type_t mIsType;
    cam_is_type_t mIsTypePreview;

    bool m_bZslMode;                // if ZSL is enabled
    bool m_bZslMode_new;
    bool m_bForceZslMode;
    bool m_bRecordingHint;          // local copy of recording hint
    bool m_bRecordingHint_new;
    bool m_bHistogramEnabled;       // if histogram is enabled
    bool m_bLongshotEnabled;       // if longshot is enabled
    uint32_t m_nFaceProcMask;       // face process mask
    bool m_bFaceDetectionOn;        //  if face Detection turned on by user
    bool m_bDebugFps;               // if FPS need to be logged
    cam_focus_mode_type mFocusMode;
    cam_format_t mPreviewFormat;
    cam_format_t mAppPreviewFormat;
    int32_t mPictureFormat;         // could be CAMERA_PICTURE_TYPE_JPEG or cam_format_t
    bool m_bNeedRestart;            // if preview needs restart after parameters updated
    bool m_bNoDisplayMode;
    bool m_bWNROn;
    bool m_bTNRPreviewOn;
    bool m_bTNRVideoOn;
    bool m_bTNRSnapshotOn;
    bool m_bInited;
    int m_nRetroBurstNum;
    int m_nBurstLEDOnPeriod;
    cam_exp_bracketing_t m_AEBracketingClient;
    bool m_bUpdateEffects;          // Cause reapplying of effects
    bool m_bSceneTransitionAuto;    // Indicate that scene has changed to Auto
    bool m_bPreviewFlipChanged;        // if flip setting for preview changed
    bool m_bVideoFlipChanged;          // if flip setting for video changed
    bool m_bSnapshotFlipChanged;       // if flip setting for snapshot changed
    bool m_bFixedFrameRateSet;      // Indicates that a fixed frame rate is set
    qcamera_thermal_mode m_ThermalMode; // adjust fps vs adjust frameskip
    cam_dimension_t m_LiveSnapshotSize; // live snapshot size
    cam_dimension_t m_rawSize; // live snapshot size
    cam_dimension_t m_maxPicSize;
    bool m_bHDREnabled;             // if HDR is enabled
    bool m_bLocalHDREnabled;   // This flag tells whether HDR enabled or not regarless of APP mode
    bool m_bAVTimerEnabled;    //if AVTimer is enabled
    bool m_bDISEnabled;
    bool m_bOISEnabled;
    cam_still_more_t m_stillmore_config;

    uint8_t m_MobiMask;
    QCameraAdjustFPS *m_AdjustFPS;
    bool m_bHDR1xFrameEnabled;          // if frame with exposure compensation 0 during HDR is enabled
    bool m_HDRSceneEnabled; // Auto HDR indication
    bool m_bHDRThumbnailProcessNeeded;        // if thumbnail need to be processed for HDR
    bool m_bHDR1xExtraBufferNeeded;     // if extra frame with exposure compensation 0 during HDR is needed
    bool m_bHDROutputCropEnabled;     // if HDR output frame need to be scaled to user resolution
    DefaultKeyedVector<String8,String8> m_tempMap; // map for temororily store parameters to be set
    cam_fps_range_t m_default_fps_range;
    bool m_bAFBracketingOn;
    bool m_bReFocusOn;
    bool m_bChromaFlashOn;
    bool m_bOptiZoomOn;
    bool m_bSceneSelection;
    Mutex m_SceneSelectLock;
    cam_scene_mode_type m_SelectedScene;
    bool m_bSeeMoreOn;
    bool m_bStillMoreOn;
    bool m_bHighQualityNoiseReductionMode;
    cam_fps_range_t m_hfrFpsRange;
    bool m_bHfrMode;
    bool m_bSensorHDREnabled;             // if HDR is enabled
    bool m_bRdiMode;                // if RDI mode
    bool m_bSecureMode;
    bool m_bAeBracketingEnabled;
    int32_t mFlashValue;
    int32_t mFlashDaemonValue;
    int32_t mHfrMode;
    bool m_bHDRModeSensor;
    bool mOfflineRAW;
    bool m_bTruePortraitOn;
    cam_feature_mask_t m_nMinRequiredPpMask;
    cam_feature_mask_t mStreamPpMask[CAM_STREAM_TYPE_MAX];
    int32_t m_nSharpness;
    int8_t mTotalPPCount;
    int8_t mCurPPCount;
    int32_t mZoomLevel;
    bool m_bStreamsConfigured;
    int32_t mParmZoomLevel;
    bool m_bIsLowMemoryDevice;
    int32_t mCds_mode;
    int32_t mParmEffect;
    cam_capture_frame_config_t m_captureFrameConfig;
    int8_t mBufBatchCnt;
    bool m_bEztuneEnabled;
    bool m_bDcrfEnabled;
    uint32_t mRotation;
    uint32_t mJpegRotation;
    int8_t mVideoBatchSize;
    bool m_LLCaptureEnabled;
    cam_low_light_mode_t m_LowLightLevel;
    bool m_bLtmForSeeMoreEnabled;
    int64_t m_expTime;
    bool m_bOEMFeatEnabled;
    int32_t m_isoValue;
    QCameraManualCaptureModes m_ManualCaptureMode;
    cam_dyn_img_data_t m_DynamicImgData;
    int32_t m_dualLedCalibration;
    // Param to trigger instant AEC.
    bool m_bInstantAEC;
    // Param to trigger instant capture.
    bool m_bInstantCapture;
    // Number of frames, camera interface will wait for getting the instant capture frame.
    uint8_t mAecFrameBound;
    // Number of preview frames, that HAL will hold without displaying, for instant AEC mode.
    uint8_t mAecSkipDisplayFrameBound;
    bool m_bQuadraCfa;
};

}; // namespace qcamera

#endif