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