1 /*
2 ** Copyright 2008, The Android Open Source Project
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 **     http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
17 #ifndef ANDROID_HARDWARE_QCAMERA_PARAMETERS_H
18 #define ANDROID_HARDWARE_QCAMERA_PARAMETERS_H
19 
20 // Camera dependencies
21 #include <camera/CameraParameters.h>
22 
23 namespace android {
24 
25 struct FPSRange{
26     int minFPS;
27     int maxFPS;
FPSRangeFPSRange28     FPSRange(){
29         minFPS=0;
30         maxFPS=0;
31     };
FPSRangeFPSRange32     FPSRange(int min,int max){
33         minFPS=min;
34         maxFPS=max;
35     };
36 };
37 class QCameraParameters: public CameraParameters
38 {
39 public:
40 #if 1
QCameraParameters()41     QCameraParameters() : CameraParameters() {};
QCameraParameters(const String8 & params)42     QCameraParameters(const String8 &params): CameraParameters(params) {};
43     #else
44     QCameraParameters() : CameraParameters() {};
45     QCameraParameters(const String8 &params) { unflatten(params); }
46 #endif
47     ~QCameraParameters();
48 
49     // Supported PREVIEW/RECORDING SIZES IN HIGH FRAME RATE recording, sizes in pixels.
50     // Example value: "800x480,432x320". Read only.
51     static const char KEY_SUPPORTED_HFR_SIZES[];
52     // The mode of preview frame rate.
53     // Example value: "frame-rate-auto, frame-rate-fixed".
54     static const char KEY_PREVIEW_FRAME_RATE_MODE[];
55     static const char KEY_SUPPORTED_PREVIEW_FRAME_RATE_MODES[];
56     static const char KEY_PREVIEW_FRAME_RATE_AUTO_MODE[];
57     static const char KEY_PREVIEW_FRAME_RATE_FIXED_MODE[];
58 
59     static const char KEY_SKIN_TONE_ENHANCEMENT[] ;
60     static const char KEY_SUPPORTED_SKIN_TONE_ENHANCEMENT_MODES[] ;
61 
62     //Touch Af/AEC settings.
63     static const char KEY_TOUCH_AF_AEC[];
64     static const char KEY_SUPPORTED_TOUCH_AF_AEC[];
65     //Touch Index for AEC.
66     static const char KEY_TOUCH_INDEX_AEC[];
67     //Touch Index for AF.
68     static const char KEY_TOUCH_INDEX_AF[];
69     // Current auto scene detection mode.
70     // Example value: "off" or SCENE_DETECT_XXX constants. Read/write.
71     static const char KEY_SCENE_DETECT[];
72     // Supported auto scene detection settings.
73     // Example value: "off,backlight,snow/cloudy". Read only.
74     static const char KEY_SUPPORTED_SCENE_DETECT[];
75 	   // Returns true if video snapshot is supported. That is, applications
76     static const char KEY_FULL_VIDEO_SNAP_SUPPORTED[];
77     static const char KEY_POWER_MODE_SUPPORTED[];
78 
79     static const char KEY_ISO_MODE[];
80     static const char KEY_SUPPORTED_ISO_MODES[];
81     static const char KEY_LENSSHADE[] ;
82     static const char KEY_SUPPORTED_LENSSHADE_MODES[] ;
83 
84     static const char KEY_AUTO_EXPOSURE[];
85     static const char KEY_SUPPORTED_AUTO_EXPOSURE[];
86 
87     static const char KEY_GPS_LATITUDE_REF[];
88     static const char KEY_GPS_LONGITUDE_REF[];
89     static const char KEY_GPS_ALTITUDE_REF[];
90     static const char KEY_GPS_STATUS[];
91     static const char KEY_EXIF_DATETIME[];
92     static const char KEY_MEMORY_COLOR_ENHANCEMENT[];
93     static const char KEY_SUPPORTED_MEM_COLOR_ENHANCE_MODES[];
94 
95 
96     static const char KEY_POWER_MODE[];
97 
98     static const char KEY_ZSL[];
99     static const char KEY_SUPPORTED_ZSL_MODES[];
100 
101     static const char KEY_CAMERA_MODE[];
102 
103     static const char KEY_VIDEO_HIGH_FRAME_RATE[];
104     static const char KEY_SUPPORTED_VIDEO_HIGH_FRAME_RATE_MODES[];
105     static const char KEY_HIGH_DYNAMIC_RANGE_IMAGING[];
106     static const char KEY_SUPPORTED_HDR_IMAGING_MODES[];
107     static const char KEY_AE_BRACKET_HDR[];
108 
109 
110     // DENOISE
111     static const char KEY_DENOISE[];
112     static const char KEY_SUPPORTED_DENOISE[];
113 
114     //Selectable zone AF.
115     static const char KEY_SELECTABLE_ZONE_AF[];
116     static const char KEY_SUPPORTED_SELECTABLE_ZONE_AF[];
117 
118     //Face Detection
119     static const char KEY_FACE_DETECTION[];
120     static const char KEY_SUPPORTED_FACE_DETECTION[];
121 
122     //Redeye Reduction
123     static const char KEY_REDEYE_REDUCTION[];
124     static const char KEY_SUPPORTED_REDEYE_REDUCTION[];
125     static const char EFFECT_EMBOSS[];
126     static const char EFFECT_SKETCH[];
127     static const char EFFECT_NEON[];
128 
129     // Values for Touch AF/AEC
130     static const char TOUCH_AF_AEC_OFF[] ;
131     static const char TOUCH_AF_AEC_ON[] ;
132     static const char SCENE_MODE_ASD[];
133     static const char SCENE_MODE_BACKLIGHT[];
134     static const char SCENE_MODE_FLOWERS[];
135     static const char SCENE_MODE_AR[];
136     static const char SCENE_MODE_HDR[];
137 	static const char SCENE_DETECT_OFF[];
138     static const char SCENE_DETECT_ON[];
139     static const char PIXEL_FORMAT_YUV420SP_ADRENO[]; // ADRENO
140 	static const char PIXEL_FORMAT_RAW[];
141     static const char PIXEL_FORMAT_YV12[]; // NV12
142     static const char PIXEL_FORMAT_NV12[]; //NV12
143     // Normal focus mode. Applications should call
144     // CameraHardwareInterface.autoFocus to start the focus in this mode.
145     static const char FOCUS_MODE_NORMAL[];
146     static const char ISO_AUTO[];
147     static const char ISO_HJR[] ;
148     static const char ISO_100[];
149     static const char ISO_200[] ;
150     static const char ISO_400[];
151     static const char ISO_800[];
152     static const char ISO_1600[];
153     // Values for Lens Shading
154     static const char LENSSHADE_ENABLE[] ;
155     static const char LENSSHADE_DISABLE[] ;
156 
157     // Values for auto exposure settings.
158     static const char AUTO_EXPOSURE_FRAME_AVG[];
159     static const char AUTO_EXPOSURE_CENTER_WEIGHTED[];
160     static const char AUTO_EXPOSURE_SPOT_METERING[];
161 
162     static const char KEY_SHARPNESS[];
163     static const char KEY_MAX_SHARPNESS[];
164     static const char KEY_CONTRAST[];
165     static const char KEY_MAX_CONTRAST[];
166     static const char KEY_SATURATION[];
167     static const char KEY_MAX_SATURATION[];
168 
169     static const char KEY_HISTOGRAM[] ;
170     static const char KEY_SUPPORTED_HISTOGRAM_MODES[] ;
171     // Values for HISTOGRAM
172     static const char HISTOGRAM_ENABLE[] ;
173     static const char HISTOGRAM_DISABLE[] ;
174 
175     // Values for SKIN TONE ENHANCEMENT
176     static const char SKIN_TONE_ENHANCEMENT_ENABLE[] ;
177     static const char SKIN_TONE_ENHANCEMENT_DISABLE[] ;
178 
179     // Values for Denoise
180     static const char DENOISE_OFF[] ;
181     static const char DENOISE_ON[] ;
182 
183     // Values for auto exposure settings.
184     static const char SELECTABLE_ZONE_AF_AUTO[];
185     static const char SELECTABLE_ZONE_AF_SPOT_METERING[];
186     static const char SELECTABLE_ZONE_AF_CENTER_WEIGHTED[];
187     static const char SELECTABLE_ZONE_AF_FRAME_AVERAGE[];
188 
189     // Values for Face Detection settings.
190     static const char FACE_DETECTION_OFF[];
191     static const char FACE_DETECTION_ON[];
192 
193     // Values for MCE settings.
194     static const char MCE_ENABLE[];
195     static const char MCE_DISABLE[];
196 
197     // Values for ZSL settings.
198     static const char ZSL_OFF[];
199     static const char ZSL_ON[];
200 
201     // Values for HDR Bracketing settings.
202     static const char AE_BRACKET_HDR_OFF[];
203     static const char AE_BRACKET_HDR[];
204     static const char AE_BRACKET[];
205 
206     // Values for Power mode settings.
207     static const char LOW_POWER[];
208     static const char NORMAL_POWER[];
209 
210     // Values for HFR settings.
211     static const char VIDEO_HFR_OFF[];
212     static const char VIDEO_HFR_2X[];
213     static const char VIDEO_HFR_3X[];
214     static const char VIDEO_HFR_4X[];
215 
216     // Values for Redeye Reduction settings.
217     static const char REDEYE_REDUCTION_ENABLE[];
218     static const char REDEYE_REDUCTION_DISABLE[];
219     // Values for HDR settings.
220     static const char HDR_ENABLE[];
221     static const char HDR_DISABLE[];
222 
223    // Values for Redeye Reduction settings.
224    // static const char REDEYE_REDUCTION_ENABLE[];
225    // static const char REDEYE_REDUCTION_DISABLE[];
226    // Values for HDR settings.
227    //    static const char HDR_ENABLE[];
228    //    static const char HDR_DISABLE[];
229 
230 
231    static const char KEY_SINGLE_ISP_OUTPUT_ENABLED[];
232    static const char KEY_SUPPORTED_CAMERA_FEATURES[];
233    static const char KEY_MAX_NUM_REQUESTED_FACES[];
234 
235     enum {
236         CAMERA_ORIENTATION_UNKNOWN = 0,
237         CAMERA_ORIENTATION_PORTRAIT = 1,
238         CAMERA_ORIENTATION_LANDSCAPE = 2,
239     };
240     int getOrientation() const;
241     void setOrientation(int orientation);
242     void getSupportedHfrSizes(Vector<Size> &sizes) const;
243     void setPreviewFpsRange(int minFPS,int maxFPS);
244 	void setPreviewFrameRateMode(const char *mode);
245     const char *getPreviewFrameRateMode() const;
246     void setTouchIndexAec(int x, int y);
247     void getTouchIndexAec(int *x, int *y) const;
248     void setTouchIndexAf(int x, int y);
249     void getTouchIndexAf(int *x, int *y) const;
250     void getMeteringAreaCenter(int * x, int *y) const;
251 
252 };
253 
254 }; // namespace android
255 
256 #endif
257