CaptureRequest.java revision 78146ecb24871302a4c4dc0a7341044a06d29ee8
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; 20import android.os.Parcel; 21import android.os.Parcelable; 22import android.view.Surface; 23 24import java.util.HashSet; 25import java.util.Objects; 26 27 28/** 29 * <p>An immutable package of settings and outputs needed to capture a single 30 * image from the camera device.</p> 31 * 32 * <p>Contains the configuration for the capture hardware (sensor, lens, flash), 33 * the processing pipeline, the control algorithms, and the output buffers. Also 34 * contains the list of target Surfaces to send image data to for this 35 * capture.</p> 36 * 37 * <p>CaptureRequests can be created by using a {@link Builder} instance, 38 * obtained by calling {@link CameraDevice#createCaptureRequest}</p> 39 * 40 * <p>CaptureRequests are given to {@link CameraDevice#capture} or 41 * {@link CameraDevice#setRepeatingRequest} to capture images from a camera.</p> 42 * 43 * <p>Each request can specify a different subset of target Surfaces for the 44 * camera to send the captured data to. All the surfaces used in a request must 45 * be part of the surface list given to the last call to 46 * {@link CameraDevice#configureOutputs}, when the request is submitted to the 47 * camera device.</p> 48 * 49 * <p>For example, a request meant for repeating preview might only include the 50 * Surface for the preview SurfaceView or SurfaceTexture, while a 51 * high-resolution still capture would also include a Surface from a ImageReader 52 * configured for high-resolution JPEG images.</p> 53 * 54 * @see CameraDevice#capture 55 * @see CameraDevice#setRepeatingRequest 56 * @see CameraDevice#createCaptureRequest 57 */ 58public final class CaptureRequest extends CameraMetadata implements Parcelable { 59 60 private final HashSet<Surface> mSurfaceSet; 61 private final CameraMetadataNative mSettings; 62 63 private Object mUserTag; 64 65 /** 66 * Construct empty request. 67 * 68 * Used by Binder to unparcel this object only. 69 */ 70 private CaptureRequest() { 71 mSettings = new CameraMetadataNative(); 72 mSurfaceSet = new HashSet<Surface>(); 73 } 74 75 /** 76 * Clone from source capture request. 77 * 78 * Used by the Builder to create an immutable copy. 79 */ 80 @SuppressWarnings("unchecked") 81 private CaptureRequest(CaptureRequest source) { 82 mSettings = new CameraMetadataNative(source.mSettings); 83 mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone(); 84 mUserTag = source.mUserTag; 85 } 86 87 /** 88 * Take ownership of passed-in settings. 89 * 90 * Used by the Builder to create a mutable CaptureRequest. 91 */ 92 private CaptureRequest(CameraMetadataNative settings) { 93 mSettings = settings; 94 mSurfaceSet = new HashSet<Surface>(); 95 } 96 97 @SuppressWarnings("unchecked") 98 @Override 99 public <T> T get(Key<T> key) { 100 return mSettings.get(key); 101 } 102 103 /** 104 * Retrieve the tag for this request, if any. 105 * 106 * <p>This tag is not used for anything by the camera device, but can be 107 * used by an application to easily identify a CaptureRequest when it is 108 * returned by 109 * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted} 110 * </p> 111 * 112 * @return the last tag Object set on this request, or {@code null} if 113 * no tag has been set. 114 * @see Builder#setTag 115 */ 116 public Object getTag() { 117 return mUserTag; 118 } 119 120 /** 121 * Determine whether this CaptureRequest is equal to another CaptureRequest. 122 * 123 * <p>A request is considered equal to another is if it's set of key/values is equal, it's 124 * list of output surfaces is equal, and the user tag is equal.</p> 125 * 126 * @param other Another instance of CaptureRequest. 127 * 128 * @return True if the requests are the same, false otherwise. 129 */ 130 @Override 131 public boolean equals(Object other) { 132 return other instanceof CaptureRequest 133 && equals((CaptureRequest)other); 134 } 135 136 private boolean equals(CaptureRequest other) { 137 return other != null 138 && Objects.equals(mUserTag, other.mUserTag) 139 && mSurfaceSet.equals(other.mSurfaceSet) 140 && mSettings.equals(other.mSettings); 141 } 142 143 @Override 144 public int hashCode() { 145 return mSettings.hashCode(); 146 } 147 148 public static final Parcelable.Creator<CaptureRequest> CREATOR = 149 new Parcelable.Creator<CaptureRequest>() { 150 @Override 151 public CaptureRequest createFromParcel(Parcel in) { 152 CaptureRequest request = new CaptureRequest(); 153 request.readFromParcel(in); 154 155 return request; 156 } 157 158 @Override 159 public CaptureRequest[] newArray(int size) { 160 return new CaptureRequest[size]; 161 } 162 }; 163 164 /** 165 * Expand this object from a Parcel. 166 * Hidden since this breaks the immutability of CaptureRequest, but is 167 * needed to receive CaptureRequests with aidl. 168 * 169 * @param in The parcel from which the object should be read 170 * @hide 171 */ 172 public void readFromParcel(Parcel in) { 173 mSettings.readFromParcel(in); 174 175 mSurfaceSet.clear(); 176 177 Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader()); 178 179 if (parcelableArray == null) { 180 return; 181 } 182 183 for (Parcelable p : parcelableArray) { 184 Surface s = (Surface) p; 185 mSurfaceSet.add(s); 186 } 187 } 188 189 @Override 190 public int describeContents() { 191 return 0; 192 } 193 194 @Override 195 public void writeToParcel(Parcel dest, int flags) { 196 mSettings.writeToParcel(dest, flags); 197 dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags); 198 } 199 200 /** 201 * A builder for capture requests. 202 * 203 * <p>To obtain a builder instance, use the 204 * {@link CameraDevice#createCaptureRequest} method, which initializes the 205 * request fields to one of the templates defined in {@link CameraDevice}. 206 * 207 * @see CameraDevice#createCaptureRequest 208 * @see #TEMPLATE_PREVIEW 209 * @see #TEMPLATE_RECORD 210 * @see #TEMPLATE_STILL_CAPTURE 211 * @see #TEMPLATE_VIDEO_SNAPSHOT 212 * @see #TEMPLATE_MANUAL 213 */ 214 public final static class Builder { 215 216 private final CaptureRequest mRequest; 217 218 /** 219 * Initialize the builder using the template; the request takes 220 * ownership of the template. 221 * 222 * @hide 223 */ 224 public Builder(CameraMetadataNative template) { 225 mRequest = new CaptureRequest(template); 226 } 227 228 /** 229 * <p>Add a surface to the list of targets for this request</p> 230 * 231 * <p>The Surface added must be one of the surfaces included in the most 232 * recent call to {@link CameraDevice#configureOutputs}, when the 233 * request is given to the camera device.</p> 234 * 235 * <p>Adding a target more than once has no effect.</p> 236 * 237 * @param outputTarget Surface to use as an output target for this request 238 */ 239 public void addTarget(Surface outputTarget) { 240 mRequest.mSurfaceSet.add(outputTarget); 241 } 242 243 /** 244 * <p>Remove a surface from the list of targets for this request.</p> 245 * 246 * <p>Removing a target that is not currently added has no effect.</p> 247 * 248 * @param outputTarget Surface to use as an output target for this request 249 */ 250 public void removeTarget(Surface outputTarget) { 251 mRequest.mSurfaceSet.remove(outputTarget); 252 } 253 254 /** 255 * Set a capture request field to a value. The field definitions can be 256 * found in {@link CaptureRequest}. 257 * 258 * @param key The metadata field to write. 259 * @param value The value to set the field to, which must be of a matching 260 * type to the key. 261 */ 262 public <T> void set(Key<T> key, T value) { 263 mRequest.mSettings.set(key, value); 264 } 265 266 /** 267 * Get a capture request field value. The field definitions can be 268 * found in {@link CaptureRequest}. 269 * 270 * @throws IllegalArgumentException if the key was not valid 271 * 272 * @param key The metadata field to read. 273 * @return The value of that key, or {@code null} if the field is not set. 274 */ 275 public <T> T get(Key<T> key) { 276 return mRequest.mSettings.get(key); 277 } 278 279 /** 280 * Set a tag for this request. 281 * 282 * <p>This tag is not used for anything by the camera device, but can be 283 * used by an application to easily identify a CaptureRequest when it is 284 * returned by 285 * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted} 286 * 287 * @param tag an arbitrary Object to store with this request 288 * @see CaptureRequest#getTag 289 */ 290 public void setTag(Object tag) { 291 mRequest.mUserTag = tag; 292 } 293 294 /** 295 * Build a request using the current target Surfaces and settings. 296 * 297 * @return A new capture request instance, ready for submission to the 298 * camera device. 299 */ 300 public CaptureRequest build() { 301 return new CaptureRequest(mRequest); 302 } 303 304 305 /** 306 * @hide 307 */ 308 public boolean isEmpty() { 309 return mRequest.mSettings.isEmpty(); 310 } 311 312 } 313 314 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 315 * The key entries below this point are generated from metadata 316 * definitions in /system/media/camera/docs. Do not modify by hand or 317 * modify the comment blocks at the start or end. 318 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ 319 320 321 /** 322 * <p>When {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is not OFF, TRANSFORM_MATRIX 323 * should be ignored.</p> 324 * 325 * @see CaptureRequest#CONTROL_AWB_MODE 326 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX 327 * @see #COLOR_CORRECTION_MODE_FAST 328 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY 329 */ 330 public static final Key<Integer> COLOR_CORRECTION_MODE = 331 new Key<Integer>("android.colorCorrection.mode", int.class); 332 333 /** 334 * <p>A color transform matrix to use to transform 335 * from sensor RGB color space to output linear sRGB color space</p> 336 * <p>This matrix is either set by HAL when the request 337 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 338 * directly by the application in the request when the 339 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 340 * <p>In the latter case, the HAL may round the matrix to account 341 * for precision issues; the final rounded matrix should be 342 * reported back in this matrix result metadata.</p> 343 * 344 * @see CaptureRequest#COLOR_CORRECTION_MODE 345 */ 346 public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = 347 new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); 348 349 /** 350 * <p>Gains applying to Bayer color channels for 351 * white-balance</p> 352 * <p>The 4-channel white-balance gains are defined in 353 * the order of [R G_even G_odd B], where G_even is the gain 354 * for green pixels on even rows of the output, and G_odd 355 * is the gain for greenpixels on the odd rows. if a HAL 356 * does not support a separate gain for even/odd green channels, 357 * it should use the G_even value,and write G_odd equal to 358 * G_even in the output result metadata.</p> 359 * <p>This array is either set by HAL when the request 360 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 361 * directly by the application in the request when the 362 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 363 * <p>The ouput should be the gains actually applied by the HAL to 364 * the current frame.</p> 365 * 366 * @see CaptureRequest#COLOR_CORRECTION_MODE 367 */ 368 public static final Key<float[]> COLOR_CORRECTION_GAINS = 369 new Key<float[]>("android.colorCorrection.gains", float[].class); 370 371 /** 372 * <p>The desired setting for the camera device's auto-exposure 373 * algorithm's antibanding compensation.</p> 374 * <p>Some kinds of lighting fixtures, such as some fluorescent 375 * lights, flicker at the rate of the power supply frequency 376 * (60Hz or 50Hz, depending on country). While this is 377 * typically not noticeable to a person, it can be visible to 378 * a camera device. If a camera sets its exposure time to the 379 * wrong value, the flicker may become visible in the 380 * viewfinder as flicker or in a final captured image, as a 381 * set of variable-brightness bands across the image.</p> 382 * <p>Therefore, the auto-exposure routines of camera devices 383 * include antibanding routines that ensure that the chosen 384 * exposure value will not cause such banding. The choice of 385 * exposure time depends on the rate of flicker, which the 386 * camera device can detect automatically, or the expected 387 * rate can be selected by the application using this 388 * control.</p> 389 * <p>A given camera device may not support all of the possible 390 * options for the antibanding mode. The 391 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains 392 * the available modes for a given camera device.</p> 393 * <p>The default mode is AUTO, which must be supported by all 394 * camera devices.</p> 395 * <p>If manual exposure control is enabled (by setting 396 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), 397 * then this setting has no effect, and the application must 398 * ensure it selects exposure times that do not cause banding 399 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist 400 * the application in this.</p> 401 * 402 * @see CaptureRequest#CONTROL_AE_MODE 403 * @see CaptureResult#STATISTICS_SCENE_FLICKER 404 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES 405 * @see CaptureRequest#CONTROL_MODE 406 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF 407 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ 408 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ 409 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO 410 */ 411 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = 412 new Key<Integer>("android.control.aeAntibandingMode", int.class); 413 414 /** 415 * <p>Adjustment to AE target image 416 * brightness</p> 417 * <p>For example, if EV step is 0.333, '6' will mean an 418 * exposure compensation of +2 EV; -3 will mean an exposure 419 * compensation of -1</p> 420 */ 421 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = 422 new Key<Integer>("android.control.aeExposureCompensation", int.class); 423 424 /** 425 * <p>Whether AE is currently locked to its latest 426 * calculated values</p> 427 * <p>Note that even when AE is locked, the flash may be 428 * fired if the AE mode is ON_AUTO_FLASH / ON_ALWAYS_FLASH / 429 * ON_AUTO_FLASH_REDEYE.</p> 430 */ 431 public static final Key<Boolean> CONTROL_AE_LOCK = 432 new Key<Boolean>("android.control.aeLock", boolean.class); 433 434 /** 435 * <p>The desired mode for the camera device's 436 * auto-exposure routine.</p> 437 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is 438 * AUTO.</p> 439 * <p>When set to any of the ON modes, the camera device's 440 * auto-exposure routine is enabled, overriding the 441 * application's selected exposure time, sensor sensitivity, 442 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 443 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and 444 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes 445 * is selected, the camera device's flash unit controls are 446 * also overridden.</p> 447 * <p>The FLASH modes are only available if the camera device 448 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> 449 * <p>If flash TORCH mode is desired, this field must be set to 450 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> 451 * <p>When set to any of the ON modes, the values chosen by the 452 * camera device auto-exposure routine for the overridden 453 * fields for a given capture will be available in its 454 * CaptureResult.</p> 455 * 456 * @see CaptureRequest#FLASH_MODE 457 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 458 * @see CaptureRequest#CONTROL_MODE 459 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 460 * @see CaptureRequest#SENSOR_FRAME_DURATION 461 * @see CaptureRequest#SENSOR_SENSITIVITY 462 * @see #CONTROL_AE_MODE_OFF 463 * @see #CONTROL_AE_MODE_ON 464 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH 465 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH 466 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE 467 */ 468 public static final Key<Integer> CONTROL_AE_MODE = 469 new Key<Integer>("android.control.aeMode", int.class); 470 471 /** 472 * <p>List of areas to use for 473 * metering</p> 474 * <p>Each area is a rectangle plus weight: xmin, ymin, 475 * xmax, ymax, weight. The rectangle is defined inclusive of the 476 * specified coordinates.</p> 477 * <p>The coordinate system is based on the active pixel array, 478 * with (0,0) being the top-left pixel in the active pixel array, and 479 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 480 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 481 * bottom-right pixel in the active pixel array. The weight 482 * should be nonnegative.</p> 483 * <p>If all regions have 0 weight, then no specific metering area 484 * needs to be used by the HAL. If the metering region is 485 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL 486 * should ignore the sections outside the region and output the 487 * used sections in the frame metadata</p> 488 * 489 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 490 * @see CaptureRequest#SCALER_CROP_REGION 491 */ 492 public static final Key<int[]> CONTROL_AE_REGIONS = 493 new Key<int[]>("android.control.aeRegions", int[].class); 494 495 /** 496 * <p>Range over which fps can be adjusted to 497 * maintain exposure</p> 498 * <p>Only constrains AE algorithm, not manual control 499 * of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p> 500 * 501 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 502 */ 503 public static final Key<int[]> CONTROL_AE_TARGET_FPS_RANGE = 504 new Key<int[]>("android.control.aeTargetFpsRange", int[].class); 505 506 /** 507 * <p>Whether the HAL must trigger precapture 508 * metering.</p> 509 * <p>This entry is normally set to IDLE, or is not 510 * included at all in the request settings. When included and 511 * set to START, the HAL must trigger the autoexposure 512 * precapture metering sequence.</p> 513 * <p>The effect of AE precapture trigger depends on the current 514 * AE mode and state; see the camera HAL device v3 header for 515 * details.</p> 516 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE 517 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START 518 */ 519 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = 520 new Key<Integer>("android.control.aePrecaptureTrigger", int.class); 521 522 /** 523 * <p>Whether AF is currently enabled, and what 524 * mode it is set to</p> 525 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO.</p> 526 * <p>If the lens is controlled by the camera device auto-focus algorithm, 527 * the camera device will report the current AF status in android.control.afState 528 * in result metadata.</p> 529 * 530 * @see CaptureRequest#CONTROL_MODE 531 * @see #CONTROL_AF_MODE_OFF 532 * @see #CONTROL_AF_MODE_AUTO 533 * @see #CONTROL_AF_MODE_MACRO 534 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO 535 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE 536 * @see #CONTROL_AF_MODE_EDOF 537 */ 538 public static final Key<Integer> CONTROL_AF_MODE = 539 new Key<Integer>("android.control.afMode", int.class); 540 541 /** 542 * <p>List of areas to use for focus 543 * estimation</p> 544 * <p>Each area is a rectangle plus weight: xmin, ymin, 545 * xmax, ymax, weight. The rectangle is defined inclusive of the 546 * specified coordinates.</p> 547 * <p>The coordinate system is based on the active pixel array, 548 * with (0,0) being the top-left pixel in the active pixel array, and 549 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 550 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 551 * bottom-right pixel in the active pixel array. The weight 552 * should be nonnegative.</p> 553 * <p>If all regions have 0 weight, then no specific focus area 554 * needs to be used by the HAL. If the focusing region is 555 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL 556 * should ignore the sections outside the region and output the 557 * used sections in the frame metadata</p> 558 * 559 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 560 * @see CaptureRequest#SCALER_CROP_REGION 561 */ 562 public static final Key<int[]> CONTROL_AF_REGIONS = 563 new Key<int[]>("android.control.afRegions", int[].class); 564 565 /** 566 * <p>Whether the HAL must trigger autofocus.</p> 567 * <p>This entry is normally set to IDLE, or is not 568 * included at all in the request settings.</p> 569 * <p>When included and set to START, the HAL must trigger the 570 * autofocus algorithm. The effect of AF trigger depends on the 571 * current AF mode and state; see the camera HAL device v3 572 * header for details. When set to CANCEL, the HAL must cancel 573 * any active trigger, and return to initial AF state.</p> 574 * @see #CONTROL_AF_TRIGGER_IDLE 575 * @see #CONTROL_AF_TRIGGER_START 576 * @see #CONTROL_AF_TRIGGER_CANCEL 577 */ 578 public static final Key<Integer> CONTROL_AF_TRIGGER = 579 new Key<Integer>("android.control.afTrigger", int.class); 580 581 /** 582 * <p>Whether AWB is currently locked to its 583 * latest calculated values</p> 584 * <p>Note that AWB lock is only meaningful for AUTO 585 * mode; in other modes, AWB is already fixed to a specific 586 * setting</p> 587 */ 588 public static final Key<Boolean> CONTROL_AWB_LOCK = 589 new Key<Boolean>("android.control.awbLock", boolean.class); 590 591 /** 592 * <p>Whether AWB is currently setting the color 593 * transform fields, and what its illumination target 594 * is</p> 595 * <p>[BC - AWB lock,AWB modes]</p> 596 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO.</p> 597 * 598 * @see CaptureRequest#CONTROL_MODE 599 * @see #CONTROL_AWB_MODE_OFF 600 * @see #CONTROL_AWB_MODE_AUTO 601 * @see #CONTROL_AWB_MODE_INCANDESCENT 602 * @see #CONTROL_AWB_MODE_FLUORESCENT 603 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT 604 * @see #CONTROL_AWB_MODE_DAYLIGHT 605 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT 606 * @see #CONTROL_AWB_MODE_TWILIGHT 607 * @see #CONTROL_AWB_MODE_SHADE 608 */ 609 public static final Key<Integer> CONTROL_AWB_MODE = 610 new Key<Integer>("android.control.awbMode", int.class); 611 612 /** 613 * <p>List of areas to use for illuminant 614 * estimation</p> 615 * <p>Only used in AUTO mode.</p> 616 * <p>Each area is a rectangle plus weight: xmin, ymin, 617 * xmax, ymax, weight. The rectangle is defined inclusive of the 618 * specified coordinates.</p> 619 * <p>The coordinate system is based on the active pixel array, 620 * with (0,0) being the top-left pixel in the active pixel array, and 621 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 622 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 623 * bottom-right pixel in the active pixel array. The weight 624 * should be nonnegative.</p> 625 * <p>If all regions have 0 weight, then no specific metering area 626 * needs to be used by the HAL. If the metering region is 627 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL 628 * should ignore the sections outside the region and output the 629 * used sections in the frame metadata</p> 630 * 631 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 632 * @see CaptureRequest#SCALER_CROP_REGION 633 */ 634 public static final Key<int[]> CONTROL_AWB_REGIONS = 635 new Key<int[]>("android.control.awbRegions", int[].class); 636 637 /** 638 * <p>Information to 3A routines about the purpose 639 * of this capture, to help decide optimal 3A 640 * strategy</p> 641 * <p>Only used if {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p> 642 * 643 * @see CaptureRequest#CONTROL_MODE 644 * @see #CONTROL_CAPTURE_INTENT_CUSTOM 645 * @see #CONTROL_CAPTURE_INTENT_PREVIEW 646 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE 647 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD 648 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT 649 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG 650 */ 651 public static final Key<Integer> CONTROL_CAPTURE_INTENT = 652 new Key<Integer>("android.control.captureIntent", int.class); 653 654 /** 655 * <p>Whether any special color effect is in use. 656 * Only used if {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</p> 657 * 658 * @see CaptureRequest#CONTROL_MODE 659 * @see #CONTROL_EFFECT_MODE_OFF 660 * @see #CONTROL_EFFECT_MODE_MONO 661 * @see #CONTROL_EFFECT_MODE_NEGATIVE 662 * @see #CONTROL_EFFECT_MODE_SOLARIZE 663 * @see #CONTROL_EFFECT_MODE_SEPIA 664 * @see #CONTROL_EFFECT_MODE_POSTERIZE 665 * @see #CONTROL_EFFECT_MODE_WHITEBOARD 666 * @see #CONTROL_EFFECT_MODE_BLACKBOARD 667 * @see #CONTROL_EFFECT_MODE_AQUA 668 */ 669 public static final Key<Integer> CONTROL_EFFECT_MODE = 670 new Key<Integer>("android.control.effectMode", int.class); 671 672 /** 673 * <p>Overall mode of 3A control 674 * routines</p> 675 * <p>High-level 3A control. When set to OFF, all 3A control 676 * by the HAL is disabled. The application must set the fields for 677 * capture parameters itself.</p> 678 * <p>When set to AUTO, the individual algorithm controls in 679 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> 680 * <p>When set to USE_SCENE_MODE, the individual controls in 681 * android.control.* are mostly disabled, and the HAL implements 682 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) 683 * as it wishes. The HAL scene mode 3A settings are provided by 684 * android.control.sceneModeOverrides.</p> 685 * 686 * @see CaptureRequest#CONTROL_AF_MODE 687 * @see #CONTROL_MODE_OFF 688 * @see #CONTROL_MODE_AUTO 689 * @see #CONTROL_MODE_USE_SCENE_MODE 690 */ 691 public static final Key<Integer> CONTROL_MODE = 692 new Key<Integer>("android.control.mode", int.class); 693 694 /** 695 * <p>Which scene mode is active when 696 * {@link CaptureRequest#CONTROL_MODE android.control.mode} = SCENE_MODE</p> 697 * 698 * @see CaptureRequest#CONTROL_MODE 699 * @see #CONTROL_SCENE_MODE_UNSUPPORTED 700 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY 701 * @see #CONTROL_SCENE_MODE_ACTION 702 * @see #CONTROL_SCENE_MODE_PORTRAIT 703 * @see #CONTROL_SCENE_MODE_LANDSCAPE 704 * @see #CONTROL_SCENE_MODE_NIGHT 705 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT 706 * @see #CONTROL_SCENE_MODE_THEATRE 707 * @see #CONTROL_SCENE_MODE_BEACH 708 * @see #CONTROL_SCENE_MODE_SNOW 709 * @see #CONTROL_SCENE_MODE_SUNSET 710 * @see #CONTROL_SCENE_MODE_STEADYPHOTO 711 * @see #CONTROL_SCENE_MODE_FIREWORKS 712 * @see #CONTROL_SCENE_MODE_SPORTS 713 * @see #CONTROL_SCENE_MODE_PARTY 714 * @see #CONTROL_SCENE_MODE_CANDLELIGHT 715 * @see #CONTROL_SCENE_MODE_BARCODE 716 */ 717 public static final Key<Integer> CONTROL_SCENE_MODE = 718 new Key<Integer>("android.control.sceneMode", int.class); 719 720 /** 721 * <p>Whether video stabilization is 722 * active</p> 723 * <p>If enabled, video stabilization can modify the 724 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream 725 * stabilized</p> 726 * 727 * @see CaptureRequest#SCALER_CROP_REGION 728 */ 729 public static final Key<Boolean> CONTROL_VIDEO_STABILIZATION_MODE = 730 new Key<Boolean>("android.control.videoStabilizationMode", boolean.class); 731 732 /** 733 * <p>Operation mode for edge 734 * enhancement</p> 735 * <p>Edge/sharpness/detail enhancement. OFF means no 736 * enhancement will be applied by the HAL.</p> 737 * <p>FAST/HIGH_QUALITY both mean HAL-determined enhancement 738 * will be applied. HIGH_QUALITY mode indicates that the 739 * HAL should use the highest-quality enhancement algorithms, 740 * even if it slows down capture rate. FAST means the HAL should 741 * not slow down capture rate when applying edge enhancement.</p> 742 * @see #EDGE_MODE_OFF 743 * @see #EDGE_MODE_FAST 744 * @see #EDGE_MODE_HIGH_QUALITY 745 */ 746 public static final Key<Integer> EDGE_MODE = 747 new Key<Integer>("android.edge.mode", int.class); 748 749 /** 750 * <p>Select flash operation mode</p> 751 * @see #FLASH_MODE_OFF 752 * @see #FLASH_MODE_SINGLE 753 * @see #FLASH_MODE_TORCH 754 */ 755 public static final Key<Integer> FLASH_MODE = 756 new Key<Integer>("android.flash.mode", int.class); 757 758 /** 759 * <p>GPS coordinates to include in output JPEG 760 * EXIF</p> 761 */ 762 public static final Key<double[]> JPEG_GPS_COORDINATES = 763 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); 764 765 /** 766 * <p>32 characters describing GPS algorithm to 767 * include in EXIF</p> 768 */ 769 public static final Key<String> JPEG_GPS_PROCESSING_METHOD = 770 new Key<String>("android.jpeg.gpsProcessingMethod", String.class); 771 772 /** 773 * <p>Time GPS fix was made to include in 774 * EXIF</p> 775 */ 776 public static final Key<Long> JPEG_GPS_TIMESTAMP = 777 new Key<Long>("android.jpeg.gpsTimestamp", long.class); 778 779 /** 780 * <p>Orientation of JPEG image to 781 * write</p> 782 */ 783 public static final Key<Integer> JPEG_ORIENTATION = 784 new Key<Integer>("android.jpeg.orientation", int.class); 785 786 /** 787 * <p>Compression quality of the final JPEG 788 * image</p> 789 * <p>85-95 is typical usage range</p> 790 */ 791 public static final Key<Byte> JPEG_QUALITY = 792 new Key<Byte>("android.jpeg.quality", byte.class); 793 794 /** 795 * <p>Compression quality of JPEG 796 * thumbnail</p> 797 */ 798 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = 799 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); 800 801 /** 802 * <p>Resolution of embedded JPEG thumbnail</p> 803 * <p>When set to (0, 0) value, the JPEG EXIF must not contain thumbnail, 804 * but the captured JPEG must still be a valid image.</p> 805 * <p>When a jpeg image capture is issued, the thumbnail size selected should have 806 * the same aspect ratio as the jpeg image.</p> 807 */ 808 public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE = 809 new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class); 810 811 /** 812 * <p>The ratio of lens focal length to the effective 813 * aperture diameter.</p> 814 * <p>This will only be supported on the camera devices that 815 * have variable aperture lens. The aperture value can only be 816 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p> 817 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, 818 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 819 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and android.sensor.frameDuration 820 * to achieve manual exposure control.</p> 821 * <p>The requested aperture value may take several frames to reach the 822 * requested value; the camera device will report the current (intermediate) 823 * aperture size in capture result metadata while the aperture is changing.</p> 824 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of 825 * the ON modes, this will be overridden by the camera device 826 * auto-exposure algorithm, the overridden values are then provided 827 * back to the user in the corresponding result.</p> 828 * 829 * @see CaptureRequest#CONTROL_AE_MODE 830 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES 831 * @see CaptureRequest#SENSOR_SENSITIVITY 832 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 833 */ 834 public static final Key<Float> LENS_APERTURE = 835 new Key<Float>("android.lens.aperture", float.class); 836 837 /** 838 * <p>State of lens neutral density 839 * filter(s)</p> 840 * <p>Will not be supported on most devices. Can only 841 * pick from supported list</p> 842 */ 843 public static final Key<Float> LENS_FILTER_DENSITY = 844 new Key<Float>("android.lens.filterDensity", float.class); 845 846 /** 847 * <p>Lens optical zoom setting</p> 848 * <p>Will not be supported on most devices.</p> 849 */ 850 public static final Key<Float> LENS_FOCAL_LENGTH = 851 new Key<Float>("android.lens.focalLength", float.class); 852 853 /** 854 * <p>Distance to plane of sharpest focus, 855 * measured from frontmost surface of the lens</p> 856 * <p>0 = infinity focus. Used value should be clamped 857 * to (0,minimum focus distance)</p> 858 */ 859 public static final Key<Float> LENS_FOCUS_DISTANCE = 860 new Key<Float>("android.lens.focusDistance", float.class); 861 862 /** 863 * <p>Whether optical image stabilization is 864 * enabled.</p> 865 * <p>Will not be supported on most devices.</p> 866 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF 867 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON 868 */ 869 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = 870 new Key<Integer>("android.lens.opticalStabilizationMode", int.class); 871 872 /** 873 * <p>Mode of operation for the noise reduction 874 * algorithm</p> 875 * <p>Noise filtering control. OFF means no noise reduction 876 * will be applied by the HAL.</p> 877 * <p>FAST/HIGH_QUALITY both mean HAL-determined noise filtering 878 * will be applied. HIGH_QUALITY mode indicates that the HAL 879 * should use the highest-quality noise filtering algorithms, 880 * even if it slows down capture rate. FAST means the HAL should not 881 * slow down capture rate when applying noise filtering.</p> 882 * @see #NOISE_REDUCTION_MODE_OFF 883 * @see #NOISE_REDUCTION_MODE_FAST 884 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY 885 */ 886 public static final Key<Integer> NOISE_REDUCTION_MODE = 887 new Key<Integer>("android.noiseReduction.mode", int.class); 888 889 /** 890 * <p>An application-specified ID for the current 891 * request. Must be maintained unchanged in output 892 * frame</p> 893 * @hide 894 */ 895 public static final Key<Integer> REQUEST_ID = 896 new Key<Integer>("android.request.id", int.class); 897 898 /** 899 * <p>(x, y, width, height).</p> 900 * <p>A rectangle with the top-level corner of (x,y) and size 901 * (width, height). The region of the sensor that is used for 902 * output. Each stream must use this rectangle to produce its 903 * output, cropping to a smaller region if necessary to 904 * maintain the stream's aspect ratio.</p> 905 * <p>HAL2.x uses only (x, y, width)</p> 906 * <p>Any additional per-stream cropping must be done to 907 * maximize the final pixel area of the stream.</p> 908 * <p>For example, if the crop region is set to a 4:3 aspect 909 * ratio, then 4:3 streams should use the exact crop 910 * region. 16:9 streams should further crop vertically 911 * (letterbox).</p> 912 * <p>Conversely, if the crop region is set to a 16:9, then 4:3 913 * outputs should crop horizontally (pillarbox), and 16:9 914 * streams should match exactly. These additional crops must 915 * be centered within the crop region.</p> 916 * <p>The output streams must maintain square pixels at all 917 * times, no matter what the relative aspect ratios of the 918 * crop region and the stream are. Negative values for 919 * corner are allowed for raw output if full pixel array is 920 * larger than active pixel array. Width and height may be 921 * rounded to nearest larger supportable width, especially 922 * for raw output, where only a few fixed scales may be 923 * possible. The width and height of the crop region cannot 924 * be set to be smaller than floor( activeArraySize.width / 925 * android.scaler.maxDigitalZoom ) and floor( 926 * activeArraySize.height / android.scaler.maxDigitalZoom), 927 * respectively.</p> 928 */ 929 public static final Key<android.graphics.Rect> SCALER_CROP_REGION = 930 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); 931 932 /** 933 * <p>Duration each pixel is exposed to 934 * light.</p> 935 * <p>If the sensor can't expose this exact duration, it should shorten the 936 * duration exposed to the nearest possible value (rather than expose longer).</p> 937 * <p>1/10000 - 30 sec range. No bulb mode</p> 938 */ 939 public static final Key<Long> SENSOR_EXPOSURE_TIME = 940 new Key<Long>("android.sensor.exposureTime", long.class); 941 942 /** 943 * <p>Duration from start of frame exposure to 944 * start of next frame exposure</p> 945 * <p>Exposure time has priority, so duration is set to 946 * max(duration, exposure time + overhead)</p> 947 */ 948 public static final Key<Long> SENSOR_FRAME_DURATION = 949 new Key<Long>("android.sensor.frameDuration", long.class); 950 951 /** 952 * <p>Gain applied to image data. Must be 953 * implemented through analog gain only if set to values 954 * below 'maximum analog sensitivity'.</p> 955 * <p>If the sensor can't apply this exact gain, it should lessen the 956 * gain to the nearest possible value (rather than gain more).</p> 957 * <p>ISO 12232:2006 REI method</p> 958 */ 959 public static final Key<Integer> SENSOR_SENSITIVITY = 960 new Key<Integer>("android.sensor.sensitivity", int.class); 961 962 /** 963 * <p>State of the face detector 964 * unit</p> 965 * <p>Whether face detection is enabled, and whether it 966 * should output just the basic fields or the full set of 967 * fields. Value must be one of the 968 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p> 969 * 970 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES 971 * @see #STATISTICS_FACE_DETECT_MODE_OFF 972 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE 973 * @see #STATISTICS_FACE_DETECT_MODE_FULL 974 */ 975 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = 976 new Key<Integer>("android.statistics.faceDetectMode", int.class); 977 978 /** 979 * <p>Whether the HAL needs to output the lens 980 * shading map in output result metadata</p> 981 * <p>When set to ON, 982 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in 983 * the output result metadata.</p> 984 * 985 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP 986 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF 987 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON 988 */ 989 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = 990 new Key<Integer>("android.statistics.lensShadingMapMode", int.class); 991 992 /** 993 * <p>Table mapping blue input values to output 994 * values</p> 995 * <p>Tonemapping / contrast / gamma curve for the blue 996 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p> 997 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> 998 * 999 * @see CaptureRequest#TONEMAP_CURVE_RED 1000 * @see CaptureRequest#TONEMAP_MODE 1001 */ 1002 public static final Key<float[]> TONEMAP_CURVE_BLUE = 1003 new Key<float[]>("android.tonemap.curveBlue", float[].class); 1004 1005 /** 1006 * <p>Table mapping green input values to output 1007 * values</p> 1008 * <p>Tonemapping / contrast / gamma curve for the green 1009 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p> 1010 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> 1011 * 1012 * @see CaptureRequest#TONEMAP_CURVE_RED 1013 * @see CaptureRequest#TONEMAP_MODE 1014 */ 1015 public static final Key<float[]> TONEMAP_CURVE_GREEN = 1016 new Key<float[]>("android.tonemap.curveGreen", float[].class); 1017 1018 /** 1019 * <p>Table mapping red input values to output 1020 * values</p> 1021 * <p>Tonemapping / contrast / gamma curve for the red 1022 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is CONTRAST_CURVE.</p> 1023 * <p>Since the input and output ranges may vary depending on 1024 * the camera pipeline, the input and output pixel values 1025 * are represented by normalized floating-point values 1026 * between 0 and 1, with 0 == black and 1 == white.</p> 1027 * <p>The curve should be linearly interpolated between the 1028 * defined points. The points will be listed in increasing 1029 * order of P_IN. For example, if the array is: [0.0, 0.0, 1030 * 0.3, 0.5, 1.0, 1.0], then the input->output mapping 1031 * for a few sample points would be: 0 -> 0, 0.15 -> 1032 * 0.25, 0.3 -> 0.5, 0.5 -> 0.64</p> 1033 * 1034 * @see CaptureRequest#TONEMAP_MODE 1035 */ 1036 public static final Key<float[]> TONEMAP_CURVE_RED = 1037 new Key<float[]>("android.tonemap.curveRed", float[].class); 1038 1039 /** 1040 * @see #TONEMAP_MODE_CONTRAST_CURVE 1041 * @see #TONEMAP_MODE_FAST 1042 * @see #TONEMAP_MODE_HIGH_QUALITY 1043 */ 1044 public static final Key<Integer> TONEMAP_MODE = 1045 new Key<Integer>("android.tonemap.mode", int.class); 1046 1047 /** 1048 * <p>This LED is nominally used to indicate to the user 1049 * that the camera is powered on and may be streaming images back to the 1050 * Application Processor. In certain rare circumstances, the OS may 1051 * disable this when video is processed locally and not transmitted to 1052 * any untrusted applications.</p> 1053 * <p>In particular, the LED <em>must</em> always be on when the data could be 1054 * transmitted off the device. The LED <em>should</em> always be on whenever 1055 * data is stored locally on the device.</p> 1056 * <p>The LED <em>may</em> be off if a trusted application is using the data that 1057 * doesn't violate the above rules.</p> 1058 * @hide 1059 */ 1060 public static final Key<Boolean> LED_TRANSMIT = 1061 new Key<Boolean>("android.led.transmit", boolean.class); 1062 1063 /** 1064 * <p>Whether black-level compensation is locked 1065 * to its current values, or is free to vary.</p> 1066 * <p>When set to ON, the values used for black-level 1067 * compensation will not change until the lock is set to 1068 * OFF.</p> 1069 * <p>Since changes to certain capture parameters (such as 1070 * exposure time) may require resetting of black level 1071 * compensation, the camera device must report whether setting 1072 * the black level lock was successful in the output result 1073 * metadata.</p> 1074 * <p>For example, if a sequence of requests is as follows:</p> 1075 * <ul> 1076 * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li> 1077 * <li>Request 2: Exposure = 10ms, Black level lock = ON</li> 1078 * <li>Request 3: Exposure = 10ms, Black level lock = ON</li> 1079 * <li>Request 4: Exposure = 20ms, Black level lock = ON</li> 1080 * <li>Request 5: Exposure = 20ms, Black level lock = ON</li> 1081 * <li>Request 6: Exposure = 20ms, Black level lock = ON</li> 1082 * </ul> 1083 * <p>And the exposure change in Request 4 requires the camera 1084 * device to reset the black level offsets, then the output 1085 * result metadata is expected to be:</p> 1086 * <ul> 1087 * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li> 1088 * <li>Result 2: Exposure = 10ms, Black level lock = ON</li> 1089 * <li>Result 3: Exposure = 10ms, Black level lock = ON</li> 1090 * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li> 1091 * <li>Result 5: Exposure = 20ms, Black level lock = ON</li> 1092 * <li>Result 6: Exposure = 20ms, Black level lock = ON</li> 1093 * </ul> 1094 * <p>This indicates to the application that on frame 4, black 1095 * levels were reset due to exposure value changes, and pixel 1096 * values may not be consistent across captures.</p> 1097 * <p>The camera device will maintain the lock to the extent 1098 * possible, only overriding the lock to OFF when changes to 1099 * other request parameters require a black level recalculation 1100 * or reset.</p> 1101 */ 1102 public static final Key<Boolean> BLACK_LEVEL_LOCK = 1103 new Key<Boolean>("android.blackLevel.lock", boolean.class); 1104 1105 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 1106 * End generated code 1107 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ 1108} 1109