xref: /aosp_15_r20/hardware/interfaces/camera/common/default/include/CameraParameters.h (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
1*4d7e907cSAndroid Build Coastguard Worker /*
2*4d7e907cSAndroid Build Coastguard Worker  * Copyright (C) 2008 The Android Open Source Project
3*4d7e907cSAndroid Build Coastguard Worker  *
4*4d7e907cSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*4d7e907cSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*4d7e907cSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*4d7e907cSAndroid Build Coastguard Worker  *
8*4d7e907cSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*4d7e907cSAndroid Build Coastguard Worker  *
10*4d7e907cSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*4d7e907cSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*4d7e907cSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*4d7e907cSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*4d7e907cSAndroid Build Coastguard Worker  * limitations under the License.
15*4d7e907cSAndroid Build Coastguard Worker  */
16*4d7e907cSAndroid Build Coastguard Worker 
17*4d7e907cSAndroid Build Coastguard Worker #ifndef ANDROID_HARDWARE_CAMERA_PARAMETERS_H
18*4d7e907cSAndroid Build Coastguard Worker #define ANDROID_HARDWARE_CAMERA_PARAMETERS_H
19*4d7e907cSAndroid Build Coastguard Worker 
20*4d7e907cSAndroid Build Coastguard Worker #include <utils/KeyedVector.h>
21*4d7e907cSAndroid Build Coastguard Worker #include <utils/String8.h>
22*4d7e907cSAndroid Build Coastguard Worker 
23*4d7e907cSAndroid Build Coastguard Worker namespace android {
24*4d7e907cSAndroid Build Coastguard Worker namespace hardware {
25*4d7e907cSAndroid Build Coastguard Worker namespace camera {
26*4d7e907cSAndroid Build Coastguard Worker namespace common {
27*4d7e907cSAndroid Build Coastguard Worker namespace helper {
28*4d7e907cSAndroid Build Coastguard Worker 
29*4d7e907cSAndroid Build Coastguard Worker struct Size {
30*4d7e907cSAndroid Build Coastguard Worker     int width;
31*4d7e907cSAndroid Build Coastguard Worker     int height;
32*4d7e907cSAndroid Build Coastguard Worker 
SizeSize33*4d7e907cSAndroid Build Coastguard Worker     Size() {
34*4d7e907cSAndroid Build Coastguard Worker         width = 0;
35*4d7e907cSAndroid Build Coastguard Worker         height = 0;
36*4d7e907cSAndroid Build Coastguard Worker     }
37*4d7e907cSAndroid Build Coastguard Worker 
SizeSize38*4d7e907cSAndroid Build Coastguard Worker     Size(int w, int h) {
39*4d7e907cSAndroid Build Coastguard Worker         width = w;
40*4d7e907cSAndroid Build Coastguard Worker         height = h;
41*4d7e907cSAndroid Build Coastguard Worker     }
42*4d7e907cSAndroid Build Coastguard Worker };
43*4d7e907cSAndroid Build Coastguard Worker 
44*4d7e907cSAndroid Build Coastguard Worker class CameraParameters {
45*4d7e907cSAndroid Build Coastguard Worker   public:
46*4d7e907cSAndroid Build Coastguard Worker     CameraParameters();
CameraParameters(const String8 & params)47*4d7e907cSAndroid Build Coastguard Worker     CameraParameters(const String8& params) { unflatten(params); }
48*4d7e907cSAndroid Build Coastguard Worker     ~CameraParameters();
49*4d7e907cSAndroid Build Coastguard Worker 
50*4d7e907cSAndroid Build Coastguard Worker     String8 flatten() const;
51*4d7e907cSAndroid Build Coastguard Worker     void unflatten(const String8& params);
52*4d7e907cSAndroid Build Coastguard Worker 
53*4d7e907cSAndroid Build Coastguard Worker     void set(const char* key, const char* value);
54*4d7e907cSAndroid Build Coastguard Worker     void set(const char* key, int value);
55*4d7e907cSAndroid Build Coastguard Worker     void setFloat(const char* key, float value);
56*4d7e907cSAndroid Build Coastguard Worker     const char* get(const char* key) const;
57*4d7e907cSAndroid Build Coastguard Worker     int getInt(const char* key) const;
58*4d7e907cSAndroid Build Coastguard Worker     float getFloat(const char* key) const;
59*4d7e907cSAndroid Build Coastguard Worker 
60*4d7e907cSAndroid Build Coastguard Worker     void remove(const char* key);
61*4d7e907cSAndroid Build Coastguard Worker 
62*4d7e907cSAndroid Build Coastguard Worker     void setPreviewSize(int width, int height);
63*4d7e907cSAndroid Build Coastguard Worker     void getPreviewSize(int* width, int* height) const;
64*4d7e907cSAndroid Build Coastguard Worker     void getSupportedPreviewSizes(Vector<Size>& sizes) const;
65*4d7e907cSAndroid Build Coastguard Worker 
66*4d7e907cSAndroid Build Coastguard Worker     // Set the dimensions in pixels to the given width and height
67*4d7e907cSAndroid Build Coastguard Worker     // for video frames. The given width and height must be one
68*4d7e907cSAndroid Build Coastguard Worker     // of the supported dimensions returned from
69*4d7e907cSAndroid Build Coastguard Worker     // getSupportedVideoSizes(). Must not be called if
70*4d7e907cSAndroid Build Coastguard Worker     // getSupportedVideoSizes() returns an empty Vector of Size.
71*4d7e907cSAndroid Build Coastguard Worker     void setVideoSize(int width, int height);
72*4d7e907cSAndroid Build Coastguard Worker     // Retrieve the current dimensions (width and height)
73*4d7e907cSAndroid Build Coastguard Worker     // in pixels for video frames, which must be one of the
74*4d7e907cSAndroid Build Coastguard Worker     // supported dimensions returned from getSupportedVideoSizes().
75*4d7e907cSAndroid Build Coastguard Worker     // Must not be called if getSupportedVideoSizes() returns an
76*4d7e907cSAndroid Build Coastguard Worker     // empty Vector of Size.
77*4d7e907cSAndroid Build Coastguard Worker     void getVideoSize(int* width, int* height) const;
78*4d7e907cSAndroid Build Coastguard Worker     // Retrieve a Vector of supported dimensions (width and height)
79*4d7e907cSAndroid Build Coastguard Worker     // in pixels for video frames. If sizes returned from the method
80*4d7e907cSAndroid Build Coastguard Worker     // is empty, the camera does not support calls to setVideoSize()
81*4d7e907cSAndroid Build Coastguard Worker     // or getVideoSize(). In adddition, it also indicates that
82*4d7e907cSAndroid Build Coastguard Worker     // the camera only has a single output, and does not have
83*4d7e907cSAndroid Build Coastguard Worker     // separate output for video frames and preview frame.
84*4d7e907cSAndroid Build Coastguard Worker     void getSupportedVideoSizes(Vector<Size>& sizes) const;
85*4d7e907cSAndroid Build Coastguard Worker     // Retrieve the preferred preview size (width and height) in pixels
86*4d7e907cSAndroid Build Coastguard Worker     // for video recording. The given width and height must be one of
87*4d7e907cSAndroid Build Coastguard Worker     // supported preview sizes returned from getSupportedPreviewSizes().
88*4d7e907cSAndroid Build Coastguard Worker     // Must not be called if getSupportedVideoSizes() returns an empty
89*4d7e907cSAndroid Build Coastguard Worker     // Vector of Size. If getSupportedVideoSizes() returns an empty
90*4d7e907cSAndroid Build Coastguard Worker     // Vector of Size, the width and height returned from this method
91*4d7e907cSAndroid Build Coastguard Worker     // is invalid, and is "-1x-1".
92*4d7e907cSAndroid Build Coastguard Worker     void getPreferredPreviewSizeForVideo(int* width, int* height) const;
93*4d7e907cSAndroid Build Coastguard Worker 
94*4d7e907cSAndroid Build Coastguard Worker     void setPreviewFrameRate(int fps);
95*4d7e907cSAndroid Build Coastguard Worker     int getPreviewFrameRate() const;
96*4d7e907cSAndroid Build Coastguard Worker     void getPreviewFpsRange(int* min_fps, int* max_fps) const;
97*4d7e907cSAndroid Build Coastguard Worker     void setPreviewFormat(const char* format);
98*4d7e907cSAndroid Build Coastguard Worker     const char* getPreviewFormat() const;
99*4d7e907cSAndroid Build Coastguard Worker     void setPictureSize(int width, int height);
100*4d7e907cSAndroid Build Coastguard Worker     void getPictureSize(int* width, int* height) const;
101*4d7e907cSAndroid Build Coastguard Worker     void getSupportedPictureSizes(Vector<Size>& sizes) const;
102*4d7e907cSAndroid Build Coastguard Worker     void setPictureFormat(const char* format);
103*4d7e907cSAndroid Build Coastguard Worker     const char* getPictureFormat() const;
104*4d7e907cSAndroid Build Coastguard Worker 
105*4d7e907cSAndroid Build Coastguard Worker     void dump() const;
106*4d7e907cSAndroid Build Coastguard Worker     status_t dump(int fd, const Vector<String16>& args) const;
107*4d7e907cSAndroid Build Coastguard Worker 
108*4d7e907cSAndroid Build Coastguard Worker     /**
109*4d7e907cSAndroid Build Coastguard Worker      * Returns a Vector containing the supported preview formats
110*4d7e907cSAndroid Build Coastguard Worker      * as enums given in graphics.h.
111*4d7e907cSAndroid Build Coastguard Worker      */
112*4d7e907cSAndroid Build Coastguard Worker     void getSupportedPreviewFormats(Vector<int>& formats) const;
113*4d7e907cSAndroid Build Coastguard Worker 
114*4d7e907cSAndroid Build Coastguard Worker     // Returns true if no keys are present
115*4d7e907cSAndroid Build Coastguard Worker     bool isEmpty() const;
116*4d7e907cSAndroid Build Coastguard Worker 
117*4d7e907cSAndroid Build Coastguard Worker     // Parameter keys to communicate between camera application and driver.
118*4d7e907cSAndroid Build Coastguard Worker     // The access (read/write, read only, or write only) is viewed from the
119*4d7e907cSAndroid Build Coastguard Worker     // perspective of applications, not driver.
120*4d7e907cSAndroid Build Coastguard Worker 
121*4d7e907cSAndroid Build Coastguard Worker     // Preview frame size in pixels (width x height).
122*4d7e907cSAndroid Build Coastguard Worker     // Example value: "480x320". Read/Write.
123*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_PREVIEW_SIZE[];
124*4d7e907cSAndroid Build Coastguard Worker     // Supported preview frame sizes in pixels.
125*4d7e907cSAndroid Build Coastguard Worker     // Example value: "800x600,480x320". Read only.
126*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_PREVIEW_SIZES[];
127*4d7e907cSAndroid Build Coastguard Worker     // The current minimum and maximum preview fps. This controls the rate of
128*4d7e907cSAndroid Build Coastguard Worker     // preview frames received (CAMERA_MSG_PREVIEW_FRAME). The minimum and
129*4d7e907cSAndroid Build Coastguard Worker     // maximum fps must be one of the elements from
130*4d7e907cSAndroid Build Coastguard Worker     // KEY_SUPPORTED_PREVIEW_FPS_RANGE parameter.
131*4d7e907cSAndroid Build Coastguard Worker     // Example value: "10500,26623"
132*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_PREVIEW_FPS_RANGE[];
133*4d7e907cSAndroid Build Coastguard Worker     // The supported preview fps (frame-per-second) ranges. Each range contains
134*4d7e907cSAndroid Build Coastguard Worker     // a minimum fps and maximum fps. If minimum fps equals to maximum fps, the
135*4d7e907cSAndroid Build Coastguard Worker     // camera outputs frames in fixed frame rate. If not, the camera outputs
136*4d7e907cSAndroid Build Coastguard Worker     // frames in auto frame rate. The actual frame rate fluctuates between the
137*4d7e907cSAndroid Build Coastguard Worker     // minimum and the maximum. The list has at least one element. The list is
138*4d7e907cSAndroid Build Coastguard Worker     // sorted from small to large (first by maximum fps and then minimum fps).
139*4d7e907cSAndroid Build Coastguard Worker     // Example value: "(10500,26623),(15000,26623),(30000,30000)"
140*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_PREVIEW_FPS_RANGE[];
141*4d7e907cSAndroid Build Coastguard Worker     // The image format for preview frames. See CAMERA_MSG_PREVIEW_FRAME in
142*4d7e907cSAndroid Build Coastguard Worker     // frameworks/av/include/camera/Camera.h. The default is
143*4d7e907cSAndroid Build Coastguard Worker     // PIXEL_FORMAT_YUV420SP. Example value: "yuv420sp" or PIXEL_FORMAT_XXX
144*4d7e907cSAndroid Build Coastguard Worker     // constants. Read/write.
145*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_PREVIEW_FORMAT[];
146*4d7e907cSAndroid Build Coastguard Worker     // Supported image formats for preview frames.
147*4d7e907cSAndroid Build Coastguard Worker     // Example value: "yuv420sp,yuv422i-yuyv". Read only.
148*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_PREVIEW_FORMATS[];
149*4d7e907cSAndroid Build Coastguard Worker     // Number of preview frames per second. This is the target frame rate. The
150*4d7e907cSAndroid Build Coastguard Worker     // actual frame rate depends on the driver.
151*4d7e907cSAndroid Build Coastguard Worker     // Example value: "15". Read/write.
152*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_PREVIEW_FRAME_RATE[];
153*4d7e907cSAndroid Build Coastguard Worker     // Supported number of preview frames per second.
154*4d7e907cSAndroid Build Coastguard Worker     // Example value: "24,15,10". Read.
155*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_PREVIEW_FRAME_RATES[];
156*4d7e907cSAndroid Build Coastguard Worker     // The dimensions for captured pictures in pixels (width x height).
157*4d7e907cSAndroid Build Coastguard Worker     // Example value: "1024x768". Read/write.
158*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_PICTURE_SIZE[];
159*4d7e907cSAndroid Build Coastguard Worker     // Supported dimensions for captured pictures in pixels.
160*4d7e907cSAndroid Build Coastguard Worker     // Example value: "2048x1536,1024x768". Read only.
161*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_PICTURE_SIZES[];
162*4d7e907cSAndroid Build Coastguard Worker     // The image format for captured pictures. See CAMERA_MSG_COMPRESSED_IMAGE
163*4d7e907cSAndroid Build Coastguard Worker     // in frameworks/base/include/camera/Camera.h.
164*4d7e907cSAndroid Build Coastguard Worker     // Example value: "jpeg" or PIXEL_FORMAT_XXX constants. Read/write.
165*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_PICTURE_FORMAT[];
166*4d7e907cSAndroid Build Coastguard Worker     // Supported image formats for captured pictures.
167*4d7e907cSAndroid Build Coastguard Worker     // Example value: "jpeg,rgb565". Read only.
168*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_PICTURE_FORMATS[];
169*4d7e907cSAndroid Build Coastguard Worker     // The width (in pixels) of EXIF thumbnail in Jpeg picture.
170*4d7e907cSAndroid Build Coastguard Worker     // Example value: "512". Read/write.
171*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_JPEG_THUMBNAIL_WIDTH[];
172*4d7e907cSAndroid Build Coastguard Worker     // The height (in pixels) of EXIF thumbnail in Jpeg picture.
173*4d7e907cSAndroid Build Coastguard Worker     // Example value: "384". Read/write.
174*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_JPEG_THUMBNAIL_HEIGHT[];
175*4d7e907cSAndroid Build Coastguard Worker     // Supported EXIF thumbnail sizes (width x height). 0x0 means not thumbnail
176*4d7e907cSAndroid Build Coastguard Worker     // in EXIF.
177*4d7e907cSAndroid Build Coastguard Worker     // Example value: "512x384,320x240,0x0". Read only.
178*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_JPEG_THUMBNAIL_SIZES[];
179*4d7e907cSAndroid Build Coastguard Worker     // The quality of the EXIF thumbnail in Jpeg picture. The range is 1 to 100,
180*4d7e907cSAndroid Build Coastguard Worker     // with 100 being the best.
181*4d7e907cSAndroid Build Coastguard Worker     // Example value: "90". Read/write.
182*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_JPEG_THUMBNAIL_QUALITY[];
183*4d7e907cSAndroid Build Coastguard Worker     // Jpeg quality of captured picture. The range is 1 to 100, with 100 being
184*4d7e907cSAndroid Build Coastguard Worker     // the best.
185*4d7e907cSAndroid Build Coastguard Worker     // Example value: "90". Read/write.
186*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_JPEG_QUALITY[];
187*4d7e907cSAndroid Build Coastguard Worker     // The rotation angle in degrees relative to the orientation of the camera.
188*4d7e907cSAndroid Build Coastguard Worker     // This affects the pictures returned from CAMERA_MSG_COMPRESSED_IMAGE. The
189*4d7e907cSAndroid Build Coastguard Worker     // camera driver may set orientation in the EXIF header without rotating the
190*4d7e907cSAndroid Build Coastguard Worker     // picture. Or the driver may rotate the picture and the EXIF thumbnail. If
191*4d7e907cSAndroid Build Coastguard Worker     // the Jpeg picture is rotated, the orientation in the EXIF header will be
192*4d7e907cSAndroid Build Coastguard Worker     // missing or 1 (row #0 is top and column #0 is left side).
193*4d7e907cSAndroid Build Coastguard Worker     //
194*4d7e907cSAndroid Build Coastguard Worker     // Note that the JPEG pictures of front-facing cameras are not mirrored
195*4d7e907cSAndroid Build Coastguard Worker     // as in preview display.
196*4d7e907cSAndroid Build Coastguard Worker     //
197*4d7e907cSAndroid Build Coastguard Worker     // For example, suppose the natural orientation of the device is portrait.
198*4d7e907cSAndroid Build Coastguard Worker     // The device is rotated 270 degrees clockwise, so the device orientation is
199*4d7e907cSAndroid Build Coastguard Worker     // 270. Suppose a back-facing camera sensor is mounted in landscape and the
200*4d7e907cSAndroid Build Coastguard Worker     // top side of the camera sensor is aligned with the right edge of the
201*4d7e907cSAndroid Build Coastguard Worker     // display in natural orientation. So the camera orientation is 90. The
202*4d7e907cSAndroid Build Coastguard Worker     // rotation should be set to 0 (270 + 90).
203*4d7e907cSAndroid Build Coastguard Worker     //
204*4d7e907cSAndroid Build Coastguard Worker     // Example value: "0" or "90" or "180" or "270". Write only.
205*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_ROTATION[];
206*4d7e907cSAndroid Build Coastguard Worker     // GPS latitude coordinate. GPSLatitude and GPSLatitudeRef will be stored in
207*4d7e907cSAndroid Build Coastguard Worker     // JPEG EXIF header.
208*4d7e907cSAndroid Build Coastguard Worker     // Example value: "25.032146" or "-33.462809". Write only.
209*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_GPS_LATITUDE[];
210*4d7e907cSAndroid Build Coastguard Worker     // GPS longitude coordinate. GPSLongitude and GPSLongitudeRef will be stored
211*4d7e907cSAndroid Build Coastguard Worker     // in JPEG EXIF header.
212*4d7e907cSAndroid Build Coastguard Worker     // Example value: "121.564448" or "-70.660286". Write only.
213*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_GPS_LONGITUDE[];
214*4d7e907cSAndroid Build Coastguard Worker     // GPS altitude. GPSAltitude and GPSAltitudeRef will be stored in JPEG EXIF
215*4d7e907cSAndroid Build Coastguard Worker     // header.
216*4d7e907cSAndroid Build Coastguard Worker     // Example value: "21.0" or "-5". Write only.
217*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_GPS_ALTITUDE[];
218*4d7e907cSAndroid Build Coastguard Worker     // GPS timestamp (UTC in seconds since January 1, 1970). This should be
219*4d7e907cSAndroid Build Coastguard Worker     // stored in JPEG EXIF header.
220*4d7e907cSAndroid Build Coastguard Worker     // Example value: "1251192757". Write only.
221*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_GPS_TIMESTAMP[];
222*4d7e907cSAndroid Build Coastguard Worker     // GPS Processing Method
223*4d7e907cSAndroid Build Coastguard Worker     // Example value: "GPS" or "NETWORK". Write only.
224*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_GPS_PROCESSING_METHOD[];
225*4d7e907cSAndroid Build Coastguard Worker     // Current white balance setting.
226*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto" or WHITE_BALANCE_XXX constants. Read/write.
227*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_WHITE_BALANCE[];
228*4d7e907cSAndroid Build Coastguard Worker     // Supported white balance settings.
229*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto,incandescent,daylight". Read only.
230*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_WHITE_BALANCE[];
231*4d7e907cSAndroid Build Coastguard Worker     // Current color effect setting.
232*4d7e907cSAndroid Build Coastguard Worker     // Example value: "none" or EFFECT_XXX constants. Read/write.
233*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_EFFECT[];
234*4d7e907cSAndroid Build Coastguard Worker     // Supported color effect settings.
235*4d7e907cSAndroid Build Coastguard Worker     // Example value: "none,mono,sepia". Read only.
236*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_EFFECTS[];
237*4d7e907cSAndroid Build Coastguard Worker     // Current antibanding setting.
238*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto" or ANTIBANDING_XXX constants. Read/write.
239*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_ANTIBANDING[];
240*4d7e907cSAndroid Build Coastguard Worker     // Supported antibanding settings.
241*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto,50hz,60hz,off". Read only.
242*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_ANTIBANDING[];
243*4d7e907cSAndroid Build Coastguard Worker     // Current scene mode.
244*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto" or SCENE_MODE_XXX constants. Read/write.
245*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SCENE_MODE[];
246*4d7e907cSAndroid Build Coastguard Worker     // Supported scene mode settings.
247*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto,night,fireworks". Read only.
248*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_SCENE_MODES[];
249*4d7e907cSAndroid Build Coastguard Worker     // Current flash mode.
250*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto" or FLASH_MODE_XXX constants. Read/write.
251*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_FLASH_MODE[];
252*4d7e907cSAndroid Build Coastguard Worker     // Supported flash modes.
253*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto,on,off". Read only.
254*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_FLASH_MODES[];
255*4d7e907cSAndroid Build Coastguard Worker     // Current focus mode. This will not be empty. Applications should call
256*4d7e907cSAndroid Build Coastguard Worker     // CameraHardwareInterface.autoFocus to start the focus if focus mode is
257*4d7e907cSAndroid Build Coastguard Worker     // FOCUS_MODE_AUTO or FOCUS_MODE_MACRO.
258*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto" or FOCUS_MODE_XXX constants. Read/write.
259*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_FOCUS_MODE[];
260*4d7e907cSAndroid Build Coastguard Worker     // Supported focus modes.
261*4d7e907cSAndroid Build Coastguard Worker     // Example value: "auto,macro,fixed". Read only.
262*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_FOCUS_MODES[];
263*4d7e907cSAndroid Build Coastguard Worker     // The maximum number of focus areas supported. This is the maximum length
264*4d7e907cSAndroid Build Coastguard Worker     // of KEY_FOCUS_AREAS.
265*4d7e907cSAndroid Build Coastguard Worker     // Example value: "0" or "2". Read only.
266*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_MAX_NUM_FOCUS_AREAS[];
267*4d7e907cSAndroid Build Coastguard Worker     // Current focus areas.
268*4d7e907cSAndroid Build Coastguard Worker     //
269*4d7e907cSAndroid Build Coastguard Worker     // Before accessing this parameter, apps should check
270*4d7e907cSAndroid Build Coastguard Worker     // KEY_MAX_NUM_FOCUS_AREAS first to know the maximum number of focus areas
271*4d7e907cSAndroid Build Coastguard Worker     // first. If the value is 0, focus area is not supported.
272*4d7e907cSAndroid Build Coastguard Worker     //
273*4d7e907cSAndroid Build Coastguard Worker     // Each focus area is a five-element int array. The first four elements are
274*4d7e907cSAndroid Build Coastguard Worker     // the rectangle of the area (left, top, right, bottom). The direction is
275*4d7e907cSAndroid Build Coastguard Worker     // relative to the sensor orientation, that is, what the sensor sees. The
276*4d7e907cSAndroid Build Coastguard Worker     // direction is not affected by the rotation or mirroring of
277*4d7e907cSAndroid Build Coastguard Worker     // CAMERA_CMD_SET_DISPLAY_ORIENTATION. Coordinates range from -1000 to 1000.
278*4d7e907cSAndroid Build Coastguard Worker     // (-1000,-1000) is the upper left point. (1000, 1000) is the lower right
279*4d7e907cSAndroid Build Coastguard Worker     // point. The width and height of focus areas cannot be 0 or negative.
280*4d7e907cSAndroid Build Coastguard Worker     //
281*4d7e907cSAndroid Build Coastguard Worker     // The fifth element is the weight. Values for weight must range from 1 to
282*4d7e907cSAndroid Build Coastguard Worker     // 1000.  The weight should be interpreted as a per-pixel weight - all
283*4d7e907cSAndroid Build Coastguard Worker     // pixels in the area have the specified weight. This means a small area
284*4d7e907cSAndroid Build Coastguard Worker     // with the same weight as a larger area will have less influence on the
285*4d7e907cSAndroid Build Coastguard Worker     // focusing than the larger area. Focus areas can partially overlap and the
286*4d7e907cSAndroid Build Coastguard Worker     // driver will add the weights in the overlap region.
287*4d7e907cSAndroid Build Coastguard Worker     //
288*4d7e907cSAndroid Build Coastguard Worker     // A special case of single focus area (0,0,0,0,0) means driver to decide
289*4d7e907cSAndroid Build Coastguard Worker     // the focus area. For example, the driver may use more signals to decide
290*4d7e907cSAndroid Build Coastguard Worker     // focus areas and change them dynamically. Apps can set (0,0,0,0,0) if they
291*4d7e907cSAndroid Build Coastguard Worker     // want the driver to decide focus areas.
292*4d7e907cSAndroid Build Coastguard Worker     //
293*4d7e907cSAndroid Build Coastguard Worker     // Focus areas are relative to the current field of view (KEY_ZOOM). No
294*4d7e907cSAndroid Build Coastguard Worker     // matter what the zoom level is, (-1000,-1000) represents the top of the
295*4d7e907cSAndroid Build Coastguard Worker     // currently visible camera frame. The focus area cannot be set to be
296*4d7e907cSAndroid Build Coastguard Worker     // outside the current field of view, even when using zoom.
297*4d7e907cSAndroid Build Coastguard Worker     //
298*4d7e907cSAndroid Build Coastguard Worker     // Focus area only has effect if the current focus mode is FOCUS_MODE_AUTO,
299*4d7e907cSAndroid Build Coastguard Worker     // FOCUS_MODE_MACRO, FOCUS_MODE_CONTINUOUS_VIDEO, or
300*4d7e907cSAndroid Build Coastguard Worker     // FOCUS_MODE_CONTINUOUS_PICTURE.
301*4d7e907cSAndroid Build Coastguard Worker     // Example value: "(-10,-10,0,0,300),(0,0,10,10,700)". Read/write.
302*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_FOCUS_AREAS[];
303*4d7e907cSAndroid Build Coastguard Worker     // Focal length in millimeter.
304*4d7e907cSAndroid Build Coastguard Worker     // Example value: "4.31". Read only.
305*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_FOCAL_LENGTH[];
306*4d7e907cSAndroid Build Coastguard Worker     // Horizontal angle of view in degrees.
307*4d7e907cSAndroid Build Coastguard Worker     // Example value: "54.8". Read only.
308*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_HORIZONTAL_VIEW_ANGLE[];
309*4d7e907cSAndroid Build Coastguard Worker     // Vertical angle of view in degrees.
310*4d7e907cSAndroid Build Coastguard Worker     // Example value: "42.5". Read only.
311*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_VERTICAL_VIEW_ANGLE[];
312*4d7e907cSAndroid Build Coastguard Worker     // Exposure compensation index. 0 means exposure is not adjusted.
313*4d7e907cSAndroid Build Coastguard Worker     // Example value: "-5" or "5". Read/write.
314*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_EXPOSURE_COMPENSATION[];
315*4d7e907cSAndroid Build Coastguard Worker     // The maximum exposure compensation index (>=0).
316*4d7e907cSAndroid Build Coastguard Worker     // Example value: "6". Read only.
317*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_MAX_EXPOSURE_COMPENSATION[];
318*4d7e907cSAndroid Build Coastguard Worker     // The minimum exposure compensation index (<=0).
319*4d7e907cSAndroid Build Coastguard Worker     // Example value: "-6". Read only.
320*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_MIN_EXPOSURE_COMPENSATION[];
321*4d7e907cSAndroid Build Coastguard Worker     // The exposure compensation step. Exposure compensation index multiply by
322*4d7e907cSAndroid Build Coastguard Worker     // step eqals to EV. Ex: if exposure compensation index is -6 and step is
323*4d7e907cSAndroid Build Coastguard Worker     // 0.3333, EV is -2.
324*4d7e907cSAndroid Build Coastguard Worker     // Example value: "0.333333333" or "0.5". Read only.
325*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_EXPOSURE_COMPENSATION_STEP[];
326*4d7e907cSAndroid Build Coastguard Worker     // The state of the auto-exposure lock. "true" means that
327*4d7e907cSAndroid Build Coastguard Worker     // auto-exposure is locked to its current value and will not
328*4d7e907cSAndroid Build Coastguard Worker     // change. "false" means the auto-exposure routine is free to
329*4d7e907cSAndroid Build Coastguard Worker     // change exposure values. If auto-exposure is already locked,
330*4d7e907cSAndroid Build Coastguard Worker     // setting this to true again has no effect (the driver will not
331*4d7e907cSAndroid Build Coastguard Worker     // recalculate exposure values). Changing exposure compensation
332*4d7e907cSAndroid Build Coastguard Worker     // settings will still affect the exposure settings while
333*4d7e907cSAndroid Build Coastguard Worker     // auto-exposure is locked. Stopping preview or taking a still
334*4d7e907cSAndroid Build Coastguard Worker     // image will not change the lock. In conjunction with
335*4d7e907cSAndroid Build Coastguard Worker     // exposure compensation, this allows for capturing multi-exposure
336*4d7e907cSAndroid Build Coastguard Worker     // brackets with known relative exposure values. Locking
337*4d7e907cSAndroid Build Coastguard Worker     // auto-exposure after open but before the first call to
338*4d7e907cSAndroid Build Coastguard Worker     // startPreview may result in severely over- or under-exposed
339*4d7e907cSAndroid Build Coastguard Worker     // images.  The driver will not change the AE lock after
340*4d7e907cSAndroid Build Coastguard Worker     // auto-focus completes.
341*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_AUTO_EXPOSURE_LOCK[];
342*4d7e907cSAndroid Build Coastguard Worker     // Whether locking the auto-exposure is supported. "true" means it is, and
343*4d7e907cSAndroid Build Coastguard Worker     // "false" or this key not existing means it is not supported.
344*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_AUTO_EXPOSURE_LOCK_SUPPORTED[];
345*4d7e907cSAndroid Build Coastguard Worker     // The state of the auto-white balance lock. "true" means that
346*4d7e907cSAndroid Build Coastguard Worker     // auto-white balance is locked to its current value and will not
347*4d7e907cSAndroid Build Coastguard Worker     // change. "false" means the auto-white balance routine is free to
348*4d7e907cSAndroid Build Coastguard Worker     // change white balance values. If auto-white balance is already
349*4d7e907cSAndroid Build Coastguard Worker     // locked, setting this to true again has no effect (the driver
350*4d7e907cSAndroid Build Coastguard Worker     // will not recalculate white balance values). Stopping preview or
351*4d7e907cSAndroid Build Coastguard Worker     // taking a still image will not change the lock. In conjunction
352*4d7e907cSAndroid Build Coastguard Worker     // with exposure compensation, this allows for capturing
353*4d7e907cSAndroid Build Coastguard Worker     // multi-exposure brackets with fixed white balance. Locking
354*4d7e907cSAndroid Build Coastguard Worker     // auto-white balance after open but before the first call to
355*4d7e907cSAndroid Build Coastguard Worker     // startPreview may result in severely incorrect color.  The
356*4d7e907cSAndroid Build Coastguard Worker     // driver will not change the AWB lock after auto-focus
357*4d7e907cSAndroid Build Coastguard Worker     // completes.
358*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_AUTO_WHITEBALANCE_LOCK[];
359*4d7e907cSAndroid Build Coastguard Worker     // Whether locking the auto-white balance is supported. "true"
360*4d7e907cSAndroid Build Coastguard Worker     // means it is, and "false" or this key not existing means it is
361*4d7e907cSAndroid Build Coastguard Worker     // not supported.
362*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_AUTO_WHITEBALANCE_LOCK_SUPPORTED[];
363*4d7e907cSAndroid Build Coastguard Worker 
364*4d7e907cSAndroid Build Coastguard Worker     // The maximum number of metering areas supported. This is the maximum
365*4d7e907cSAndroid Build Coastguard Worker     // length of KEY_METERING_AREAS.
366*4d7e907cSAndroid Build Coastguard Worker     // Example value: "0" or "2". Read only.
367*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_MAX_NUM_METERING_AREAS[];
368*4d7e907cSAndroid Build Coastguard Worker     // Current metering areas. Camera driver uses these areas to decide
369*4d7e907cSAndroid Build Coastguard Worker     // exposure.
370*4d7e907cSAndroid Build Coastguard Worker     //
371*4d7e907cSAndroid Build Coastguard Worker     // Before accessing this parameter, apps should check
372*4d7e907cSAndroid Build Coastguard Worker     // KEY_MAX_NUM_METERING_AREAS first to know the maximum number of metering
373*4d7e907cSAndroid Build Coastguard Worker     // areas first. If the value is 0, metering area is not supported.
374*4d7e907cSAndroid Build Coastguard Worker     //
375*4d7e907cSAndroid Build Coastguard Worker     // Each metering area is a rectangle with specified weight. The direction is
376*4d7e907cSAndroid Build Coastguard Worker     // relative to the sensor orientation, that is, what the sensor sees. The
377*4d7e907cSAndroid Build Coastguard Worker     // direction is not affected by the rotation or mirroring of
378*4d7e907cSAndroid Build Coastguard Worker     // CAMERA_CMD_SET_DISPLAY_ORIENTATION. Coordinates of the rectangle range
379*4d7e907cSAndroid Build Coastguard Worker     // from -1000 to 1000. (-1000, -1000) is the upper left point. (1000, 1000)
380*4d7e907cSAndroid Build Coastguard Worker     // is the lower right point. The width and height of metering areas cannot
381*4d7e907cSAndroid Build Coastguard Worker     // be 0 or negative.
382*4d7e907cSAndroid Build Coastguard Worker     //
383*4d7e907cSAndroid Build Coastguard Worker     // The fifth element is the weight. Values for weight must range from 1 to
384*4d7e907cSAndroid Build Coastguard Worker     // 1000.  The weight should be interpreted as a per-pixel weight - all
385*4d7e907cSAndroid Build Coastguard Worker     // pixels in the area have the specified weight. This means a small area
386*4d7e907cSAndroid Build Coastguard Worker     // with the same weight as a larger area will have less influence on the
387*4d7e907cSAndroid Build Coastguard Worker     // metering than the larger area. Metering areas can partially overlap and
388*4d7e907cSAndroid Build Coastguard Worker     // the driver will add the weights in the overlap region.
389*4d7e907cSAndroid Build Coastguard Worker     //
390*4d7e907cSAndroid Build Coastguard Worker     // A special case of all-zero single metering area means driver to decide
391*4d7e907cSAndroid Build Coastguard Worker     // the metering area. For example, the driver may use more signals to decide
392*4d7e907cSAndroid Build Coastguard Worker     // metering areas and change them dynamically. Apps can set all-zero if they
393*4d7e907cSAndroid Build Coastguard Worker     // want the driver to decide metering areas.
394*4d7e907cSAndroid Build Coastguard Worker     //
395*4d7e907cSAndroid Build Coastguard Worker     // Metering areas are relative to the current field of view (KEY_ZOOM).
396*4d7e907cSAndroid Build Coastguard Worker     // No matter what the zoom level is, (-1000,-1000) represents the top of the
397*4d7e907cSAndroid Build Coastguard Worker     // currently visible camera frame. The metering area cannot be set to be
398*4d7e907cSAndroid Build Coastguard Worker     // outside the current field of view, even when using zoom.
399*4d7e907cSAndroid Build Coastguard Worker     //
400*4d7e907cSAndroid Build Coastguard Worker     // No matter what metering areas are, the final exposure are compensated
401*4d7e907cSAndroid Build Coastguard Worker     // by KEY_EXPOSURE_COMPENSATION.
402*4d7e907cSAndroid Build Coastguard Worker     // Example value: "(-10,-10,0,0,300),(0,0,10,10,700)". Read/write.
403*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_METERING_AREAS[];
404*4d7e907cSAndroid Build Coastguard Worker     // Current zoom value.
405*4d7e907cSAndroid Build Coastguard Worker     // Example value: "0" or "6". Read/write.
406*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_ZOOM[];
407*4d7e907cSAndroid Build Coastguard Worker     // Maximum zoom value.
408*4d7e907cSAndroid Build Coastguard Worker     // Example value: "6". Read only.
409*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_MAX_ZOOM[];
410*4d7e907cSAndroid Build Coastguard Worker     // The zoom ratios of all zoom values. The zoom ratio is in 1/100
411*4d7e907cSAndroid Build Coastguard Worker     // increments. Ex: a zoom of 3.2x is returned as 320. The number of list
412*4d7e907cSAndroid Build Coastguard Worker     // elements is KEY_MAX_ZOOM + 1. The first element is always 100. The last
413*4d7e907cSAndroid Build Coastguard Worker     // element is the zoom ratio of zoom value KEY_MAX_ZOOM.
414*4d7e907cSAndroid Build Coastguard Worker     // Example value: "100,150,200,250,300,350,400". Read only.
415*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_ZOOM_RATIOS[];
416*4d7e907cSAndroid Build Coastguard Worker     // Whether zoom is supported. Zoom is supported if the value is "true". Zoom
417*4d7e907cSAndroid Build Coastguard Worker     // is not supported if the value is not "true" or the key does not exist.
418*4d7e907cSAndroid Build Coastguard Worker     // Example value: "true". Read only.
419*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_ZOOM_SUPPORTED[];
420*4d7e907cSAndroid Build Coastguard Worker     // Whether if smooth zoom is supported. Smooth zoom is supported if the
421*4d7e907cSAndroid Build Coastguard Worker     // value is "true". It is not supported if the value is not "true" or the
422*4d7e907cSAndroid Build Coastguard Worker     // key does not exist.
423*4d7e907cSAndroid Build Coastguard Worker     // See CAMERA_CMD_START_SMOOTH_ZOOM, CAMERA_CMD_STOP_SMOOTH_ZOOM, and
424*4d7e907cSAndroid Build Coastguard Worker     // CAMERA_MSG_ZOOM in frameworks/base/include/camera/Camera.h.
425*4d7e907cSAndroid Build Coastguard Worker     // Example value: "true". Read only.
426*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SMOOTH_ZOOM_SUPPORTED[];
427*4d7e907cSAndroid Build Coastguard Worker 
428*4d7e907cSAndroid Build Coastguard Worker     // The distances (in meters) from the camera to where an object appears to
429*4d7e907cSAndroid Build Coastguard Worker     // be in focus. The object is sharpest at the optimal focus distance. The
430*4d7e907cSAndroid Build Coastguard Worker     // depth of field is the far focus distance minus near focus distance.
431*4d7e907cSAndroid Build Coastguard Worker     //
432*4d7e907cSAndroid Build Coastguard Worker     // Focus distances may change after starting auto focus, canceling auto
433*4d7e907cSAndroid Build Coastguard Worker     // focus, or starting the preview. Applications can read this anytime to get
434*4d7e907cSAndroid Build Coastguard Worker     // the latest focus distances. If the focus mode is FOCUS_MODE_CONTINUOUS,
435*4d7e907cSAndroid Build Coastguard Worker     // focus distances may change from time to time.
436*4d7e907cSAndroid Build Coastguard Worker     //
437*4d7e907cSAndroid Build Coastguard Worker     // This is intended to estimate the distance between the camera and the
438*4d7e907cSAndroid Build Coastguard Worker     // subject. After autofocus, the subject distance may be within near and far
439*4d7e907cSAndroid Build Coastguard Worker     // focus distance. However, the precision depends on the camera hardware,
440*4d7e907cSAndroid Build Coastguard Worker     // autofocus algorithm, the focus area, and the scene. The error can be
441*4d7e907cSAndroid Build Coastguard Worker     // large and it should be only used as a reference.
442*4d7e907cSAndroid Build Coastguard Worker     //
443*4d7e907cSAndroid Build Coastguard Worker     // Far focus distance > optimal focus distance > near focus distance. If
444*4d7e907cSAndroid Build Coastguard Worker     // the far focus distance is infinity, the value should be "Infinity" (case
445*4d7e907cSAndroid Build Coastguard Worker     // sensitive). The format is three float values separated by commas. The
446*4d7e907cSAndroid Build Coastguard Worker     // first is near focus distance. The second is optimal focus distance. The
447*4d7e907cSAndroid Build Coastguard Worker     // third is far focus distance.
448*4d7e907cSAndroid Build Coastguard Worker     // Example value: "0.95,1.9,Infinity" or "0.049,0.05,0.051". Read only.
449*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_FOCUS_DISTANCES[];
450*4d7e907cSAndroid Build Coastguard Worker 
451*4d7e907cSAndroid Build Coastguard Worker     // The current dimensions in pixels (width x height) for video frames.
452*4d7e907cSAndroid Build Coastguard Worker     // The width and height must be one of the supported sizes retrieved
453*4d7e907cSAndroid Build Coastguard Worker     // via KEY_SUPPORTED_VIDEO_SIZES.
454*4d7e907cSAndroid Build Coastguard Worker     // Example value: "1280x720". Read/write.
455*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_VIDEO_SIZE[];
456*4d7e907cSAndroid Build Coastguard Worker     // A list of the supported dimensions in pixels (width x height)
457*4d7e907cSAndroid Build Coastguard Worker     // for video frames. See CAMERA_MSG_VIDEO_FRAME for details in
458*4d7e907cSAndroid Build Coastguard Worker     // frameworks/base/include/camera/Camera.h.
459*4d7e907cSAndroid Build Coastguard Worker     // Example: "176x144,1280x720". Read only.
460*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_SUPPORTED_VIDEO_SIZES[];
461*4d7e907cSAndroid Build Coastguard Worker 
462*4d7e907cSAndroid Build Coastguard Worker     // The maximum number of detected faces supported by hardware face
463*4d7e907cSAndroid Build Coastguard Worker     // detection. If the value is 0, hardware face detection is not supported.
464*4d7e907cSAndroid Build Coastguard Worker     // Example: "5". Read only
465*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_MAX_NUM_DETECTED_FACES_HW[];
466*4d7e907cSAndroid Build Coastguard Worker 
467*4d7e907cSAndroid Build Coastguard Worker     // The maximum number of detected faces supported by software face
468*4d7e907cSAndroid Build Coastguard Worker     // detection. If the value is 0, software face detection is not supported.
469*4d7e907cSAndroid Build Coastguard Worker     // Example: "5". Read only
470*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_MAX_NUM_DETECTED_FACES_SW[];
471*4d7e907cSAndroid Build Coastguard Worker 
472*4d7e907cSAndroid Build Coastguard Worker     // Preferred preview frame size in pixels for video recording.
473*4d7e907cSAndroid Build Coastguard Worker     // The width and height must be one of the supported sizes retrieved
474*4d7e907cSAndroid Build Coastguard Worker     // via KEY_SUPPORTED_PREVIEW_SIZES. This key can be used only when
475*4d7e907cSAndroid Build Coastguard Worker     // getSupportedVideoSizes() does not return an empty Vector of Size.
476*4d7e907cSAndroid Build Coastguard Worker     // Camcorder applications are recommended to set the preview size
477*4d7e907cSAndroid Build Coastguard Worker     // to a value that is not larger than the preferred preview size.
478*4d7e907cSAndroid Build Coastguard Worker     // In other words, the product of the width and height of the
479*4d7e907cSAndroid Build Coastguard Worker     // preview size should not be larger than that of the preferred
480*4d7e907cSAndroid Build Coastguard Worker     // preview size. In addition, we recommend to choos a preview size
481*4d7e907cSAndroid Build Coastguard Worker     // that has the same aspect ratio as the resolution of video to be
482*4d7e907cSAndroid Build Coastguard Worker     // recorded.
483*4d7e907cSAndroid Build Coastguard Worker     // Example value: "800x600". Read only.
484*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO[];
485*4d7e907cSAndroid Build Coastguard Worker 
486*4d7e907cSAndroid Build Coastguard Worker     // The image format for video frames. See CAMERA_MSG_VIDEO_FRAME in
487*4d7e907cSAndroid Build Coastguard Worker     // frameworks/base/include/camera/Camera.h.
488*4d7e907cSAndroid Build Coastguard Worker     // Example value: "yuv420sp" or PIXEL_FORMAT_XXX constants. Read only.
489*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_VIDEO_FRAME_FORMAT[];
490*4d7e907cSAndroid Build Coastguard Worker 
491*4d7e907cSAndroid Build Coastguard Worker     // Sets the hint of the recording mode. If this is true, MediaRecorder.start
492*4d7e907cSAndroid Build Coastguard Worker     // may be faster or has less glitches. This should be called before starting
493*4d7e907cSAndroid Build Coastguard Worker     // the preview for the best result. But it is allowed to change the hint
494*4d7e907cSAndroid Build Coastguard Worker     // while the preview is active. The default value is false.
495*4d7e907cSAndroid Build Coastguard Worker     //
496*4d7e907cSAndroid Build Coastguard Worker     // The apps can still call Camera.takePicture when the hint is true. The
497*4d7e907cSAndroid Build Coastguard Worker     // apps can call MediaRecorder.start when the hint is false. But the
498*4d7e907cSAndroid Build Coastguard Worker     // performance may be worse.
499*4d7e907cSAndroid Build Coastguard Worker     // Example value: "true" or "false". Read/write.
500*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_RECORDING_HINT[];
501*4d7e907cSAndroid Build Coastguard Worker 
502*4d7e907cSAndroid Build Coastguard Worker     // Returns true if video snapshot is supported. That is, applications
503*4d7e907cSAndroid Build Coastguard Worker     // can call Camera.takePicture during recording. Applications do not need to
504*4d7e907cSAndroid Build Coastguard Worker     // call Camera.startPreview after taking a picture. The preview will be
505*4d7e907cSAndroid Build Coastguard Worker     // still active. Other than that, taking a picture during recording is
506*4d7e907cSAndroid Build Coastguard Worker     // identical to taking a picture normally. All settings and methods related
507*4d7e907cSAndroid Build Coastguard Worker     // to takePicture work identically. Ex: KEY_PICTURE_SIZE,
508*4d7e907cSAndroid Build Coastguard Worker     // KEY_SUPPORTED_PICTURE_SIZES, KEY_JPEG_QUALITY, KEY_ROTATION, and etc.
509*4d7e907cSAndroid Build Coastguard Worker     // The picture will have an EXIF header. FLASH_MODE_AUTO and FLASH_MODE_ON
510*4d7e907cSAndroid Build Coastguard Worker     // also still work, but the video will record the flash.
511*4d7e907cSAndroid Build Coastguard Worker     //
512*4d7e907cSAndroid Build Coastguard Worker     // Applications can set shutter callback as null to avoid the shutter
513*4d7e907cSAndroid Build Coastguard Worker     // sound. It is also recommended to set raw picture and post view callbacks
514*4d7e907cSAndroid Build Coastguard Worker     // to null to avoid the interrupt of preview display.
515*4d7e907cSAndroid Build Coastguard Worker     //
516*4d7e907cSAndroid Build Coastguard Worker     // Field-of-view of the recorded video may be different from that of the
517*4d7e907cSAndroid Build Coastguard Worker     // captured pictures.
518*4d7e907cSAndroid Build Coastguard Worker     // Example value: "true" or "false". Read only.
519*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_VIDEO_SNAPSHOT_SUPPORTED[];
520*4d7e907cSAndroid Build Coastguard Worker 
521*4d7e907cSAndroid Build Coastguard Worker     // The state of the video stabilization. If set to true, both the
522*4d7e907cSAndroid Build Coastguard Worker     // preview stream and the recorded video stream are stabilized by
523*4d7e907cSAndroid Build Coastguard Worker     // the camera. Only valid to set if KEY_VIDEO_STABILIZATION_SUPPORTED is
524*4d7e907cSAndroid Build Coastguard Worker     // set to true.
525*4d7e907cSAndroid Build Coastguard Worker     //
526*4d7e907cSAndroid Build Coastguard Worker     // The value of this key can be changed any time the camera is
527*4d7e907cSAndroid Build Coastguard Worker     // open. If preview or recording is active, it is acceptable for
528*4d7e907cSAndroid Build Coastguard Worker     // there to be a slight video glitch when video stabilization is
529*4d7e907cSAndroid Build Coastguard Worker     // toggled on and off.
530*4d7e907cSAndroid Build Coastguard Worker     //
531*4d7e907cSAndroid Build Coastguard Worker     // This only stabilizes video streams (between-frames stabilization), and
532*4d7e907cSAndroid Build Coastguard Worker     // has no effect on still image capture.
533*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_VIDEO_STABILIZATION[];
534*4d7e907cSAndroid Build Coastguard Worker 
535*4d7e907cSAndroid Build Coastguard Worker     // Returns true if video stabilization is supported. That is, applications
536*4d7e907cSAndroid Build Coastguard Worker     // can set KEY_VIDEO_STABILIZATION to true and have a stabilized preview
537*4d7e907cSAndroid Build Coastguard Worker     // stream and record stabilized videos.
538*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_VIDEO_STABILIZATION_SUPPORTED[];
539*4d7e907cSAndroid Build Coastguard Worker 
540*4d7e907cSAndroid Build Coastguard Worker     // Supported modes for special effects with light.
541*4d7e907cSAndroid Build Coastguard Worker     // Example values: "lowlight,hdr".
542*4d7e907cSAndroid Build Coastguard Worker     static const char KEY_LIGHTFX[];
543*4d7e907cSAndroid Build Coastguard Worker 
544*4d7e907cSAndroid Build Coastguard Worker     // Value for KEY_ZOOM_SUPPORTED or KEY_SMOOTH_ZOOM_SUPPORTED.
545*4d7e907cSAndroid Build Coastguard Worker     static const char TRUE[];
546*4d7e907cSAndroid Build Coastguard Worker     static const char FALSE[];
547*4d7e907cSAndroid Build Coastguard Worker 
548*4d7e907cSAndroid Build Coastguard Worker     // Value for KEY_FOCUS_DISTANCES.
549*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_DISTANCE_INFINITY[];
550*4d7e907cSAndroid Build Coastguard Worker 
551*4d7e907cSAndroid Build Coastguard Worker     // Values for white balance settings.
552*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_AUTO[];
553*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_INCANDESCENT[];
554*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_FLUORESCENT[];
555*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_WARM_FLUORESCENT[];
556*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_DAYLIGHT[];
557*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_CLOUDY_DAYLIGHT[];
558*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_TWILIGHT[];
559*4d7e907cSAndroid Build Coastguard Worker     static const char WHITE_BALANCE_SHADE[];
560*4d7e907cSAndroid Build Coastguard Worker 
561*4d7e907cSAndroid Build Coastguard Worker     // Values for effect settings.
562*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_NONE[];
563*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_MONO[];
564*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_NEGATIVE[];
565*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_SOLARIZE[];
566*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_SEPIA[];
567*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_POSTERIZE[];
568*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_WHITEBOARD[];
569*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_BLACKBOARD[];
570*4d7e907cSAndroid Build Coastguard Worker     static const char EFFECT_AQUA[];
571*4d7e907cSAndroid Build Coastguard Worker 
572*4d7e907cSAndroid Build Coastguard Worker     // Values for antibanding settings.
573*4d7e907cSAndroid Build Coastguard Worker     static const char ANTIBANDING_AUTO[];
574*4d7e907cSAndroid Build Coastguard Worker     static const char ANTIBANDING_50HZ[];
575*4d7e907cSAndroid Build Coastguard Worker     static const char ANTIBANDING_60HZ[];
576*4d7e907cSAndroid Build Coastguard Worker     static const char ANTIBANDING_OFF[];
577*4d7e907cSAndroid Build Coastguard Worker 
578*4d7e907cSAndroid Build Coastguard Worker     // Values for flash mode settings.
579*4d7e907cSAndroid Build Coastguard Worker     // Flash will not be fired.
580*4d7e907cSAndroid Build Coastguard Worker     static const char FLASH_MODE_OFF[];
581*4d7e907cSAndroid Build Coastguard Worker     // Flash will be fired automatically when required. The flash may be fired
582*4d7e907cSAndroid Build Coastguard Worker     // during preview, auto-focus, or snapshot depending on the driver.
583*4d7e907cSAndroid Build Coastguard Worker     static const char FLASH_MODE_AUTO[];
584*4d7e907cSAndroid Build Coastguard Worker     // Flash will always be fired during snapshot. The flash may also be
585*4d7e907cSAndroid Build Coastguard Worker     // fired during preview or auto-focus depending on the driver.
586*4d7e907cSAndroid Build Coastguard Worker     static const char FLASH_MODE_ON[];
587*4d7e907cSAndroid Build Coastguard Worker     // Flash will be fired in red-eye reduction mode.
588*4d7e907cSAndroid Build Coastguard Worker     static const char FLASH_MODE_RED_EYE[];
589*4d7e907cSAndroid Build Coastguard Worker     // Constant emission of light during preview, auto-focus and snapshot.
590*4d7e907cSAndroid Build Coastguard Worker     // This can also be used for video recording.
591*4d7e907cSAndroid Build Coastguard Worker     static const char FLASH_MODE_TORCH[];
592*4d7e907cSAndroid Build Coastguard Worker 
593*4d7e907cSAndroid Build Coastguard Worker     // Values for scene mode settings.
594*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_AUTO[];
595*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_ACTION[];
596*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_PORTRAIT[];
597*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_LANDSCAPE[];
598*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_NIGHT[];
599*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_NIGHT_PORTRAIT[];
600*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_THEATRE[];
601*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_BEACH[];
602*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_SNOW[];
603*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_SUNSET[];
604*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_STEADYPHOTO[];
605*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_FIREWORKS[];
606*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_SPORTS[];
607*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_PARTY[];
608*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_CANDLELIGHT[];
609*4d7e907cSAndroid Build Coastguard Worker     // Applications are looking for a barcode. Camera driver will be optimized
610*4d7e907cSAndroid Build Coastguard Worker     // for barcode reading.
611*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_BARCODE[];
612*4d7e907cSAndroid Build Coastguard Worker     // A high-dynamic range mode. In this mode, the HAL module will use a
613*4d7e907cSAndroid Build Coastguard Worker     // capture strategy that extends the dynamic range of the captured
614*4d7e907cSAndroid Build Coastguard Worker     // image in some fashion. Only the final image is returned.
615*4d7e907cSAndroid Build Coastguard Worker     static const char SCENE_MODE_HDR[];
616*4d7e907cSAndroid Build Coastguard Worker 
617*4d7e907cSAndroid Build Coastguard Worker     // Pixel color formats for KEY_PREVIEW_FORMAT, KEY_PICTURE_FORMAT,
618*4d7e907cSAndroid Build Coastguard Worker     // and KEY_VIDEO_FRAME_FORMAT
619*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_YUV422SP[];
620*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_YUV420SP[];  // NV21
621*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_YUV422I[];   // YUY2
622*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_YUV420P[];   // YV12
623*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_RGB565[];
624*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_RGBA8888[];
625*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_JPEG[];
626*4d7e907cSAndroid Build Coastguard Worker     // Raw bayer format used for images, which is 10 bit precision samples
627*4d7e907cSAndroid Build Coastguard Worker     // stored in 16 bit words. The filter pattern is RGGB.
628*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_BAYER_RGGB[];
629*4d7e907cSAndroid Build Coastguard Worker     // Pixel format is not known to the framework
630*4d7e907cSAndroid Build Coastguard Worker     static const char PIXEL_FORMAT_ANDROID_OPAQUE[];
631*4d7e907cSAndroid Build Coastguard Worker 
632*4d7e907cSAndroid Build Coastguard Worker     // Values for focus mode settings.
633*4d7e907cSAndroid Build Coastguard Worker     // Auto-focus mode. Applications should call
634*4d7e907cSAndroid Build Coastguard Worker     // CameraHardwareInterface.autoFocus to start the focus in this mode.
635*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_MODE_AUTO[];
636*4d7e907cSAndroid Build Coastguard Worker     // Focus is set at infinity. Applications should not call
637*4d7e907cSAndroid Build Coastguard Worker     // CameraHardwareInterface.autoFocus in this mode.
638*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_MODE_INFINITY[];
639*4d7e907cSAndroid Build Coastguard Worker     // Macro (close-up) focus mode. Applications should call
640*4d7e907cSAndroid Build Coastguard Worker     // CameraHardwareInterface.autoFocus to start the focus in this mode.
641*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_MODE_MACRO[];
642*4d7e907cSAndroid Build Coastguard Worker     // Focus is fixed. The camera is always in this mode if the focus is not
643*4d7e907cSAndroid Build Coastguard Worker     // adjustable. If the camera has auto-focus, this mode can fix the
644*4d7e907cSAndroid Build Coastguard Worker     // focus, which is usually at hyperfocal distance. Applications should
645*4d7e907cSAndroid Build Coastguard Worker     // not call CameraHardwareInterface.autoFocus in this mode.
646*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_MODE_FIXED[];
647*4d7e907cSAndroid Build Coastguard Worker     // Extended depth of field (EDOF). Focusing is done digitally and
648*4d7e907cSAndroid Build Coastguard Worker     // continuously. Applications should not call
649*4d7e907cSAndroid Build Coastguard Worker     // CameraHardwareInterface.autoFocus in this mode.
650*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_MODE_EDOF[];
651*4d7e907cSAndroid Build Coastguard Worker     // Continuous auto focus mode intended for video recording. The camera
652*4d7e907cSAndroid Build Coastguard Worker     // continuously tries to focus. This is the best choice for video
653*4d7e907cSAndroid Build Coastguard Worker     // recording because the focus changes smoothly . Applications still can
654*4d7e907cSAndroid Build Coastguard Worker     // call CameraHardwareInterface.takePicture in this mode but the subject may
655*4d7e907cSAndroid Build Coastguard Worker     // not be in focus. Auto focus starts when the parameter is set.
656*4d7e907cSAndroid Build Coastguard Worker     //
657*4d7e907cSAndroid Build Coastguard Worker     // Applications can call CameraHardwareInterface.autoFocus in this mode. The
658*4d7e907cSAndroid Build Coastguard Worker     // focus callback will immediately return with a boolean that indicates
659*4d7e907cSAndroid Build Coastguard Worker     // whether the focus is sharp or not. The focus position is locked after
660*4d7e907cSAndroid Build Coastguard Worker     // autoFocus call. If applications want to resume the continuous focus,
661*4d7e907cSAndroid Build Coastguard Worker     // cancelAutoFocus must be called. Restarting the preview will not resume
662*4d7e907cSAndroid Build Coastguard Worker     // the continuous autofocus. To stop continuous focus, applications should
663*4d7e907cSAndroid Build Coastguard Worker     // change the focus mode to other modes.
664*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_MODE_CONTINUOUS_VIDEO[];
665*4d7e907cSAndroid Build Coastguard Worker     // Continuous auto focus mode intended for taking pictures. The camera
666*4d7e907cSAndroid Build Coastguard Worker     // continuously tries to focus. The speed of focus change is more aggressive
667*4d7e907cSAndroid Build Coastguard Worker     // than FOCUS_MODE_CONTINUOUS_VIDEO. Auto focus starts when the parameter is
668*4d7e907cSAndroid Build Coastguard Worker     // set.
669*4d7e907cSAndroid Build Coastguard Worker     //
670*4d7e907cSAndroid Build Coastguard Worker     // Applications can call CameraHardwareInterface.autoFocus in this mode. If
671*4d7e907cSAndroid Build Coastguard Worker     // the autofocus is in the middle of scanning, the focus callback will
672*4d7e907cSAndroid Build Coastguard Worker     // return when it completes. If the autofocus is not scanning, focus
673*4d7e907cSAndroid Build Coastguard Worker     // callback will immediately return with a boolean that indicates whether
674*4d7e907cSAndroid Build Coastguard Worker     // the focus is sharp or not. The apps can then decide if they want to take
675*4d7e907cSAndroid Build Coastguard Worker     // a picture immediately or to change the focus mode to auto, and run a full
676*4d7e907cSAndroid Build Coastguard Worker     // autofocus cycle. The focus position is locked after autoFocus call. If
677*4d7e907cSAndroid Build Coastguard Worker     // applications want to resume the continuous focus, cancelAutoFocus must be
678*4d7e907cSAndroid Build Coastguard Worker     // called. Restarting the preview will not resume the continuous autofocus.
679*4d7e907cSAndroid Build Coastguard Worker     // To stop continuous focus, applications should change the focus mode to
680*4d7e907cSAndroid Build Coastguard Worker     // other modes.
681*4d7e907cSAndroid Build Coastguard Worker     static const char FOCUS_MODE_CONTINUOUS_PICTURE[];
682*4d7e907cSAndroid Build Coastguard Worker 
683*4d7e907cSAndroid Build Coastguard Worker     // Values for light special effects
684*4d7e907cSAndroid Build Coastguard Worker     // Low-light enhancement mode
685*4d7e907cSAndroid Build Coastguard Worker     static const char LIGHTFX_LOWLIGHT[];
686*4d7e907cSAndroid Build Coastguard Worker     // High-dynamic range mode
687*4d7e907cSAndroid Build Coastguard Worker     static const char LIGHTFX_HDR[];
688*4d7e907cSAndroid Build Coastguard Worker 
689*4d7e907cSAndroid Build Coastguard Worker     /**
690*4d7e907cSAndroid Build Coastguard Worker      * Returns the the supported preview formats as an enum given in graphics.h
691*4d7e907cSAndroid Build Coastguard Worker      * corrsponding to the format given in the input string or -1 if no such
692*4d7e907cSAndroid Build Coastguard Worker      * conversion exists.
693*4d7e907cSAndroid Build Coastguard Worker      */
694*4d7e907cSAndroid Build Coastguard Worker     static int previewFormatToEnum(const char* format);
695*4d7e907cSAndroid Build Coastguard Worker 
696*4d7e907cSAndroid Build Coastguard Worker   private:
697*4d7e907cSAndroid Build Coastguard Worker     DefaultKeyedVector<String8, String8> mMap;
698*4d7e907cSAndroid Build Coastguard Worker };
699*4d7e907cSAndroid Build Coastguard Worker 
700*4d7e907cSAndroid Build Coastguard Worker };  // namespace helper
701*4d7e907cSAndroid Build Coastguard Worker 
702*4d7e907cSAndroid Build Coastguard Worker // NOTE: Deprecated namespace. This namespace should no longer be used for the following symbols
703*4d7e907cSAndroid Build Coastguard Worker namespace V1_0::helper {
704*4d7e907cSAndroid Build Coastguard Worker // Export symbols to the old namespace to preserve compatibility
705*4d7e907cSAndroid Build Coastguard Worker typedef android::hardware::camera::common::helper::CameraParameters CameraParameters;
706*4d7e907cSAndroid Build Coastguard Worker typedef android::hardware::camera::common::helper::Size Size;
707*4d7e907cSAndroid Build Coastguard Worker }  // namespace V1_0::helper
708*4d7e907cSAndroid Build Coastguard Worker 
709*4d7e907cSAndroid Build Coastguard Worker };  // namespace common
710*4d7e907cSAndroid Build Coastguard Worker };  // namespace camera
711*4d7e907cSAndroid Build Coastguard Worker };  // namespace hardware
712*4d7e907cSAndroid Build Coastguard Worker };  // namespace android
713*4d7e907cSAndroid Build Coastguard Worker 
714*4d7e907cSAndroid Build Coastguard Worker #endif
715