CameraMetadata.java revision 265b34ce331cbe296f82ca357645312718c8d4c7
1/* 2 * Copyright (C) 2013 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 17package android.hardware.camera2; 18 19import android.hardware.camera2.impl.CameraMetadataNative; 20 21import java.lang.reflect.Field; 22import java.lang.reflect.Modifier; 23import java.util.ArrayList; 24import java.util.Collections; 25import java.util.List; 26 27/** 28 * The base class for camera controls and information. 29 * 30 * <p> 31 * This class defines the basic key/value map used for querying for camera 32 * characteristics or capture results, and for setting camera request 33 * parameters. 34 * </p> 35 * 36 * <p> 37 * All instances of CameraMetadata are immutable. The list of keys with {@link #getKeys()} 38 * never changes, nor do the values returned by any key with {@link #get} throughout 39 * the lifetime of the object. 40 * </p> 41 * 42 * @see CameraDevice 43 * @see CameraManager 44 * @see CameraCharacteristics 45 **/ 46public abstract class CameraMetadata { 47 48 /** 49 * Set a camera metadata field to a value. The field definitions can be 50 * found in {@link CameraCharacteristics}, {@link CaptureResult}, and 51 * {@link CaptureRequest}. 52 * 53 * @param key The metadata field to write. 54 * @param value The value to set the field to, which must be of a matching 55 * type to the key. 56 * 57 * @hide 58 */ 59 protected CameraMetadata() { 60 } 61 62 /** 63 * Get a camera metadata field value. 64 * 65 * <p>The field definitions can be 66 * found in {@link CameraCharacteristics}, {@link CaptureResult}, and 67 * {@link CaptureRequest}.</p> 68 * 69 * <p>Querying the value for the same key more than once will return a value 70 * which is equal to the previous queried value.</p> 71 * 72 * @throws IllegalArgumentException if the key was not valid 73 * 74 * @param key The metadata field to read. 75 * @return The value of that key, or {@code null} if the field is not set. 76 */ 77 public abstract <T> T get(Key<T> key); 78 79 /** 80 * Returns a list of the keys contained in this map. 81 * 82 * <p>The list returned is not modifiable, so any attempts to modify it will throw 83 * a {@code UnsupportedOperationException}.</p> 84 * 85 * <p>All values retrieved by a key from this list with {@link #get} are guaranteed to be 86 * non-{@code null}. Each key is only listed once in the list. The order of the keys 87 * is undefined.</p> 88 * 89 * @return List of the keys contained in this map. 90 */ 91 public List<Key<?>> getKeys() { 92 return Collections.unmodifiableList(getKeysStatic(this.getClass(), this)); 93 } 94 95 /** 96 * Return a list of all the Key<?> that are declared as a field inside of the class 97 * {@code type}. 98 * 99 * <p> 100 * Optionally, if {@code instance} is not null, then filter out any keys with null values. 101 * </p> 102 */ 103 /*package*/ static ArrayList<Key<?>> getKeysStatic(Class<? extends CameraMetadata> type, 104 CameraMetadata instance) { 105 ArrayList<Key<?>> keyList = new ArrayList<Key<?>>(); 106 107 Field[] fields = type.getDeclaredFields(); 108 for (Field field : fields) { 109 // Filter for Keys that are public 110 if (field.getType().isAssignableFrom(Key.class) && 111 (field.getModifiers() & Modifier.PUBLIC) != 0) { 112 Key<?> key; 113 try { 114 key = (Key<?>) field.get(instance); 115 } catch (IllegalAccessException e) { 116 throw new AssertionError("Can't get IllegalAccessException", e); 117 } catch (IllegalArgumentException e) { 118 throw new AssertionError("Can't get IllegalArgumentException", e); 119 } 120 if (instance == null || instance.get(key) != null) { 121 keyList.add(key); 122 } 123 } 124 } 125 126 return keyList; 127 } 128 129 public static class Key<T> { 130 131 private boolean mHasTag; 132 private int mTag; 133 private final Class<T> mType; 134 private final String mName; 135 136 /** 137 * @hide 138 */ 139 public Key(String name, Class<T> type) { 140 if (name == null) { 141 throw new NullPointerException("Key needs a valid name"); 142 } else if (type == null) { 143 throw new NullPointerException("Type needs to be non-null"); 144 } 145 mName = name; 146 mType = type; 147 } 148 149 public final String getName() { 150 return mName; 151 } 152 153 @Override 154 public final int hashCode() { 155 return mName.hashCode(); 156 } 157 158 @Override 159 @SuppressWarnings("unchecked") 160 public final boolean equals(Object o) { 161 if (this == o) { 162 return true; 163 } 164 165 if (!(o instanceof Key)) { 166 return false; 167 } 168 169 Key lhs = (Key) o; 170 171 return mName.equals(lhs.mName) && mType.equals(lhs.mType); 172 } 173 174 /** 175 * <p> 176 * Get the tag corresponding to this key. This enables insertion into the 177 * native metadata. 178 * </p> 179 * 180 * <p>This value is looked up the first time, and cached subsequently.</p> 181 * 182 * @return The tag numeric value corresponding to the string 183 * 184 * @hide 185 */ 186 public final int getTag() { 187 if (!mHasTag) { 188 mTag = CameraMetadataNative.getTag(mName); 189 mHasTag = true; 190 } 191 return mTag; 192 } 193 194 /** 195 * @hide 196 */ 197 public final Class<T> getType() { 198 return mType; 199 } 200 } 201 202 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 203 * The enum values below this point are generated from metadata 204 * definitions in /system/media/camera/docs. Do not modify by hand or 205 * modify the comment blocks at the start or end. 206 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ 207 208 // 209 // Enumeration values for CameraCharacteristics#LENS_FACING 210 // 211 212 /** 213 * @see CameraCharacteristics#LENS_FACING 214 */ 215 public static final int LENS_FACING_FRONT = 0; 216 217 /** 218 * @see CameraCharacteristics#LENS_FACING 219 */ 220 public static final int LENS_FACING_BACK = 1; 221 222 // 223 // Enumeration values for CameraCharacteristics#LED_AVAILABLE_LEDS 224 // 225 226 /** 227 * <p>android.led.transmit control is used</p> 228 * @see CameraCharacteristics#LED_AVAILABLE_LEDS 229 * @hide 230 */ 231 public static final int LED_AVAILABLE_LEDS_TRANSMIT = 0; 232 233 // 234 // Enumeration values for CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 235 // 236 237 /** 238 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 239 */ 240 public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0; 241 242 /** 243 * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL 244 */ 245 public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1; 246 247 // 248 // Enumeration values for CaptureRequest#COLOR_CORRECTION_MODE 249 // 250 251 /** 252 * <p>Use the {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} matrix 253 * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} to do color conversion</p> 254 * 255 * @see CaptureRequest#COLOR_CORRECTION_GAINS 256 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 257 * @see CaptureRequest#COLOR_CORRECTION_MODE 258 */ 259 public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0; 260 261 /** 262 * <p>Must not slow down frame rate relative to raw 263 * bayer output</p> 264 * @see CaptureRequest#COLOR_CORRECTION_MODE 265 */ 266 public static final int COLOR_CORRECTION_MODE_FAST = 1; 267 268 /** 269 * <p>Frame rate may be reduced by high 270 * quality</p> 271 * @see CaptureRequest#COLOR_CORRECTION_MODE 272 */ 273 public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2; 274 275 // 276 // Enumeration values for CaptureRequest#CONTROL_AE_ANTIBANDING_MODE 277 // 278 279 /** 280 * <p>The camera device will not adjust exposure duration to 281 * avoid banding problems.</p> 282 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE 283 */ 284 public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0; 285 286 /** 287 * <p>The camera device will adjust exposure duration to 288 * avoid banding problems with 50Hz illumination sources.</p> 289 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE 290 */ 291 public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1; 292 293 /** 294 * <p>The camera device will adjust exposure duration to 295 * avoid banding problems with 60Hz illumination 296 * sources.</p> 297 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE 298 */ 299 public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2; 300 301 /** 302 * <p>The camera device will automatically adapt its 303 * antibanding routine to the current illumination 304 * conditions. This is the default.</p> 305 * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE 306 */ 307 public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3; 308 309 // 310 // Enumeration values for CaptureRequest#CONTROL_AE_MODE 311 // 312 313 /** 314 * <p>The camera device's autoexposure routine is disabled; 315 * the application-selected {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 316 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} and 317 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} are used by the camera 318 * device, along with android.flash.* fields, if there's 319 * a flash unit for this camera device.</p> 320 * 321 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 322 * @see CaptureRequest#SENSOR_FRAME_DURATION 323 * @see CaptureRequest#SENSOR_SENSITIVITY 324 * @see CaptureRequest#CONTROL_AE_MODE 325 */ 326 public static final int CONTROL_AE_MODE_OFF = 0; 327 328 /** 329 * <p>The camera device's autoexposure routine is active, 330 * with no flash control. The application's values for 331 * {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 332 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and 333 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} are ignored. The 334 * application has control over the various 335 * android.flash.* fields.</p> 336 * 337 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 338 * @see CaptureRequest#SENSOR_FRAME_DURATION 339 * @see CaptureRequest#SENSOR_SENSITIVITY 340 * @see CaptureRequest#CONTROL_AE_MODE 341 */ 342 public static final int CONTROL_AE_MODE_ON = 1; 343 344 /** 345 * <p>Like ON, except that the camera device also controls 346 * the camera's flash unit, firing it in low-light 347 * conditions. The flash may be fired during a 348 * precapture sequence (triggered by 349 * {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) and may be fired 350 * for captures for which the 351 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} field is set to 352 * STILL_CAPTURE</p> 353 * 354 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 355 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 356 * @see CaptureRequest#CONTROL_AE_MODE 357 */ 358 public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2; 359 360 /** 361 * <p>Like ON, except that the camera device also controls 362 * the camera's flash unit, always firing it for still 363 * captures. The flash may be fired during a precapture 364 * sequence (triggered by 365 * {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) and will always 366 * be fired for captures for which the 367 * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} field is set to 368 * STILL_CAPTURE</p> 369 * 370 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 371 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 372 * @see CaptureRequest#CONTROL_AE_MODE 373 */ 374 public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3; 375 376 /** 377 * <p>Like ON_AUTO_FLASH, but with automatic red eye 378 * reduction. If deemed necessary by the camera device, 379 * a red eye reduction flash will fire during the 380 * precapture sequence.</p> 381 * @see CaptureRequest#CONTROL_AE_MODE 382 */ 383 public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4; 384 385 // 386 // Enumeration values for CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 387 // 388 389 /** 390 * <p>The trigger is idle.</p> 391 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 392 */ 393 public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0; 394 395 /** 396 * <p>The precapture metering sequence 397 * must be started. The exact effect of the precapture 398 * trigger depends on the current AE mode and 399 * state.</p> 400 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 401 */ 402 public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1; 403 404 // 405 // Enumeration values for CaptureRequest#CONTROL_AF_MODE 406 // 407 408 /** 409 * <p>The auto-focus routine does not control the lens; 410 * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} is controlled by the 411 * application</p> 412 * 413 * @see CaptureRequest#LENS_FOCUS_DISTANCE 414 * @see CaptureRequest#CONTROL_AF_MODE 415 */ 416 public static final int CONTROL_AF_MODE_OFF = 0; 417 418 /** 419 * <p>If lens is not fixed focus.</p> 420 * <p>Use {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} to determine if lens 421 * is fixed-focus. In this mode, the lens does not move unless 422 * the autofocus trigger action is called. When that trigger 423 * is activated, AF must transition to ACTIVE_SCAN, then to 424 * the outcome of the scan (FOCUSED or NOT_FOCUSED).</p> 425 * <p>Triggering AF_CANCEL resets the lens position to default, 426 * and sets the AF state to INACTIVE.</p> 427 * 428 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 429 * @see CaptureRequest#CONTROL_AF_MODE 430 */ 431 public static final int CONTROL_AF_MODE_AUTO = 1; 432 433 /** 434 * <p>In this mode, the lens does not move unless the 435 * autofocus trigger action is called.</p> 436 * <p>When that trigger is activated, AF must transition to 437 * ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or 438 * NOT_FOCUSED). Triggering cancel AF resets the lens 439 * position to default, and sets the AF state to 440 * INACTIVE.</p> 441 * @see CaptureRequest#CONTROL_AF_MODE 442 */ 443 public static final int CONTROL_AF_MODE_MACRO = 2; 444 445 /** 446 * <p>In this mode, the AF algorithm modifies the lens 447 * position continually to attempt to provide a 448 * constantly-in-focus image stream.</p> 449 * <p>The focusing behavior should be suitable for good quality 450 * video recording; typically this means slower focus 451 * movement and no overshoots. When the AF trigger is not 452 * involved, the AF algorithm should start in INACTIVE state, 453 * and then transition into PASSIVE_SCAN and PASSIVE_FOCUSED 454 * states as appropriate. When the AF trigger is activated, 455 * the algorithm should immediately transition into 456 * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the 457 * lens position until a cancel AF trigger is received.</p> 458 * <p>Once cancel is received, the algorithm should transition 459 * back to INACTIVE and resume passive scan. Note that this 460 * behavior is not identical to CONTINUOUS_PICTURE, since an 461 * ongoing PASSIVE_SCAN must immediately be 462 * canceled.</p> 463 * @see CaptureRequest#CONTROL_AF_MODE 464 */ 465 public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3; 466 467 /** 468 * <p>In this mode, the AF algorithm modifies the lens 469 * position continually to attempt to provide a 470 * constantly-in-focus image stream.</p> 471 * <p>The focusing behavior should be suitable for still image 472 * capture; typically this means focusing as fast as 473 * possible. When the AF trigger is not involved, the AF 474 * algorithm should start in INACTIVE state, and then 475 * transition into PASSIVE_SCAN and PASSIVE_FOCUSED states as 476 * appropriate as it attempts to maintain focus. When the AF 477 * trigger is activated, the algorithm should finish its 478 * PASSIVE_SCAN if active, and then transition into 479 * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the 480 * lens position until a cancel AF trigger is received.</p> 481 * <p>When the AF cancel trigger is activated, the algorithm 482 * should transition back to INACTIVE and then act as if it 483 * has just been started.</p> 484 * @see CaptureRequest#CONTROL_AF_MODE 485 */ 486 public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4; 487 488 /** 489 * <p>Extended depth of field (digital focus). AF 490 * trigger is ignored, AF state should always be 491 * INACTIVE.</p> 492 * @see CaptureRequest#CONTROL_AF_MODE 493 */ 494 public static final int CONTROL_AF_MODE_EDOF = 5; 495 496 // 497 // Enumeration values for CaptureRequest#CONTROL_AF_TRIGGER 498 // 499 500 /** 501 * <p>The trigger is idle.</p> 502 * @see CaptureRequest#CONTROL_AF_TRIGGER 503 */ 504 public static final int CONTROL_AF_TRIGGER_IDLE = 0; 505 506 /** 507 * <p>Autofocus must trigger now.</p> 508 * @see CaptureRequest#CONTROL_AF_TRIGGER 509 */ 510 public static final int CONTROL_AF_TRIGGER_START = 1; 511 512 /** 513 * <p>Autofocus must return to initial 514 * state, and cancel any active trigger.</p> 515 * @see CaptureRequest#CONTROL_AF_TRIGGER 516 */ 517 public static final int CONTROL_AF_TRIGGER_CANCEL = 2; 518 519 // 520 // Enumeration values for CaptureRequest#CONTROL_AWB_MODE 521 // 522 523 /** 524 * <p>The camera device's auto white balance routine is disabled; 525 * the application-selected color transform matrix 526 * ({@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}) and gains 527 * ({@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}) are used by the camera 528 * device for manual white balance control.</p> 529 * 530 * @see CaptureRequest#COLOR_CORRECTION_GAINS 531 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 532 * @see CaptureRequest#CONTROL_AWB_MODE 533 */ 534 public static final int CONTROL_AWB_MODE_OFF = 0; 535 536 /** 537 * <p>The camera device's auto white balance routine is active; 538 * the application's values for android.colorCorrection.transform 539 * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.</p> 540 * 541 * @see CaptureRequest#COLOR_CORRECTION_GAINS 542 * @see CaptureRequest#CONTROL_AWB_MODE 543 */ 544 public static final int CONTROL_AWB_MODE_AUTO = 1; 545 546 /** 547 * <p>The camera device's auto white balance routine is disabled; 548 * the camera device uses incandescent light as the assumed scene 549 * illumination for white balance. While the exact white balance 550 * transforms are up to the camera device, they will approximately 551 * match the CIE standard illuminant A.</p> 552 * @see CaptureRequest#CONTROL_AWB_MODE 553 */ 554 public static final int CONTROL_AWB_MODE_INCANDESCENT = 2; 555 556 /** 557 * <p>The camera device's auto white balance routine is disabled; 558 * the camera device uses fluorescent light as the assumed scene 559 * illumination for white balance. While the exact white balance 560 * transforms are up to the camera device, they will approximately 561 * match the CIE standard illuminant F2.</p> 562 * @see CaptureRequest#CONTROL_AWB_MODE 563 */ 564 public static final int CONTROL_AWB_MODE_FLUORESCENT = 3; 565 566 /** 567 * <p>The camera device's auto white balance routine is disabled; 568 * the camera device uses warm fluorescent light as the assumed scene 569 * illumination for white balance. While the exact white balance 570 * transforms are up to the camera device, they will approximately 571 * match the CIE standard illuminant F4.</p> 572 * @see CaptureRequest#CONTROL_AWB_MODE 573 */ 574 public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4; 575 576 /** 577 * <p>The camera device's auto white balance routine is disabled; 578 * the camera device uses daylight light as the assumed scene 579 * illumination for white balance. While the exact white balance 580 * transforms are up to the camera device, they will approximately 581 * match the CIE standard illuminant D65.</p> 582 * @see CaptureRequest#CONTROL_AWB_MODE 583 */ 584 public static final int CONTROL_AWB_MODE_DAYLIGHT = 5; 585 586 /** 587 * <p>The camera device's auto white balance routine is disabled; 588 * the camera device uses cloudy daylight light as the assumed scene 589 * illumination for white balance.</p> 590 * @see CaptureRequest#CONTROL_AWB_MODE 591 */ 592 public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6; 593 594 /** 595 * <p>The camera device's auto white balance routine is disabled; 596 * the camera device uses twilight light as the assumed scene 597 * illumination for white balance.</p> 598 * @see CaptureRequest#CONTROL_AWB_MODE 599 */ 600 public static final int CONTROL_AWB_MODE_TWILIGHT = 7; 601 602 /** 603 * <p>The camera device's auto white balance routine is disabled; 604 * the camera device uses shade light as the assumed scene 605 * illumination for white balance.</p> 606 * @see CaptureRequest#CONTROL_AWB_MODE 607 */ 608 public static final int CONTROL_AWB_MODE_SHADE = 8; 609 610 // 611 // Enumeration values for CaptureRequest#CONTROL_CAPTURE_INTENT 612 // 613 614 /** 615 * <p>This request doesn't fall into the other 616 * categories. Default to preview-like 617 * behavior.</p> 618 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 619 */ 620 public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0; 621 622 /** 623 * <p>This request is for a preview-like usecase. The 624 * precapture trigger may be used to start off a metering 625 * w/flash sequence</p> 626 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 627 */ 628 public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1; 629 630 /** 631 * <p>This request is for a still capture-type 632 * usecase.</p> 633 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 634 */ 635 public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2; 636 637 /** 638 * <p>This request is for a video recording 639 * usecase.</p> 640 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 641 */ 642 public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3; 643 644 /** 645 * <p>This request is for a video snapshot (still 646 * image while recording video) usecase</p> 647 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 648 */ 649 public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4; 650 651 /** 652 * <p>This request is for a ZSL usecase; the 653 * application will stream full-resolution images and 654 * reprocess one or several later for a final 655 * capture</p> 656 * @see CaptureRequest#CONTROL_CAPTURE_INTENT 657 */ 658 public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5; 659 660 // 661 // Enumeration values for CaptureRequest#CONTROL_EFFECT_MODE 662 // 663 664 /** 665 * @see CaptureRequest#CONTROL_EFFECT_MODE 666 */ 667 public static final int CONTROL_EFFECT_MODE_OFF = 0; 668 669 /** 670 * @see CaptureRequest#CONTROL_EFFECT_MODE 671 */ 672 public static final int CONTROL_EFFECT_MODE_MONO = 1; 673 674 /** 675 * @see CaptureRequest#CONTROL_EFFECT_MODE 676 */ 677 public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2; 678 679 /** 680 * @see CaptureRequest#CONTROL_EFFECT_MODE 681 */ 682 public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3; 683 684 /** 685 * @see CaptureRequest#CONTROL_EFFECT_MODE 686 */ 687 public static final int CONTROL_EFFECT_MODE_SEPIA = 4; 688 689 /** 690 * @see CaptureRequest#CONTROL_EFFECT_MODE 691 */ 692 public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5; 693 694 /** 695 * @see CaptureRequest#CONTROL_EFFECT_MODE 696 */ 697 public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6; 698 699 /** 700 * @see CaptureRequest#CONTROL_EFFECT_MODE 701 */ 702 public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7; 703 704 /** 705 * @see CaptureRequest#CONTROL_EFFECT_MODE 706 */ 707 public static final int CONTROL_EFFECT_MODE_AQUA = 8; 708 709 // 710 // Enumeration values for CaptureRequest#CONTROL_MODE 711 // 712 713 /** 714 * <p>Full application control of pipeline. All 3A 715 * routines are disabled, no other settings in 716 * android.control.* have any effect</p> 717 * @see CaptureRequest#CONTROL_MODE 718 */ 719 public static final int CONTROL_MODE_OFF = 0; 720 721 /** 722 * <p>Use settings for each individual 3A routine. 723 * Manual control of capture parameters is disabled. All 724 * controls in android.control.* besides sceneMode take 725 * effect</p> 726 * @see CaptureRequest#CONTROL_MODE 727 */ 728 public static final int CONTROL_MODE_AUTO = 1; 729 730 /** 731 * <p>Use specific scene mode. Enabling this disables 732 * control.aeMode, control.awbMode and control.afMode 733 * controls; the HAL must ignore those settings while 734 * USE_SCENE_MODE is active (except for FACE_PRIORITY 735 * scene mode). Other control entries are still active. 736 * This setting can only be used if availableSceneModes != 737 * UNSUPPORTED</p> 738 * @see CaptureRequest#CONTROL_MODE 739 */ 740 public static final int CONTROL_MODE_USE_SCENE_MODE = 2; 741 742 // 743 // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE 744 // 745 746 /** 747 * @see CaptureRequest#CONTROL_SCENE_MODE 748 */ 749 public static final int CONTROL_SCENE_MODE_UNSUPPORTED = 0; 750 751 /** 752 * <p>if face detection support exists Use face 753 * detection data to drive 3A routines. If face detection 754 * statistics are disabled, should still operate correctly 755 * (but not return face detection statistics to the 756 * framework).</p> 757 * <p>Unlike the other scene modes, aeMode, awbMode, and afMode 758 * remain active when FACE_PRIORITY is set. This is due to 759 * compatibility concerns with the old camera 760 * API</p> 761 * @see CaptureRequest#CONTROL_SCENE_MODE 762 */ 763 public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1; 764 765 /** 766 * @see CaptureRequest#CONTROL_SCENE_MODE 767 */ 768 public static final int CONTROL_SCENE_MODE_ACTION = 2; 769 770 /** 771 * @see CaptureRequest#CONTROL_SCENE_MODE 772 */ 773 public static final int CONTROL_SCENE_MODE_PORTRAIT = 3; 774 775 /** 776 * @see CaptureRequest#CONTROL_SCENE_MODE 777 */ 778 public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4; 779 780 /** 781 * @see CaptureRequest#CONTROL_SCENE_MODE 782 */ 783 public static final int CONTROL_SCENE_MODE_NIGHT = 5; 784 785 /** 786 * @see CaptureRequest#CONTROL_SCENE_MODE 787 */ 788 public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6; 789 790 /** 791 * @see CaptureRequest#CONTROL_SCENE_MODE 792 */ 793 public static final int CONTROL_SCENE_MODE_THEATRE = 7; 794 795 /** 796 * @see CaptureRequest#CONTROL_SCENE_MODE 797 */ 798 public static final int CONTROL_SCENE_MODE_BEACH = 8; 799 800 /** 801 * @see CaptureRequest#CONTROL_SCENE_MODE 802 */ 803 public static final int CONTROL_SCENE_MODE_SNOW = 9; 804 805 /** 806 * @see CaptureRequest#CONTROL_SCENE_MODE 807 */ 808 public static final int CONTROL_SCENE_MODE_SUNSET = 10; 809 810 /** 811 * @see CaptureRequest#CONTROL_SCENE_MODE 812 */ 813 public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11; 814 815 /** 816 * @see CaptureRequest#CONTROL_SCENE_MODE 817 */ 818 public static final int CONTROL_SCENE_MODE_FIREWORKS = 12; 819 820 /** 821 * @see CaptureRequest#CONTROL_SCENE_MODE 822 */ 823 public static final int CONTROL_SCENE_MODE_SPORTS = 13; 824 825 /** 826 * @see CaptureRequest#CONTROL_SCENE_MODE 827 */ 828 public static final int CONTROL_SCENE_MODE_PARTY = 14; 829 830 /** 831 * @see CaptureRequest#CONTROL_SCENE_MODE 832 */ 833 public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15; 834 835 /** 836 * @see CaptureRequest#CONTROL_SCENE_MODE 837 */ 838 public static final int CONTROL_SCENE_MODE_BARCODE = 16; 839 840 // 841 // Enumeration values for CaptureRequest#EDGE_MODE 842 // 843 844 /** 845 * <p>No edge enhancement is applied</p> 846 * @see CaptureRequest#EDGE_MODE 847 */ 848 public static final int EDGE_MODE_OFF = 0; 849 850 /** 851 * <p>Must not slow down frame rate relative to sensor 852 * output</p> 853 * @see CaptureRequest#EDGE_MODE 854 */ 855 public static final int EDGE_MODE_FAST = 1; 856 857 /** 858 * <p>Frame rate may be reduced by high 859 * quality</p> 860 * @see CaptureRequest#EDGE_MODE 861 */ 862 public static final int EDGE_MODE_HIGH_QUALITY = 2; 863 864 // 865 // Enumeration values for CaptureRequest#FLASH_MODE 866 // 867 868 /** 869 * <p>Do not fire the flash for this 870 * capture</p> 871 * @see CaptureRequest#FLASH_MODE 872 */ 873 public static final int FLASH_MODE_OFF = 0; 874 875 /** 876 * <p>if android.flash.available is true Fire flash 877 * for this capture based on firingPower, 878 * firingTime.</p> 879 * @see CaptureRequest#FLASH_MODE 880 */ 881 public static final int FLASH_MODE_SINGLE = 1; 882 883 /** 884 * <p>if android.flash.available is true Flash 885 * continuously on, power set by 886 * firingPower</p> 887 * @see CaptureRequest#FLASH_MODE 888 */ 889 public static final int FLASH_MODE_TORCH = 2; 890 891 // 892 // Enumeration values for CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE 893 // 894 895 /** 896 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE 897 */ 898 public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0; 899 900 /** 901 * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE 902 */ 903 public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1; 904 905 // 906 // Enumeration values for CaptureRequest#NOISE_REDUCTION_MODE 907 // 908 909 /** 910 * <p>No noise reduction is applied</p> 911 * @see CaptureRequest#NOISE_REDUCTION_MODE 912 */ 913 public static final int NOISE_REDUCTION_MODE_OFF = 0; 914 915 /** 916 * <p>Must not slow down frame rate relative to sensor 917 * output</p> 918 * @see CaptureRequest#NOISE_REDUCTION_MODE 919 */ 920 public static final int NOISE_REDUCTION_MODE_FAST = 1; 921 922 /** 923 * <p>May slow down frame rate to provide highest 924 * quality</p> 925 * @see CaptureRequest#NOISE_REDUCTION_MODE 926 */ 927 public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2; 928 929 // 930 // Enumeration values for CaptureRequest#STATISTICS_FACE_DETECT_MODE 931 // 932 933 /** 934 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 935 */ 936 public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0; 937 938 /** 939 * <p>Optional Return rectangle and confidence 940 * only</p> 941 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 942 */ 943 public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1; 944 945 /** 946 * <p>Optional Return all face 947 * metadata</p> 948 * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE 949 */ 950 public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2; 951 952 // 953 // Enumeration values for CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 954 // 955 956 /** 957 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 958 */ 959 public static final int STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0; 960 961 /** 962 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 963 */ 964 public static final int STATISTICS_LENS_SHADING_MAP_MODE_ON = 1; 965 966 // 967 // Enumeration values for CaptureRequest#TONEMAP_MODE 968 // 969 970 /** 971 * <p>Use the tone mapping curve specified in 972 * android.tonemap.curve</p> 973 * @see CaptureRequest#TONEMAP_MODE 974 */ 975 public static final int TONEMAP_MODE_CONTRAST_CURVE = 0; 976 977 /** 978 * <p>Must not slow down frame rate relative to raw 979 * bayer output</p> 980 * @see CaptureRequest#TONEMAP_MODE 981 */ 982 public static final int TONEMAP_MODE_FAST = 1; 983 984 /** 985 * <p>Frame rate may be reduced by high 986 * quality</p> 987 * @see CaptureRequest#TONEMAP_MODE 988 */ 989 public static final int TONEMAP_MODE_HIGH_QUALITY = 2; 990 991 // 992 // Enumeration values for CaptureResult#CONTROL_AE_STATE 993 // 994 995 /** 996 * <p>AE is off. When a camera device is opened, it starts in 997 * this state.</p> 998 * @see CaptureResult#CONTROL_AE_STATE 999 */ 1000 public static final int CONTROL_AE_STATE_INACTIVE = 0; 1001 1002 /** 1003 * <p>AE doesn't yet have a good set of control values 1004 * for the current scene</p> 1005 * @see CaptureResult#CONTROL_AE_STATE 1006 */ 1007 public static final int CONTROL_AE_STATE_SEARCHING = 1; 1008 1009 /** 1010 * <p>AE has a good set of control values for the 1011 * current scene</p> 1012 * @see CaptureResult#CONTROL_AE_STATE 1013 */ 1014 public static final int CONTROL_AE_STATE_CONVERGED = 2; 1015 1016 /** 1017 * <p>AE has been locked (aeMode = 1018 * LOCKED)</p> 1019 * @see CaptureResult#CONTROL_AE_STATE 1020 */ 1021 public static final int CONTROL_AE_STATE_LOCKED = 3; 1022 1023 /** 1024 * <p>AE has a good set of control values, but flash 1025 * needs to be fired for good quality still 1026 * capture</p> 1027 * @see CaptureResult#CONTROL_AE_STATE 1028 */ 1029 public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4; 1030 1031 /** 1032 * <p>AE has been asked to do a precapture sequence 1033 * (through the 1034 * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING) 1035 * call), and is currently executing it. Once PRECAPTURE 1036 * completes, AE will transition to CONVERGED or 1037 * FLASH_REQUIRED as appropriate</p> 1038 * @see CaptureResult#CONTROL_AE_STATE 1039 */ 1040 public static final int CONTROL_AE_STATE_PRECAPTURE = 5; 1041 1042 // 1043 // Enumeration values for CaptureResult#CONTROL_AF_STATE 1044 // 1045 1046 /** 1047 * <p>AF off or has not yet tried to scan/been asked 1048 * to scan. When a camera device is opened, it starts in 1049 * this state.</p> 1050 * @see CaptureResult#CONTROL_AF_STATE 1051 */ 1052 public static final int CONTROL_AF_STATE_INACTIVE = 0; 1053 1054 /** 1055 * <p>if CONTINUOUS_* modes are supported. AF is 1056 * currently doing an AF scan initiated by a continuous 1057 * autofocus mode</p> 1058 * @see CaptureResult#CONTROL_AF_STATE 1059 */ 1060 public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1; 1061 1062 /** 1063 * <p>if CONTINUOUS_* modes are supported. AF currently 1064 * believes it is in focus, but may restart scanning at 1065 * any time.</p> 1066 * @see CaptureResult#CONTROL_AF_STATE 1067 */ 1068 public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2; 1069 1070 /** 1071 * <p>if AUTO or MACRO modes are supported. AF is doing 1072 * an AF scan because it was triggered by AF 1073 * trigger</p> 1074 * @see CaptureResult#CONTROL_AF_STATE 1075 */ 1076 public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3; 1077 1078 /** 1079 * <p>if any AF mode besides OFF is supported. AF 1080 * believes it is focused correctly and is 1081 * locked</p> 1082 * @see CaptureResult#CONTROL_AF_STATE 1083 */ 1084 public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4; 1085 1086 /** 1087 * <p>if any AF mode besides OFF is supported. AF has 1088 * failed to focus successfully and is 1089 * locked</p> 1090 * @see CaptureResult#CONTROL_AF_STATE 1091 */ 1092 public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5; 1093 1094 /** 1095 * <p>if CONTINUOUS_* modes are supported. AF finished a 1096 * passive scan without finding focus, and may restart 1097 * scanning at any time.</p> 1098 * @see CaptureResult#CONTROL_AF_STATE 1099 */ 1100 public static final int CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6; 1101 1102 // 1103 // Enumeration values for CaptureResult#CONTROL_AWB_STATE 1104 // 1105 1106 /** 1107 * <p>AWB is not in auto mode. When a camera device is opened, it 1108 * starts in this state.</p> 1109 * @see CaptureResult#CONTROL_AWB_STATE 1110 */ 1111 public static final int CONTROL_AWB_STATE_INACTIVE = 0; 1112 1113 /** 1114 * <p>AWB doesn't yet have a good set of control 1115 * values for the current scene</p> 1116 * @see CaptureResult#CONTROL_AWB_STATE 1117 */ 1118 public static final int CONTROL_AWB_STATE_SEARCHING = 1; 1119 1120 /** 1121 * <p>AWB has a good set of control values for the 1122 * current scene</p> 1123 * @see CaptureResult#CONTROL_AWB_STATE 1124 */ 1125 public static final int CONTROL_AWB_STATE_CONVERGED = 2; 1126 1127 /** 1128 * <p>AE has been locked (aeMode = 1129 * LOCKED)</p> 1130 * @see CaptureResult#CONTROL_AWB_STATE 1131 */ 1132 public static final int CONTROL_AWB_STATE_LOCKED = 3; 1133 1134 // 1135 // Enumeration values for CaptureResult#FLASH_STATE 1136 // 1137 1138 /** 1139 * <p>No flash on camera</p> 1140 * @see CaptureResult#FLASH_STATE 1141 */ 1142 public static final int FLASH_STATE_UNAVAILABLE = 0; 1143 1144 /** 1145 * <p>if android.flash.available is true Flash is 1146 * charging and cannot be fired</p> 1147 * @see CaptureResult#FLASH_STATE 1148 */ 1149 public static final int FLASH_STATE_CHARGING = 1; 1150 1151 /** 1152 * <p>if android.flash.available is true Flash is 1153 * ready to fire</p> 1154 * @see CaptureResult#FLASH_STATE 1155 */ 1156 public static final int FLASH_STATE_READY = 2; 1157 1158 /** 1159 * <p>if android.flash.available is true Flash fired 1160 * for this capture</p> 1161 * @see CaptureResult#FLASH_STATE 1162 */ 1163 public static final int FLASH_STATE_FIRED = 3; 1164 1165 // 1166 // Enumeration values for CaptureResult#LENS_STATE 1167 // 1168 1169 /** 1170 * @see CaptureResult#LENS_STATE 1171 */ 1172 public static final int LENS_STATE_STATIONARY = 0; 1173 1174 /** 1175 * @see CaptureResult#LENS_STATE 1176 */ 1177 public static final int LENS_STATE_MOVING = 1; 1178 1179 // 1180 // Enumeration values for CaptureResult#STATISTICS_SCENE_FLICKER 1181 // 1182 1183 /** 1184 * @see CaptureResult#STATISTICS_SCENE_FLICKER 1185 */ 1186 public static final int STATISTICS_SCENE_FLICKER_NONE = 0; 1187 1188 /** 1189 * @see CaptureResult#STATISTICS_SCENE_FLICKER 1190 */ 1191 public static final int STATISTICS_SCENE_FLICKER_50HZ = 1; 1192 1193 /** 1194 * @see CaptureResult#STATISTICS_SCENE_FLICKER 1195 */ 1196 public static final int STATISTICS_SCENE_FLICKER_60HZ = 2; 1197 1198 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 1199 * End generated code 1200 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ 1201 1202} 1203