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