CaptureRequest.java revision d928b8c9a0edc7bbfe53b3efabeb9aaa0de205a8
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>The mode control selects how the image data is converted from the 323 * sensor's native color into linear sRGB color.</p> 324 * <p>When auto-white balance is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this 325 * control is overridden by the AWB routine. When AWB is disabled, the 326 * application controls how the color mapping is performed.</p> 327 * <p>We define the expected processing pipeline below. For consistency 328 * across devices, this is always the case with TRANSFORM_MATRIX.</p> 329 * <p>When either FULL or HIGH_QUALITY is used, the camera device may 330 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 331 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the 332 * camera device (in the results) and be roughly correct.</p> 333 * <p>Switching to TRANSFORM_MATRIX and using the data provided from 334 * FAST or HIGH_QUALITY will yield a picture with the same white point 335 * as what was produced by the camera device in the earlier frame.</p> 336 * <p>The expected processing pipeline is as follows:</p> 337 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> 338 * <p>The white balance is encoded by two values, a 4-channel white-balance 339 * gain vector (applied in the Bayer domain), and a 3x3 color transform 340 * matrix (applied after demosaic).</p> 341 * <p>The 4-channel white-balance gains are defined as:</p> 342 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] 343 * </code></pre> 344 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the 345 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. 346 * These may be identical for a given camera device implementation; if 347 * the camera device does not support a separate gain for even/odd green 348 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to 349 * <code>G_even</code> in the output result metadata.</p> 350 * <p>The matrices for color transforms are defined as a 9-entry vector:</p> 351 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] 352 * </code></pre> 353 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, 354 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> 355 * <p>with colors as follows:</p> 356 * <pre><code>r' = I0r + I1g + I2b 357 * g' = I3r + I4g + I5b 358 * b' = I6r + I7g + I8b 359 * </code></pre> 360 * <p>Both the input and output value ranges must match. Overflow/underflow 361 * values are clipped to fit within the range.</p> 362 * 363 * @see CaptureRequest#COLOR_CORRECTION_GAINS 364 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 365 * @see CaptureRequest#CONTROL_AWB_MODE 366 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX 367 * @see #COLOR_CORRECTION_MODE_FAST 368 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY 369 */ 370 public static final Key<Integer> COLOR_CORRECTION_MODE = 371 new Key<Integer>("android.colorCorrection.mode", int.class); 372 373 /** 374 * <p>A color transform matrix to use to transform 375 * from sensor RGB color space to output linear sRGB color space</p> 376 * <p>This matrix is either set by HAL when the request 377 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 378 * directly by the application in the request when the 379 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 380 * <p>In the latter case, the HAL may round the matrix to account 381 * for precision issues; the final rounded matrix should be 382 * reported back in this matrix result metadata.</p> 383 * 384 * @see CaptureRequest#COLOR_CORRECTION_MODE 385 */ 386 public static final Key<Rational[]> COLOR_CORRECTION_TRANSFORM = 387 new Key<Rational[]>("android.colorCorrection.transform", Rational[].class); 388 389 /** 390 * <p>Gains applying to Bayer raw color channels for 391 * white-balance</p> 392 * <p>The 4-channel white-balance gains are defined in 393 * the order of <code>[R G_even G_odd B]</code>, where <code>G_even</code> is the gain 394 * for green pixels on even rows of the output, and <code>G_odd</code> 395 * is the gain for green pixels on the odd rows. if a HAL 396 * does not support a separate gain for even/odd green channels, 397 * it should use the <code>G_even</code> value, and write <code>G_odd</code> equal to 398 * <code>G_even</code> in the output result metadata.</p> 399 * <p>This array is either set by HAL when the request 400 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 401 * directly by the application in the request when the 402 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 403 * <p>The output should be the gains actually applied by the HAL to 404 * the current frame.</p> 405 * 406 * @see CaptureRequest#COLOR_CORRECTION_MODE 407 */ 408 public static final Key<float[]> COLOR_CORRECTION_GAINS = 409 new Key<float[]>("android.colorCorrection.gains", float[].class); 410 411 /** 412 * <p>The desired setting for the camera device's auto-exposure 413 * algorithm's antibanding compensation.</p> 414 * <p>Some kinds of lighting fixtures, such as some fluorescent 415 * lights, flicker at the rate of the power supply frequency 416 * (60Hz or 50Hz, depending on country). While this is 417 * typically not noticeable to a person, it can be visible to 418 * a camera device. If a camera sets its exposure time to the 419 * wrong value, the flicker may become visible in the 420 * viewfinder as flicker or in a final captured image, as a 421 * set of variable-brightness bands across the image.</p> 422 * <p>Therefore, the auto-exposure routines of camera devices 423 * include antibanding routines that ensure that the chosen 424 * exposure value will not cause such banding. The choice of 425 * exposure time depends on the rate of flicker, which the 426 * camera device can detect automatically, or the expected 427 * rate can be selected by the application using this 428 * control.</p> 429 * <p>A given camera device may not support all of the possible 430 * options for the antibanding mode. The 431 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains 432 * the available modes for a given camera device.</p> 433 * <p>The default mode is AUTO, which must be supported by all 434 * camera devices.</p> 435 * <p>If manual exposure control is enabled (by setting 436 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), 437 * then this setting has no effect, and the application must 438 * ensure it selects exposure times that do not cause banding 439 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist 440 * the application in this.</p> 441 * 442 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES 443 * @see CaptureRequest#CONTROL_AE_MODE 444 * @see CaptureRequest#CONTROL_MODE 445 * @see CaptureResult#STATISTICS_SCENE_FLICKER 446 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF 447 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ 448 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ 449 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO 450 */ 451 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = 452 new Key<Integer>("android.control.aeAntibandingMode", int.class); 453 454 /** 455 * <p>Adjustment to AE target image 456 * brightness</p> 457 * <p>For example, if EV step is 0.333, '6' will mean an 458 * exposure compensation of +2 EV; -3 will mean an exposure 459 * compensation of -1</p> 460 */ 461 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = 462 new Key<Integer>("android.control.aeExposureCompensation", int.class); 463 464 /** 465 * <p>Whether AE is currently locked to its latest 466 * calculated values</p> 467 * <p>Note that even when AE is locked, the flash may be 468 * fired if the AE mode is ON_AUTO_FLASH / ON_ALWAYS_FLASH / 469 * ON_AUTO_FLASH_REDEYE.</p> 470 */ 471 public static final Key<Boolean> CONTROL_AE_LOCK = 472 new Key<Boolean>("android.control.aeLock", boolean.class); 473 474 /** 475 * <p>The desired mode for the camera device's 476 * auto-exposure routine.</p> 477 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is 478 * AUTO.</p> 479 * <p>When set to any of the ON modes, the camera device's 480 * auto-exposure routine is enabled, overriding the 481 * application's selected exposure time, sensor sensitivity, 482 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 483 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and 484 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes 485 * is selected, the camera device's flash unit controls are 486 * also overridden.</p> 487 * <p>The FLASH modes are only available if the camera device 488 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> 489 * <p>If flash TORCH mode is desired, this field must be set to 490 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> 491 * <p>When set to any of the ON modes, the values chosen by the 492 * camera device auto-exposure routine for the overridden 493 * fields for a given capture will be available in its 494 * CaptureResult.</p> 495 * 496 * @see CaptureRequest#CONTROL_MODE 497 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 498 * @see CaptureRequest#FLASH_MODE 499 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 500 * @see CaptureRequest#SENSOR_FRAME_DURATION 501 * @see CaptureRequest#SENSOR_SENSITIVITY 502 * @see #CONTROL_AE_MODE_OFF 503 * @see #CONTROL_AE_MODE_ON 504 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH 505 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH 506 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE 507 */ 508 public static final Key<Integer> CONTROL_AE_MODE = 509 new Key<Integer>("android.control.aeMode", int.class); 510 511 /** 512 * <p>List of areas to use for 513 * metering</p> 514 * <p>Each area is a rectangle plus weight: xmin, ymin, 515 * xmax, ymax, weight. The rectangle is defined inclusive of the 516 * specified coordinates.</p> 517 * <p>The coordinate system is based on the active pixel array, 518 * with (0,0) being the top-left pixel in the active pixel array, and 519 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 520 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 521 * bottom-right pixel in the active pixel array. The weight 522 * should be nonnegative.</p> 523 * <p>If all regions have 0 weight, then no specific metering area 524 * needs to be used by the HAL. If the metering region is 525 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL 526 * should ignore the sections outside the region and output the 527 * used sections in the frame metadata</p> 528 * 529 * @see CaptureRequest#SCALER_CROP_REGION 530 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 531 */ 532 public static final Key<int[]> CONTROL_AE_REGIONS = 533 new Key<int[]>("android.control.aeRegions", int[].class); 534 535 /** 536 * <p>Range over which fps can be adjusted to 537 * maintain exposure</p> 538 * <p>Only constrains AE algorithm, not manual control 539 * of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p> 540 * 541 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 542 */ 543 public static final Key<int[]> CONTROL_AE_TARGET_FPS_RANGE = 544 new Key<int[]>("android.control.aeTargetFpsRange", int[].class); 545 546 /** 547 * <p>Whether the camera device will trigger a precapture 548 * metering sequence when it processes this request.</p> 549 * <p>This entry is normally set to IDLE, or is not 550 * included at all in the request settings. When included and 551 * set to START, the camera device will trigger the autoexposure 552 * precapture metering sequence.</p> 553 * <p>The effect of AE precapture trigger depends on the current 554 * AE mode and state; see {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture 555 * state transition details.</p> 556 * 557 * @see CaptureResult#CONTROL_AE_STATE 558 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE 559 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START 560 */ 561 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = 562 new Key<Integer>("android.control.aePrecaptureTrigger", int.class); 563 564 /** 565 * <p>Whether AF is currently enabled, and what 566 * mode it is set to</p> 567 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO.</p> 568 * <p>If the lens is controlled by the camera device auto-focus algorithm, 569 * the camera device will report the current AF status in android.control.afState 570 * in result metadata.</p> 571 * 572 * @see CaptureRequest#CONTROL_MODE 573 * @see #CONTROL_AF_MODE_OFF 574 * @see #CONTROL_AF_MODE_AUTO 575 * @see #CONTROL_AF_MODE_MACRO 576 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO 577 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE 578 * @see #CONTROL_AF_MODE_EDOF 579 */ 580 public static final Key<Integer> CONTROL_AF_MODE = 581 new Key<Integer>("android.control.afMode", int.class); 582 583 /** 584 * <p>List of areas to use for focus 585 * estimation</p> 586 * <p>Each area is a rectangle plus weight: xmin, ymin, 587 * xmax, ymax, weight. The rectangle is defined inclusive of the 588 * specified coordinates.</p> 589 * <p>The coordinate system is based on the active pixel array, 590 * with (0,0) being the top-left pixel in the active pixel array, and 591 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 592 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 593 * bottom-right pixel in the active pixel array. The weight 594 * should be nonnegative.</p> 595 * <p>If all regions have 0 weight, then no specific focus area 596 * needs to be used by the HAL. If the focusing region is 597 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL 598 * should ignore the sections outside the region and output the 599 * used sections in the frame metadata</p> 600 * 601 * @see CaptureRequest#SCALER_CROP_REGION 602 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 603 */ 604 public static final Key<int[]> CONTROL_AF_REGIONS = 605 new Key<int[]>("android.control.afRegions", int[].class); 606 607 /** 608 * <p>Whether the camera device will trigger autofocus for this request.</p> 609 * <p>This entry is normally set to IDLE, or is not 610 * included at all in the request settings.</p> 611 * <p>When included and set to START, the camera device will trigger the 612 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> 613 * <p>When set to CANCEL, the camera device will cancel any active trigger, 614 * and return to its initial AF state.</p> 615 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what that means for each AF mode.</p> 616 * 617 * @see CaptureResult#CONTROL_AF_STATE 618 * @see #CONTROL_AF_TRIGGER_IDLE 619 * @see #CONTROL_AF_TRIGGER_START 620 * @see #CONTROL_AF_TRIGGER_CANCEL 621 */ 622 public static final Key<Integer> CONTROL_AF_TRIGGER = 623 new Key<Integer>("android.control.afTrigger", int.class); 624 625 /** 626 * <p>Whether AWB is currently locked to its 627 * latest calculated values</p> 628 * <p>Note that AWB lock is only meaningful for AUTO 629 * mode; in other modes, AWB is already fixed to a specific 630 * setting</p> 631 */ 632 public static final Key<Boolean> CONTROL_AWB_LOCK = 633 new Key<Boolean>("android.control.awbLock", boolean.class); 634 635 /** 636 * <p>Whether AWB is currently setting the color 637 * transform fields, and what its illumination target 638 * is</p> 639 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> 640 * <p>When set to the ON mode, the camera device's auto white balance 641 * routine is enabled, overriding the application's selected 642 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 643 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> 644 * <p>When set to the OFF mode, the camera device's auto white balance 645 * routine is disabled. The applicantion manually controls the white 646 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, android.colorCorrection.gains 647 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> 648 * <p>When set to any other modes, the camera device's auto white balance 649 * routine is disabled. The camera device uses each particular illumination 650 * target for white balance adjustment.</p> 651 * 652 * @see CaptureRequest#COLOR_CORRECTION_GAINS 653 * @see CaptureRequest#COLOR_CORRECTION_MODE 654 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 655 * @see CaptureRequest#CONTROL_MODE 656 * @see #CONTROL_AWB_MODE_OFF 657 * @see #CONTROL_AWB_MODE_AUTO 658 * @see #CONTROL_AWB_MODE_INCANDESCENT 659 * @see #CONTROL_AWB_MODE_FLUORESCENT 660 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT 661 * @see #CONTROL_AWB_MODE_DAYLIGHT 662 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT 663 * @see #CONTROL_AWB_MODE_TWILIGHT 664 * @see #CONTROL_AWB_MODE_SHADE 665 */ 666 public static final Key<Integer> CONTROL_AWB_MODE = 667 new Key<Integer>("android.control.awbMode", int.class); 668 669 /** 670 * <p>List of areas to use for illuminant 671 * estimation</p> 672 * <p>Only used in AUTO mode.</p> 673 * <p>Each area is a rectangle plus weight: xmin, ymin, 674 * xmax, ymax, weight. The rectangle is defined inclusive of the 675 * specified coordinates.</p> 676 * <p>The coordinate system is based on the active pixel array, 677 * with (0,0) being the top-left pixel in the active pixel array, and 678 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 679 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 680 * bottom-right pixel in the active pixel array. The weight 681 * should be nonnegative.</p> 682 * <p>If all regions have 0 weight, then no specific metering area 683 * needs to be used by the HAL. If the metering region is 684 * outside the current {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, the HAL 685 * should ignore the sections outside the region and output the 686 * used sections in the frame metadata</p> 687 * 688 * @see CaptureRequest#SCALER_CROP_REGION 689 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 690 */ 691 public static final Key<int[]> CONTROL_AWB_REGIONS = 692 new Key<int[]>("android.control.awbRegions", int[].class); 693 694 /** 695 * <p>Information to the camera device 3A (auto-exposure, 696 * auto-focus, auto-white balance) routines about the purpose 697 * of this capture, to help the camera device to decide optimal 3A 698 * strategy.</p> 699 * <p>This control is only effective if <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> 700 * and any 3A routine is active.</p> 701 * 702 * @see CaptureRequest#CONTROL_MODE 703 * @see #CONTROL_CAPTURE_INTENT_CUSTOM 704 * @see #CONTROL_CAPTURE_INTENT_PREVIEW 705 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE 706 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD 707 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT 708 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG 709 */ 710 public static final Key<Integer> CONTROL_CAPTURE_INTENT = 711 new Key<Integer>("android.control.captureIntent", int.class); 712 713 /** 714 * <p>A special color effect to apply.</p> 715 * <p>When this mode is set, a color effect will be applied 716 * to images produced by the camera device. The interpretation 717 * and implementation of these color effects is left to the 718 * implementor of the camera device, and should not be 719 * depended on to be consistent (or present) across all 720 * devices.</p> 721 * <p>A color effect will only be applied if 722 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p> 723 * 724 * @see CaptureRequest#CONTROL_MODE 725 * @see #CONTROL_EFFECT_MODE_OFF 726 * @see #CONTROL_EFFECT_MODE_MONO 727 * @see #CONTROL_EFFECT_MODE_NEGATIVE 728 * @see #CONTROL_EFFECT_MODE_SOLARIZE 729 * @see #CONTROL_EFFECT_MODE_SEPIA 730 * @see #CONTROL_EFFECT_MODE_POSTERIZE 731 * @see #CONTROL_EFFECT_MODE_WHITEBOARD 732 * @see #CONTROL_EFFECT_MODE_BLACKBOARD 733 * @see #CONTROL_EFFECT_MODE_AQUA 734 */ 735 public static final Key<Integer> CONTROL_EFFECT_MODE = 736 new Key<Integer>("android.control.effectMode", int.class); 737 738 /** 739 * <p>Overall mode of 3A control 740 * routines</p> 741 * <p>High-level 3A control. When set to OFF, all 3A control 742 * by the camera device is disabled. The application must set the fields for 743 * capture parameters itself.</p> 744 * <p>When set to AUTO, the individual algorithm controls in 745 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> 746 * <p>When set to USE_SCENE_MODE, the individual controls in 747 * android.control.* are mostly disabled, and the camera device implements 748 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) 749 * as it wishes. The camera device scene mode 3A settings are provided by 750 * android.control.sceneModeOverrides.</p> 751 * 752 * @see CaptureRequest#CONTROL_AF_MODE 753 * @see #CONTROL_MODE_OFF 754 * @see #CONTROL_MODE_AUTO 755 * @see #CONTROL_MODE_USE_SCENE_MODE 756 */ 757 public static final Key<Integer> CONTROL_MODE = 758 new Key<Integer>("android.control.mode", int.class); 759 760 /** 761 * <p>A camera mode optimized for conditions typical in a particular 762 * capture setting.</p> 763 * <p>This is the mode that that is active when 764 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, 765 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, 766 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use.</p> 767 * <p>The interpretation and implementation of these scene modes is left 768 * to the implementor of the camera device. Their behavior will not be 769 * consistent across all devices, and any given device may only implement 770 * a subset of these modes.</p> 771 * 772 * @see CaptureRequest#CONTROL_AE_MODE 773 * @see CaptureRequest#CONTROL_AF_MODE 774 * @see CaptureRequest#CONTROL_AWB_MODE 775 * @see CaptureRequest#CONTROL_MODE 776 * @see #CONTROL_SCENE_MODE_DISABLED 777 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY 778 * @see #CONTROL_SCENE_MODE_ACTION 779 * @see #CONTROL_SCENE_MODE_PORTRAIT 780 * @see #CONTROL_SCENE_MODE_LANDSCAPE 781 * @see #CONTROL_SCENE_MODE_NIGHT 782 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT 783 * @see #CONTROL_SCENE_MODE_THEATRE 784 * @see #CONTROL_SCENE_MODE_BEACH 785 * @see #CONTROL_SCENE_MODE_SNOW 786 * @see #CONTROL_SCENE_MODE_SUNSET 787 * @see #CONTROL_SCENE_MODE_STEADYPHOTO 788 * @see #CONTROL_SCENE_MODE_FIREWORKS 789 * @see #CONTROL_SCENE_MODE_SPORTS 790 * @see #CONTROL_SCENE_MODE_PARTY 791 * @see #CONTROL_SCENE_MODE_CANDLELIGHT 792 * @see #CONTROL_SCENE_MODE_BARCODE 793 */ 794 public static final Key<Integer> CONTROL_SCENE_MODE = 795 new Key<Integer>("android.control.sceneMode", int.class); 796 797 /** 798 * <p>Whether video stabilization is 799 * active</p> 800 * <p>If enabled, video stabilization can modify the 801 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream 802 * stabilized</p> 803 * 804 * @see CaptureRequest#SCALER_CROP_REGION 805 */ 806 public static final Key<Boolean> CONTROL_VIDEO_STABILIZATION_MODE = 807 new Key<Boolean>("android.control.videoStabilizationMode", boolean.class); 808 809 /** 810 * <p>Operation mode for edge 811 * enhancement</p> 812 * <p>Edge/sharpness/detail enhancement. OFF means no 813 * enhancement will be applied by the HAL.</p> 814 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement 815 * will be applied. HIGH_QUALITY mode indicates that the 816 * camera device will use the highest-quality enhancement algorithms, 817 * even if it slows down capture rate. FAST means the camera device will 818 * not slow down capture rate when applying edge enhancement.</p> 819 * @see #EDGE_MODE_OFF 820 * @see #EDGE_MODE_FAST 821 * @see #EDGE_MODE_HIGH_QUALITY 822 */ 823 public static final Key<Integer> EDGE_MODE = 824 new Key<Integer>("android.edge.mode", int.class); 825 826 /** 827 * <p>The desired mode for for the camera device's flash control.</p> 828 * <p>This control is only effective when flash unit is available 829 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} != 0</code>).</p> 830 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. 831 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, 832 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> 833 * <p>When set to OFF, the camera device will not fire flash for this capture.</p> 834 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera 835 * device's auto-exposure routine's result. When used in still capture case, this 836 * control should be used along with AE precapture metering sequence 837 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> 838 * <p>When set to TORCH, the flash will be on continuously. This mode can be used 839 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> 840 * 841 * @see CaptureRequest#CONTROL_AE_MODE 842 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 843 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 844 * @see #FLASH_MODE_OFF 845 * @see #FLASH_MODE_SINGLE 846 * @see #FLASH_MODE_TORCH 847 */ 848 public static final Key<Integer> FLASH_MODE = 849 new Key<Integer>("android.flash.mode", int.class); 850 851 /** 852 * <p>GPS coordinates to include in output JPEG 853 * EXIF</p> 854 */ 855 public static final Key<double[]> JPEG_GPS_COORDINATES = 856 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); 857 858 /** 859 * <p>32 characters describing GPS algorithm to 860 * include in EXIF</p> 861 */ 862 public static final Key<String> JPEG_GPS_PROCESSING_METHOD = 863 new Key<String>("android.jpeg.gpsProcessingMethod", String.class); 864 865 /** 866 * <p>Time GPS fix was made to include in 867 * EXIF</p> 868 */ 869 public static final Key<Long> JPEG_GPS_TIMESTAMP = 870 new Key<Long>("android.jpeg.gpsTimestamp", long.class); 871 872 /** 873 * <p>Orientation of JPEG image to 874 * write</p> 875 */ 876 public static final Key<Integer> JPEG_ORIENTATION = 877 new Key<Integer>("android.jpeg.orientation", int.class); 878 879 /** 880 * <p>Compression quality of the final JPEG 881 * image</p> 882 * <p>85-95 is typical usage range</p> 883 */ 884 public static final Key<Byte> JPEG_QUALITY = 885 new Key<Byte>("android.jpeg.quality", byte.class); 886 887 /** 888 * <p>Compression quality of JPEG 889 * thumbnail</p> 890 */ 891 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = 892 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); 893 894 /** 895 * <p>Resolution of embedded JPEG thumbnail</p> 896 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, 897 * but the captured JPEG will still be a valid image.</p> 898 * <p>When a jpeg image capture is issued, the thumbnail size selected should have 899 * the same aspect ratio as the jpeg image.</p> 900 */ 901 public static final Key<android.hardware.camera2.Size> JPEG_THUMBNAIL_SIZE = 902 new Key<android.hardware.camera2.Size>("android.jpeg.thumbnailSize", android.hardware.camera2.Size.class); 903 904 /** 905 * <p>The ratio of lens focal length to the effective 906 * aperture diameter.</p> 907 * <p>This will only be supported on the camera devices that 908 * have variable aperture lens. The aperture value can only be 909 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p> 910 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, 911 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 912 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and android.sensor.frameDuration 913 * to achieve manual exposure control.</p> 914 * <p>The requested aperture value may take several frames to reach the 915 * requested value; the camera device will report the current (intermediate) 916 * aperture size in capture result metadata while the aperture is changing.</p> 917 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of 918 * the ON modes, this will be overridden by the camera device 919 * auto-exposure algorithm, the overridden values are then provided 920 * back to the user in the corresponding result.</p> 921 * 922 * @see CaptureRequest#CONTROL_AE_MODE 923 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES 924 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 925 * @see CaptureRequest#SENSOR_SENSITIVITY 926 */ 927 public static final Key<Float> LENS_APERTURE = 928 new Key<Float>("android.lens.aperture", float.class); 929 930 /** 931 * <p>State of lens neutral density filter(s).</p> 932 * <p>This will not be supported on most camera devices. On devices 933 * where this is supported, this may only be set to one of the 934 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p> 935 * <p>Lens filters are typically used to lower the amount of light the 936 * sensor is exposed to (measured in steps of EV). As used here, an EV 937 * step is the standard logarithmic representation, which are 938 * non-negative, and inversely proportional to the amount of light 939 * hitting the sensor. For example, setting this to 0 would result 940 * in no reduction of the incoming light, and setting this to 2 would 941 * mean that the filter is set to reduce incoming light by two stops 942 * (allowing 1/4 of the prior amount of light to the sensor).</p> 943 * 944 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES 945 */ 946 public static final Key<Float> LENS_FILTER_DENSITY = 947 new Key<Float>("android.lens.filterDensity", float.class); 948 949 /** 950 * <p>The current lens focal length; used for optical zoom.</p> 951 * <p>This setting controls the physical focal length of the camera 952 * device's lens. Changing the focal length changes the field of 953 * view of the camera device, and is usually used for optical zoom.</p> 954 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this 955 * setting won't be applied instantaneously, and it may take several 956 * frames before the lens can move to the requested focal length. 957 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will 958 * be set to MOVING.</p> 959 * <p>This is expected not to be supported on most devices.</p> 960 * 961 * @see CaptureRequest#LENS_APERTURE 962 * @see CaptureRequest#LENS_FOCUS_DISTANCE 963 * @see CaptureResult#LENS_STATE 964 */ 965 public static final Key<Float> LENS_FOCAL_LENGTH = 966 new Key<Float>("android.lens.focalLength", float.class); 967 968 /** 969 * <p>Distance to plane of sharpest focus, 970 * measured from frontmost surface of the lens</p> 971 * <p>0 = infinity focus. Used value should be clamped 972 * to (0,minimum focus distance)</p> 973 */ 974 public static final Key<Float> LENS_FOCUS_DISTANCE = 975 new Key<Float>("android.lens.focusDistance", float.class); 976 977 /** 978 * <p>Sets whether the camera device uses optical image stabilization (OIS) 979 * when capturing images.</p> 980 * <p>OIS is used to compensate for motion blur due to small movements of 981 * the camera during capture. Unlike digital image stabilization, OIS makes 982 * use of mechanical elements to stabilize the camera sensor, and thus 983 * allows for longer exposure times before camera shake becomes 984 * apparent.</p> 985 * <p>This is not expected to be supported on most devices.</p> 986 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF 987 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON 988 */ 989 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = 990 new Key<Integer>("android.lens.opticalStabilizationMode", int.class); 991 992 /** 993 * <p>Mode of operation for the noise reduction 994 * algorithm</p> 995 * <p>Noise filtering control. OFF means no noise reduction 996 * will be applied by the HAL.</p> 997 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering 998 * will be applied. HIGH_QUALITY mode indicates that the camera device 999 * will use the highest-quality noise filtering algorithms, 1000 * even if it slows down capture rate. FAST means the camera device should not 1001 * slow down capture rate when applying noise filtering.</p> 1002 * @see #NOISE_REDUCTION_MODE_OFF 1003 * @see #NOISE_REDUCTION_MODE_FAST 1004 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY 1005 */ 1006 public static final Key<Integer> NOISE_REDUCTION_MODE = 1007 new Key<Integer>("android.noiseReduction.mode", int.class); 1008 1009 /** 1010 * <p>An application-specified ID for the current 1011 * request. Must be maintained unchanged in output 1012 * frame</p> 1013 * @hide 1014 */ 1015 public static final Key<Integer> REQUEST_ID = 1016 new Key<Integer>("android.request.id", int.class); 1017 1018 /** 1019 * <p>(x, y, width, height).</p> 1020 * <p>A rectangle with the top-level corner of (x,y) and size 1021 * (width, height). The region of the sensor that is used for 1022 * output. Each stream must use this rectangle to produce its 1023 * output, cropping to a smaller region if necessary to 1024 * maintain the stream's aspect ratio.</p> 1025 * <p>HAL2.x uses only (x, y, width)</p> 1026 * <p>Any additional per-stream cropping must be done to 1027 * maximize the final pixel area of the stream.</p> 1028 * <p>For example, if the crop region is set to a 4:3 aspect 1029 * ratio, then 4:3 streams should use the exact crop 1030 * region. 16:9 streams should further crop vertically 1031 * (letterbox).</p> 1032 * <p>Conversely, if the crop region is set to a 16:9, then 4:3 1033 * outputs should crop horizontally (pillarbox), and 16:9 1034 * streams should match exactly. These additional crops must 1035 * be centered within the crop region.</p> 1036 * <p>The output streams must maintain square pixels at all 1037 * times, no matter what the relative aspect ratios of the 1038 * crop region and the stream are. Negative values for 1039 * corner are allowed for raw output if full pixel array is 1040 * larger than active pixel array. Width and height may be 1041 * rounded to nearest larger supportable width, especially 1042 * for raw output, where only a few fixed scales may be 1043 * possible. The width and height of the crop region cannot 1044 * be set to be smaller than floor( activeArraySize.width / 1045 * android.scaler.maxDigitalZoom ) and floor( 1046 * activeArraySize.height / android.scaler.maxDigitalZoom), 1047 * respectively.</p> 1048 */ 1049 public static final Key<android.graphics.Rect> SCALER_CROP_REGION = 1050 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); 1051 1052 /** 1053 * <p>Duration each pixel is exposed to 1054 * light.</p> 1055 * <p>If the sensor can't expose this exact duration, it should shorten the 1056 * duration exposed to the nearest possible value (rather than expose longer).</p> 1057 * <p>1/10000 - 30 sec range. No bulb mode</p> 1058 */ 1059 public static final Key<Long> SENSOR_EXPOSURE_TIME = 1060 new Key<Long>("android.sensor.exposureTime", long.class); 1061 1062 /** 1063 * <p>Duration from start of frame exposure to 1064 * start of next frame exposure.</p> 1065 * <p>The maximum frame rate that can be supported by a camera subsystem is 1066 * a function of many factors:</p> 1067 * <ul> 1068 * <li>Requested resolutions of output image streams</li> 1069 * <li>Availability of binning / skipping modes on the imager</li> 1070 * <li>The bandwidth of the imager interface</li> 1071 * <li>The bandwidth of the various ISP processing blocks</li> 1072 * </ul> 1073 * <p>Since these factors can vary greatly between different ISPs and 1074 * sensors, the camera abstraction tries to represent the bandwidth 1075 * restrictions with as simple a model as possible.</p> 1076 * <p>The model presented has the following characteristics:</p> 1077 * <ul> 1078 * <li>The image sensor is always configured to output the smallest 1079 * resolution possible given the application's requested output stream 1080 * sizes. The smallest resolution is defined as being at least as large 1081 * as the largest requested output stream size; the camera pipeline must 1082 * never digitally upsample sensor data when the crop region covers the 1083 * whole sensor. In general, this means that if only small output stream 1084 * resolutions are configured, the sensor can provide a higher frame 1085 * rate.</li> 1086 * <li>Since any request may use any or all the currently configured 1087 * output streams, the sensor and ISP must be configured to support 1088 * scaling a single capture to all the streams at the same time. This 1089 * means the camera pipeline must be ready to produce the largest 1090 * requested output size without any delay. Therefore, the overall 1091 * frame rate of a given configured stream set is governed only by the 1092 * largest requested stream resolution.</li> 1093 * <li>Using more than one output stream in a request does not affect the 1094 * frame duration.</li> 1095 * <li>JPEG streams act like processed YUV streams in requests for which 1096 * they are not included; in requests in which they are directly 1097 * referenced, they act as JPEG streams. This is because supporting a 1098 * JPEG stream requires the underlying YUV data to always be ready for 1099 * use by a JPEG encoder, but the encoder will only be used (and impact 1100 * frame duration) on requests that actually reference a JPEG stream.</li> 1101 * <li>The JPEG processor can run concurrently to the rest of the camera 1102 * pipeline, but cannot process more than 1 capture at a time.</li> 1103 * </ul> 1104 * <p>The necessary information for the application, given the model above, 1105 * is provided via the android.scaler.available*MinDurations fields. 1106 * These are used to determine the maximum frame rate / minimum frame 1107 * duration that is possible for a given stream configuration.</p> 1108 * <p>Specifically, the application can use the following rules to 1109 * determine the minimum frame duration it can request from the HAL 1110 * device:</p> 1111 * <ol> 1112 * <li>Given the application's currently configured set of output 1113 * streams, <code>S</code>, divide them into three sets: streams in a JPEG format 1114 * <code>SJ</code>, streams in a raw sensor format <code>SR</code>, and the rest ('processed') 1115 * <code>SP</code>.</li> 1116 * <li>For each subset of streams, find the largest resolution (by pixel 1117 * count) in the subset. This gives (at most) three resolutions <code>RJ</code>, 1118 * <code>RR</code>, and <code>RP</code>.</li> 1119 * <li>If <code>RJ</code> is greater than <code>RP</code>, set <code>RP</code> equal to <code>RJ</code>. If there is 1120 * no exact match for <code>RP == RJ</code> (in particular there isn't an available 1121 * processed resolution at the same size as <code>RJ</code>), then set <code>RP</code> equal 1122 * to the smallest processed resolution that is larger than <code>RJ</code>. If 1123 * there are no processed resolutions larger than <code>RJ</code>, then set <code>RJ</code> to 1124 * the processed resolution closest to <code>RJ</code>.</li> 1125 * <li>If <code>RP</code> is greater than <code>RR</code>, set <code>RR</code> equal to <code>RP</code>. If there is 1126 * no exact match for <code>RR == RP</code> (in particular there isn't an available 1127 * raw resolution at the same size as <code>RP</code>), then set <code>RR</code> equal to 1128 * or to the smallest raw resolution that is larger than <code>RP</code>. If 1129 * there are no raw resolutions larger than <code>RP</code>, then set <code>RR</code> to 1130 * the raw resolution closest to <code>RP</code>.</li> 1131 * <li>Look up the matching minimum frame durations in the property lists 1132 * {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_MIN_DURATIONS android.scaler.availableJpegMinDurations}, 1133 * android.scaler.availableRawMinDurations, and 1134 * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS android.scaler.availableProcessedMinDurations}. This gives three 1135 * minimum frame durations <code>FJ</code>, <code>FR</code>, and <code>FP</code>.</li> 1136 * <li>If a stream of requests do not use a JPEG stream, then the minimum 1137 * supported frame duration for each request is <code>max(FR, FP)</code>.</li> 1138 * <li>If a stream of requests all use the JPEG stream, then the minimum 1139 * supported frame duration for each request is <code>max(FR, FP, FJ)</code>.</li> 1140 * <li>If a mix of JPEG-using and non-JPEG-using requests is submitted by 1141 * the application, then the HAL will have to delay JPEG-using requests 1142 * whenever the JPEG encoder is still busy processing an older capture. 1143 * This will happen whenever a JPEG-using request starts capture less 1144 * than <code>FJ</code> <em>ns</em> after a previous JPEG-using request. The minimum 1145 * supported frame duration will vary between the values calculated in 1146 * #6 and #7.</li> 1147 * </ol> 1148 * 1149 * @see CameraCharacteristics#SCALER_AVAILABLE_JPEG_MIN_DURATIONS 1150 * @see CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS 1151 */ 1152 public static final Key<Long> SENSOR_FRAME_DURATION = 1153 new Key<Long>("android.sensor.frameDuration", long.class); 1154 1155 /** 1156 * <p>Gain applied to image data. Must be 1157 * implemented through analog gain only if set to values 1158 * below 'maximum analog sensitivity'.</p> 1159 * <p>If the sensor can't apply this exact gain, it should lessen the 1160 * gain to the nearest possible value (rather than gain more).</p> 1161 * <p>ISO 12232:2006 REI method</p> 1162 */ 1163 public static final Key<Integer> SENSOR_SENSITIVITY = 1164 new Key<Integer>("android.sensor.sensitivity", int.class); 1165 1166 /** 1167 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern 1168 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> 1169 * <p>Each color channel is treated as an unsigned 32-bit integer. 1170 * The camera device then uses the most significant X bits 1171 * that correspond to how many bits are in its Bayer raw sensor 1172 * output.</p> 1173 * <p>For example, a sensor with RAW10 Bayer output would use the 1174 * 10 most significant bits from each color channel.</p> 1175 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1176 * 1177 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE 1178 */ 1179 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = 1180 new Key<int[]>("android.sensor.testPatternData", int[].class); 1181 1182 /** 1183 * <p>When enabled, the sensor sends a test pattern instead of 1184 * doing a real exposure from the camera.</p> 1185 * <p>When a test pattern is enabled, all manual sensor controls specified 1186 * by android.sensor.* should be ignored. All other controls should 1187 * work as normal.</p> 1188 * <p>For example, if manual flash is enabled, flash firing should still 1189 * occur (and that the test pattern remain unmodified, since the flash 1190 * would not actually affect it).</p> 1191 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1192 * @see #SENSOR_TEST_PATTERN_MODE_OFF 1193 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR 1194 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS 1195 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY 1196 * @see #SENSOR_TEST_PATTERN_MODE_PN9 1197 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 1198 */ 1199 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = 1200 new Key<Integer>("android.sensor.testPatternMode", int.class); 1201 1202 /** 1203 * <p>Quality of lens shading correction applied 1204 * to the image data.</p> 1205 * <p>When set to OFF mode, no lens shading correction will be applied by the 1206 * camera device, and an identity lens shading map data will be provided 1207 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens 1208 * shading map with size specified as <code>{@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize} = [ 4, 3 ]</code>, 1209 * the output {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} for this case will be an identity map 1210 * shown below:</p> 1211 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1212 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1213 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1214 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1215 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1216 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] 1217 * </code></pre> 1218 * <p>When set to other modes, lens shading correction will be applied by the 1219 * camera device. Applications can request lens shading map data by setting 1220 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide 1221 * lens shading map data in {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap}, with size specified 1222 * by {@link CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE android.lens.info.shadingMapSize}.</p> 1223 * 1224 * @see CameraCharacteristics#LENS_INFO_SHADING_MAP_SIZE 1225 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP 1226 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 1227 * @see #SHADING_MODE_OFF 1228 * @see #SHADING_MODE_FAST 1229 * @see #SHADING_MODE_HIGH_QUALITY 1230 * @hide 1231 */ 1232 public static final Key<Integer> SHADING_MODE = 1233 new Key<Integer>("android.shading.mode", int.class); 1234 1235 /** 1236 * <p>State of the face detector 1237 * unit</p> 1238 * <p>Whether face detection is enabled, and whether it 1239 * should output just the basic fields or the full set of 1240 * fields. Value must be one of the 1241 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p> 1242 * 1243 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES 1244 * @see #STATISTICS_FACE_DETECT_MODE_OFF 1245 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE 1246 * @see #STATISTICS_FACE_DETECT_MODE_FULL 1247 */ 1248 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = 1249 new Key<Integer>("android.statistics.faceDetectMode", int.class); 1250 1251 /** 1252 * <p>Whether the HAL needs to output the lens 1253 * shading map in output result metadata</p> 1254 * <p>When set to ON, 1255 * {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} must be provided in 1256 * the output result metadata.</p> 1257 * 1258 * @see CaptureResult#STATISTICS_LENS_SHADING_MAP 1259 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF 1260 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON 1261 */ 1262 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = 1263 new Key<Integer>("android.statistics.lensShadingMapMode", int.class); 1264 1265 /** 1266 * <p>Tonemapping / contrast / gamma curve for the blue 1267 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1268 * CONTRAST_CURVE.</p> 1269 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> 1270 * 1271 * @see CaptureRequest#TONEMAP_CURVE_RED 1272 * @see CaptureRequest#TONEMAP_MODE 1273 */ 1274 public static final Key<float[]> TONEMAP_CURVE_BLUE = 1275 new Key<float[]>("android.tonemap.curveBlue", float[].class); 1276 1277 /** 1278 * <p>Tonemapping / contrast / gamma curve for the green 1279 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1280 * CONTRAST_CURVE.</p> 1281 * <p>See {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} for more details.</p> 1282 * 1283 * @see CaptureRequest#TONEMAP_CURVE_RED 1284 * @see CaptureRequest#TONEMAP_MODE 1285 */ 1286 public static final Key<float[]> TONEMAP_CURVE_GREEN = 1287 new Key<float[]>("android.tonemap.curveGreen", float[].class); 1288 1289 /** 1290 * <p>Tonemapping / contrast / gamma curve for the red 1291 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1292 * CONTRAST_CURVE.</p> 1293 * <p>Each channel's curve is defined by an array of control points:</p> 1294 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = 1295 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] 1296 * 2 &lt;= N &lt;= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 1297 * <p>These are sorted in order of increasing <code>Pin</code>; it is always 1298 * guaranteed that input values 0.0 and 1.0 are included in the list to 1299 * define a complete mapping. For input values between control points, 1300 * the camera device must linearly interpolate between the control 1301 * points.</p> 1302 * <p>Each curve can have an independent number of points, and the number 1303 * of points can be less than max (that is, the request doesn't have to 1304 * always provide a curve with number of points equivalent to 1305 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 1306 * <p>A few examples, and their corresponding graphical mappings; these 1307 * only specify the red channel and the precision is limited to 4 1308 * digits, for conciseness.</p> 1309 * <p>Linear mapping:</p> 1310 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 0, 1.0, 1.0 ] 1311 * </code></pre> 1312 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 1313 * <p>Invert mapping:</p> 1314 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 0, 1.0, 1.0, 0 ] 1315 * </code></pre> 1316 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 1317 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 1318 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 1319 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, 1320 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, 1321 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, 1322 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] 1323 * </code></pre> 1324 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 1325 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 1326 * <pre><code>{@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed} = [ 1327 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, 1328 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, 1329 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, 1330 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] 1331 * </code></pre> 1332 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 1333 * 1334 * @see CaptureRequest#TONEMAP_CURVE_RED 1335 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 1336 * @see CaptureRequest#TONEMAP_MODE 1337 */ 1338 public static final Key<float[]> TONEMAP_CURVE_RED = 1339 new Key<float[]>("android.tonemap.curveRed", float[].class); 1340 1341 /** 1342 * <p>High-level global contrast/gamma/tonemapping control.</p> 1343 * <p>When switching to an application-defined contrast curve by setting 1344 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined 1345 * per-channel with a set of <code>(in, out)</code> points that specify the 1346 * mapping from input high-bit-depth pixel value to the output 1347 * low-bit-depth value. Since the actual pixel ranges of both input 1348 * and output may change depending on the camera pipeline, the values 1349 * are specified by normalized floating-point numbers.</p> 1350 * <p>More-complex color mapping operations such as 3D color look-up 1351 * tables, selective chroma enhancement, or other non-linear color 1352 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1353 * CONTRAST_CURVE.</p> 1354 * <p>When using either FAST or HIGH_QUALITY, the camera device will 1355 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed}, 1356 * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, and {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}. 1357 * These values are always available, and as close as possible to the 1358 * actually used nonlinear/nonglobal transforms.</p> 1359 * <p>If a request is sent with TRANSFORM_MATRIX with the camera device's 1360 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be 1361 * roughly the same.</p> 1362 * 1363 * @see CaptureRequest#TONEMAP_CURVE_BLUE 1364 * @see CaptureRequest#TONEMAP_CURVE_GREEN 1365 * @see CaptureRequest#TONEMAP_CURVE_RED 1366 * @see CaptureRequest#TONEMAP_MODE 1367 * @see #TONEMAP_MODE_CONTRAST_CURVE 1368 * @see #TONEMAP_MODE_FAST 1369 * @see #TONEMAP_MODE_HIGH_QUALITY 1370 */ 1371 public static final Key<Integer> TONEMAP_MODE = 1372 new Key<Integer>("android.tonemap.mode", int.class); 1373 1374 /** 1375 * <p>This LED is nominally used to indicate to the user 1376 * that the camera is powered on and may be streaming images back to the 1377 * Application Processor. In certain rare circumstances, the OS may 1378 * disable this when video is processed locally and not transmitted to 1379 * any untrusted applications.</p> 1380 * <p>In particular, the LED <em>must</em> always be on when the data could be 1381 * transmitted off the device. The LED <em>should</em> always be on whenever 1382 * data is stored locally on the device.</p> 1383 * <p>The LED <em>may</em> be off if a trusted application is using the data that 1384 * doesn't violate the above rules.</p> 1385 * @hide 1386 */ 1387 public static final Key<Boolean> LED_TRANSMIT = 1388 new Key<Boolean>("android.led.transmit", boolean.class); 1389 1390 /** 1391 * <p>Whether black-level compensation is locked 1392 * to its current values, or is free to vary.</p> 1393 * <p>When set to ON, the values used for black-level 1394 * compensation will not change until the lock is set to 1395 * OFF.</p> 1396 * <p>Since changes to certain capture parameters (such as 1397 * exposure time) may require resetting of black level 1398 * compensation, the camera device must report whether setting 1399 * the black level lock was successful in the output result 1400 * metadata.</p> 1401 * <p>For example, if a sequence of requests is as follows:</p> 1402 * <ul> 1403 * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li> 1404 * <li>Request 2: Exposure = 10ms, Black level lock = ON</li> 1405 * <li>Request 3: Exposure = 10ms, Black level lock = ON</li> 1406 * <li>Request 4: Exposure = 20ms, Black level lock = ON</li> 1407 * <li>Request 5: Exposure = 20ms, Black level lock = ON</li> 1408 * <li>Request 6: Exposure = 20ms, Black level lock = ON</li> 1409 * </ul> 1410 * <p>And the exposure change in Request 4 requires the camera 1411 * device to reset the black level offsets, then the output 1412 * result metadata is expected to be:</p> 1413 * <ul> 1414 * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li> 1415 * <li>Result 2: Exposure = 10ms, Black level lock = ON</li> 1416 * <li>Result 3: Exposure = 10ms, Black level lock = ON</li> 1417 * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li> 1418 * <li>Result 5: Exposure = 20ms, Black level lock = ON</li> 1419 * <li>Result 6: Exposure = 20ms, Black level lock = ON</li> 1420 * </ul> 1421 * <p>This indicates to the application that on frame 4, black 1422 * levels were reset due to exposure value changes, and pixel 1423 * values may not be consistent across captures.</p> 1424 * <p>The camera device will maintain the lock to the extent 1425 * possible, only overriding the lock to OFF when changes to 1426 * other request parameters require a black level recalculation 1427 * or reset.</p> 1428 */ 1429 public static final Key<Boolean> BLACK_LEVEL_LOCK = 1430 new Key<Boolean>("android.blackLevel.lock", boolean.class); 1431 1432 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 1433 * End generated code 1434 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ 1435} 1436