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; 29 FPSRange(){ 30 minFPS=0; 31 maxFPS=0; 32 }; 33 FPSRange(int min,int max){ 34 minFPS=min; 35 maxFPS=max; 36 }; 37 }; 38 class QCameraParameters: public CameraParameters 39 { 40 public: 41 #if 1 42 QCameraParameters() : CameraParameters() {}; 43 QCameraParameters(const String8 ¶ms): CameraParameters(params) {}; 44 #else 45 QCameraParameters() : CameraParameters() {}; 46 QCameraParameters(const String8 ¶ms) { 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_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 233 enum { 234 CAMERA_ORIENTATION_UNKNOWN = 0, 235 CAMERA_ORIENTATION_PORTRAIT = 1, 236 CAMERA_ORIENTATION_LANDSCAPE = 2, 237 }; 238 int getOrientation() const; 239 void setOrientation(int orientation); 240 void getSupportedHfrSizes(Vector<Size> &sizes) const; 241 void setPreviewFpsRange(int minFPS,int maxFPS); 242 void setPreviewFrameRateMode(const char *mode); 243 const char *getPreviewFrameRateMode() const; 244 void setTouchIndexAec(int x, int y); 245 void getTouchIndexAec(int *x, int *y) const; 246 void setTouchIndexAf(int x, int y); 247 void getTouchIndexAf(int *x, int *y) const; 248 void getMeteringAreaCenter(int * x, int *y) const; 249 250 }; 251 252 }; // namespace android 253 254 #endif 255