CaptureRequest.java revision e600d6ad60373821472e6338792109fa3103f7e2
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.CameraCharacteristics.Key; 20import android.hardware.camera2.impl.CameraMetadataNative; 21import android.hardware.camera2.utils.TypeReference; 22import android.os.Parcel; 23import android.os.Parcelable; 24import android.util.Rational; 25import android.view.Surface; 26 27import java.util.Collection; 28import java.util.Collections; 29import java.util.HashSet; 30import java.util.List; 31import java.util.Objects; 32 33 34/** 35 * <p>An immutable package of settings and outputs needed to capture a single 36 * image from the camera device.</p> 37 * 38 * <p>Contains the configuration for the capture hardware (sensor, lens, flash), 39 * the processing pipeline, the control algorithms, and the output buffers. Also 40 * contains the list of target Surfaces to send image data to for this 41 * capture.</p> 42 * 43 * <p>CaptureRequests can be created by using a {@link Builder} instance, 44 * obtained by calling {@link CameraDevice#createCaptureRequest}</p> 45 * 46 * <p>CaptureRequests are given to {@link CameraCaptureSession#capture} or 47 * {@link CameraCaptureSession#setRepeatingRequest} to capture images from a camera.</p> 48 * 49 * <p>Each request can specify a different subset of target Surfaces for the 50 * camera to send the captured data to. All the surfaces used in a request must 51 * be part of the surface list given to the last call to 52 * {@link CameraDevice#createCaptureSession}, when the request is submitted to the 53 * session.</p> 54 * 55 * <p>For example, a request meant for repeating preview might only include the 56 * Surface for the preview SurfaceView or SurfaceTexture, while a 57 * high-resolution still capture would also include a Surface from a ImageReader 58 * configured for high-resolution JPEG images.</p> 59 * 60 * @see CameraDevice#capture 61 * @see CameraDevice#setRepeatingRequest 62 * @see CameraDevice#createCaptureRequest 63 */ 64public final class CaptureRequest extends CameraMetadata<CaptureRequest.Key<?>> 65 implements Parcelable { 66 67 /** 68 * A {@code Key} is used to do capture request field lookups with 69 * {@link CaptureResult#get} or to set fields with 70 * {@link CaptureRequest.Builder#set(Key, Object)}. 71 * 72 * <p>For example, to set the crop rectangle for the next capture: 73 * <code><pre> 74 * Rect cropRectangle = new Rect(0, 0, 640, 480); 75 * captureRequestBuilder.set(SCALER_CROP_REGION, cropRectangle); 76 * </pre></code> 77 * </p> 78 * 79 * <p>To enumerate over all possible keys for {@link CaptureResult}, see 80 * {@link CameraCharacteristics#getAvailableCaptureResultKeys}.</p> 81 * 82 * @see CaptureResult#get 83 * @see CameraCharacteristics#getAvailableCaptureResultKeys 84 */ 85 public final static class Key<T> { 86 private final CameraMetadataNative.Key<T> mKey; 87 88 /** 89 * Visible for testing and vendor extensions only. 90 * 91 * @hide 92 */ 93 public Key(String name, Class<T> type) { 94 mKey = new CameraMetadataNative.Key<T>(name, type); 95 } 96 97 /** 98 * Visible for testing and vendor extensions only. 99 * 100 * @hide 101 */ 102 public Key(String name, TypeReference<T> typeReference) { 103 mKey = new CameraMetadataNative.Key<T>(name, typeReference); 104 } 105 106 /** 107 * Return a camelCase, period separated name formatted like: 108 * {@code "root.section[.subsections].name"}. 109 * 110 * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."}; 111 * keys that are device/platform-specific are prefixed with {@code "com."}.</p> 112 * 113 * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would 114 * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device 115 * specific key might look like {@code "com.google.nexus.data.private"}.</p> 116 * 117 * @return String representation of the key name 118 */ 119 public String getName() { 120 return mKey.getName(); 121 } 122 123 /** 124 * {@inheritDoc} 125 */ 126 @Override 127 public final int hashCode() { 128 return mKey.hashCode(); 129 } 130 131 /** 132 * {@inheritDoc} 133 */ 134 @SuppressWarnings("unchecked") 135 @Override 136 public final boolean equals(Object o) { 137 return o instanceof Key && ((Key<T>)o).mKey.equals(mKey); 138 } 139 140 /** 141 * Visible for CameraMetadataNative implementation only; do not use. 142 * 143 * TODO: Make this private or remove it altogether. 144 * 145 * @hide 146 */ 147 public CameraMetadataNative.Key<T> getNativeKey() { 148 return mKey; 149 } 150 151 @SuppressWarnings({ "unchecked" }) 152 /*package*/ Key(CameraMetadataNative.Key<?> nativeKey) { 153 mKey = (CameraMetadataNative.Key<T>) nativeKey; 154 } 155 } 156 157 private final HashSet<Surface> mSurfaceSet; 158 private final CameraMetadataNative mSettings; 159 160 private Object mUserTag; 161 162 /** 163 * Construct empty request. 164 * 165 * Used by Binder to unparcel this object only. 166 */ 167 private CaptureRequest() { 168 mSettings = new CameraMetadataNative(); 169 mSurfaceSet = new HashSet<Surface>(); 170 } 171 172 /** 173 * Clone from source capture request. 174 * 175 * Used by the Builder to create an immutable copy. 176 */ 177 @SuppressWarnings("unchecked") 178 private CaptureRequest(CaptureRequest source) { 179 mSettings = new CameraMetadataNative(source.mSettings); 180 mSurfaceSet = (HashSet<Surface>) source.mSurfaceSet.clone(); 181 mUserTag = source.mUserTag; 182 } 183 184 /** 185 * Take ownership of passed-in settings. 186 * 187 * Used by the Builder to create a mutable CaptureRequest. 188 */ 189 private CaptureRequest(CameraMetadataNative settings) { 190 mSettings = CameraMetadataNative.move(settings); 191 mSurfaceSet = new HashSet<Surface>(); 192 } 193 194 /** 195 * Get a capture request field value. 196 * 197 * <p>The field definitions can be found in {@link CaptureRequest}.</p> 198 * 199 * <p>Querying the value for the same key more than once will return a value 200 * which is equal to the previous queried value.</p> 201 * 202 * @throws IllegalArgumentException if the key was not valid 203 * 204 * @param key The result field to read. 205 * @return The value of that key, or {@code null} if the field is not set. 206 */ 207 public <T> T get(Key<T> key) { 208 return mSettings.get(key); 209 } 210 211 /** 212 * {@inheritDoc} 213 * @hide 214 */ 215 @SuppressWarnings("unchecked") 216 @Override 217 protected <T> T getProtected(Key<?> key) { 218 return (T) mSettings.get(key); 219 } 220 221 /** 222 * {@inheritDoc} 223 * @hide 224 */ 225 @SuppressWarnings("unchecked") 226 @Override 227 protected Class<Key<?>> getKeyClass() { 228 Object thisClass = Key.class; 229 return (Class<Key<?>>)thisClass; 230 } 231 232 /** 233 * {@inheritDoc} 234 */ 235 @Override 236 public List<Key<?>> getKeys() { 237 // Force the javadoc for this function to show up on the CaptureRequest page 238 return super.getKeys(); 239 } 240 241 /** 242 * Retrieve the tag for this request, if any. 243 * 244 * <p>This tag is not used for anything by the camera device, but can be 245 * used by an application to easily identify a CaptureRequest when it is 246 * returned by 247 * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted} 248 * </p> 249 * 250 * @return the last tag Object set on this request, or {@code null} if 251 * no tag has been set. 252 * @see Builder#setTag 253 */ 254 public Object getTag() { 255 return mUserTag; 256 } 257 258 /** 259 * Determine whether this CaptureRequest is equal to another CaptureRequest. 260 * 261 * <p>A request is considered equal to another is if it's set of key/values is equal, it's 262 * list of output surfaces is equal, and the user tag is equal.</p> 263 * 264 * @param other Another instance of CaptureRequest. 265 * 266 * @return True if the requests are the same, false otherwise. 267 */ 268 @Override 269 public boolean equals(Object other) { 270 return other instanceof CaptureRequest 271 && equals((CaptureRequest)other); 272 } 273 274 private boolean equals(CaptureRequest other) { 275 return other != null 276 && Objects.equals(mUserTag, other.mUserTag) 277 && mSurfaceSet.equals(other.mSurfaceSet) 278 && mSettings.equals(other.mSettings); 279 } 280 281 @Override 282 public int hashCode() { 283 return mSettings.hashCode(); 284 } 285 286 public static final Parcelable.Creator<CaptureRequest> CREATOR = 287 new Parcelable.Creator<CaptureRequest>() { 288 @Override 289 public CaptureRequest createFromParcel(Parcel in) { 290 CaptureRequest request = new CaptureRequest(); 291 request.readFromParcel(in); 292 293 return request; 294 } 295 296 @Override 297 public CaptureRequest[] newArray(int size) { 298 return new CaptureRequest[size]; 299 } 300 }; 301 302 /** 303 * Expand this object from a Parcel. 304 * Hidden since this breaks the immutability of CaptureRequest, but is 305 * needed to receive CaptureRequests with aidl. 306 * 307 * @param in The parcel from which the object should be read 308 * @hide 309 */ 310 private void readFromParcel(Parcel in) { 311 mSettings.readFromParcel(in); 312 313 mSurfaceSet.clear(); 314 315 Parcelable[] parcelableArray = in.readParcelableArray(Surface.class.getClassLoader()); 316 317 if (parcelableArray == null) { 318 return; 319 } 320 321 for (Parcelable p : parcelableArray) { 322 Surface s = (Surface) p; 323 mSurfaceSet.add(s); 324 } 325 } 326 327 @Override 328 public int describeContents() { 329 return 0; 330 } 331 332 @Override 333 public void writeToParcel(Parcel dest, int flags) { 334 mSettings.writeToParcel(dest, flags); 335 dest.writeParcelableArray(mSurfaceSet.toArray(new Surface[mSurfaceSet.size()]), flags); 336 } 337 338 /** 339 * @hide 340 */ 341 public boolean containsTarget(Surface surface) { 342 return mSurfaceSet.contains(surface); 343 } 344 345 /** 346 * @hide 347 */ 348 public Collection<Surface> getTargets() { 349 return Collections.unmodifiableCollection(mSurfaceSet); 350 } 351 352 /** 353 * A builder for capture requests. 354 * 355 * <p>To obtain a builder instance, use the 356 * {@link CameraDevice#createCaptureRequest} method, which initializes the 357 * request fields to one of the templates defined in {@link CameraDevice}. 358 * 359 * @see CameraDevice#createCaptureRequest 360 * @see CameraDevice#TEMPLATE_PREVIEW 361 * @see CameraDevice#TEMPLATE_RECORD 362 * @see CameraDevice#TEMPLATE_STILL_CAPTURE 363 * @see CameraDevice#TEMPLATE_VIDEO_SNAPSHOT 364 * @see CameraDevice#TEMPLATE_MANUAL 365 */ 366 public final static class Builder { 367 368 private final CaptureRequest mRequest; 369 370 /** 371 * Initialize the builder using the template; the request takes 372 * ownership of the template. 373 * 374 * @hide 375 */ 376 public Builder(CameraMetadataNative template) { 377 mRequest = new CaptureRequest(template); 378 } 379 380 /** 381 * <p>Add a surface to the list of targets for this request</p> 382 * 383 * <p>The Surface added must be one of the surfaces included in the most 384 * recent call to {@link CameraDevice#createCaptureSession}, when the 385 * request is given to the camera device.</p> 386 * 387 * <p>Adding a target more than once has no effect.</p> 388 * 389 * @param outputTarget Surface to use as an output target for this request 390 */ 391 public void addTarget(Surface outputTarget) { 392 mRequest.mSurfaceSet.add(outputTarget); 393 } 394 395 /** 396 * <p>Remove a surface from the list of targets for this request.</p> 397 * 398 * <p>Removing a target that is not currently added has no effect.</p> 399 * 400 * @param outputTarget Surface to use as an output target for this request 401 */ 402 public void removeTarget(Surface outputTarget) { 403 mRequest.mSurfaceSet.remove(outputTarget); 404 } 405 406 /** 407 * Set a capture request field to a value. The field definitions can be 408 * found in {@link CaptureRequest}. 409 * 410 * @param key The metadata field to write. 411 * @param value The value to set the field to, which must be of a matching 412 * type to the key. 413 */ 414 public <T> void set(Key<T> key, T value) { 415 mRequest.mSettings.set(key, value); 416 } 417 418 /** 419 * Get a capture request field value. The field definitions can be 420 * found in {@link CaptureRequest}. 421 * 422 * @throws IllegalArgumentException if the key was not valid 423 * 424 * @param key The metadata field to read. 425 * @return The value of that key, or {@code null} if the field is not set. 426 */ 427 public <T> T get(Key<T> key) { 428 return mRequest.mSettings.get(key); 429 } 430 431 /** 432 * Set a tag for this request. 433 * 434 * <p>This tag is not used for anything by the camera device, but can be 435 * used by an application to easily identify a CaptureRequest when it is 436 * returned by 437 * {@link CameraDevice.CaptureListener#onCaptureCompleted CaptureListener.onCaptureCompleted} 438 * 439 * @param tag an arbitrary Object to store with this request 440 * @see CaptureRequest#getTag 441 */ 442 public void setTag(Object tag) { 443 mRequest.mUserTag = tag; 444 } 445 446 /** 447 * Build a request using the current target Surfaces and settings. 448 * 449 * @return A new capture request instance, ready for submission to the 450 * camera device. 451 */ 452 public CaptureRequest build() { 453 return new CaptureRequest(mRequest); 454 } 455 456 457 /** 458 * @hide 459 */ 460 public boolean isEmpty() { 461 return mRequest.mSettings.isEmpty(); 462 } 463 464 } 465 466 /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 467 * The key entries below this point are generated from metadata 468 * definitions in /system/media/camera/docs. Do not modify by hand or 469 * modify the comment blocks at the start or end. 470 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ 471 472 473 /** 474 * <p>The mode control selects how the image data is converted from the 475 * sensor's native color into linear sRGB color.</p> 476 * <p>When auto-white balance (AWB) is enabled with {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, this 477 * control is overridden by the AWB routine. When AWB is disabled, the 478 * application controls how the color mapping is performed.</p> 479 * <p>We define the expected processing pipeline below. For consistency 480 * across devices, this is always the case with TRANSFORM_MATRIX.</p> 481 * <p>When either FULL or HIGH_QUALITY is used, the camera device may 482 * do additional processing but {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 483 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} will still be provided by the 484 * camera device (in the results) and be roughly correct.</p> 485 * <p>Switching to TRANSFORM_MATRIX and using the data provided from 486 * FAST or HIGH_QUALITY will yield a picture with the same white point 487 * as what was produced by the camera device in the earlier frame.</p> 488 * <p>The expected processing pipeline is as follows:</p> 489 * <p><img alt="White balance processing pipeline" src="../../../../images/camera2/metadata/android.colorCorrection.mode/processing_pipeline.png" /></p> 490 * <p>The white balance is encoded by two values, a 4-channel white-balance 491 * gain vector (applied in the Bayer domain), and a 3x3 color transform 492 * matrix (applied after demosaic).</p> 493 * <p>The 4-channel white-balance gains are defined as:</p> 494 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} = [ R G_even G_odd B ] 495 * </code></pre> 496 * <p>where <code>G_even</code> is the gain for green pixels on even rows of the 497 * output, and <code>G_odd</code> is the gain for green pixels on the odd rows. 498 * These may be identical for a given camera device implementation; if 499 * the camera device does not support a separate gain for even/odd green 500 * channels, it will use the <code>G_even</code> value, and write <code>G_odd</code> equal to 501 * <code>G_even</code> in the output result metadata.</p> 502 * <p>The matrices for color transforms are defined as a 9-entry vector:</p> 503 * <pre><code>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} = [ I0 I1 I2 I3 I4 I5 I6 I7 I8 ] 504 * </code></pre> 505 * <p>which define a transform from input sensor colors, <code>P_in = [ r g b ]</code>, 506 * to output linear sRGB, <code>P_out = [ r' g' b' ]</code>,</p> 507 * <p>with colors as follows:</p> 508 * <pre><code>r' = I0r + I1g + I2b 509 * g' = I3r + I4g + I5b 510 * b' = I6r + I7g + I8b 511 * </code></pre> 512 * <p>Both the input and output value ranges must match. Overflow/underflow 513 * values are clipped to fit within the range.</p> 514 * 515 * @see CaptureRequest#COLOR_CORRECTION_GAINS 516 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 517 * @see CaptureRequest#CONTROL_AWB_MODE 518 * @see #COLOR_CORRECTION_MODE_TRANSFORM_MATRIX 519 * @see #COLOR_CORRECTION_MODE_FAST 520 * @see #COLOR_CORRECTION_MODE_HIGH_QUALITY 521 */ 522 public static final Key<Integer> COLOR_CORRECTION_MODE = 523 new Key<Integer>("android.colorCorrection.mode", int.class); 524 525 /** 526 * <p>A color transform matrix to use to transform 527 * from sensor RGB color space to output linear sRGB color space.</p> 528 * <p>This matrix is either set by the camera device when the request 529 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not TRANSFORM_MATRIX, or 530 * directly by the application in the request when the 531 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is TRANSFORM_MATRIX.</p> 532 * <p>In the latter case, the camera device may round the matrix to account 533 * for precision issues; the final rounded matrix should be reported back 534 * in this matrix result metadata. The transform should keep the magnitude 535 * of the output color values within <code>[0, 1.0]</code> (assuming input color 536 * values is within the normalized range <code>[0, 1.0]</code>), or clipping may occur.</p> 537 * 538 * @see CaptureRequest#COLOR_CORRECTION_MODE 539 */ 540 public static final Key<android.hardware.camera2.params.ColorSpaceTransform> COLOR_CORRECTION_TRANSFORM = 541 new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.colorCorrection.transform", android.hardware.camera2.params.ColorSpaceTransform.class); 542 543 /** 544 * <p>Gains applying to Bayer raw color channels for 545 * white-balance.</p> 546 * <p>These per-channel gains are either set by the camera device 547 * when the request {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is not 548 * TRANSFORM_MATRIX, or directly by the application in the 549 * request when the {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} is 550 * TRANSFORM_MATRIX.</p> 551 * <p>The gains in the result metadata are the gains actually 552 * applied by the camera device to the current frame.</p> 553 * 554 * @see CaptureRequest#COLOR_CORRECTION_MODE 555 */ 556 public static final Key<android.hardware.camera2.params.RggbChannelVector> COLOR_CORRECTION_GAINS = 557 new Key<android.hardware.camera2.params.RggbChannelVector>("android.colorCorrection.gains", android.hardware.camera2.params.RggbChannelVector.class); 558 559 /** 560 * <p>The desired setting for the camera device's auto-exposure 561 * algorithm's antibanding compensation.</p> 562 * <p>Some kinds of lighting fixtures, such as some fluorescent 563 * lights, flicker at the rate of the power supply frequency 564 * (60Hz or 50Hz, depending on country). While this is 565 * typically not noticeable to a person, it can be visible to 566 * a camera device. If a camera sets its exposure time to the 567 * wrong value, the flicker may become visible in the 568 * viewfinder as flicker or in a final captured image, as a 569 * set of variable-brightness bands across the image.</p> 570 * <p>Therefore, the auto-exposure routines of camera devices 571 * include antibanding routines that ensure that the chosen 572 * exposure value will not cause such banding. The choice of 573 * exposure time depends on the rate of flicker, which the 574 * camera device can detect automatically, or the expected 575 * rate can be selected by the application using this 576 * control.</p> 577 * <p>A given camera device may not support all of the possible 578 * options for the antibanding mode. The 579 * {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains 580 * the available modes for a given camera device.</p> 581 * <p>The default mode is AUTO, which must be supported by all 582 * camera devices.</p> 583 * <p>If manual exposure control is enabled (by setting 584 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF), 585 * then this setting has no effect, and the application must 586 * ensure it selects exposure times that do not cause banding 587 * issues. The {@link CaptureResult#STATISTICS_SCENE_FLICKER android.statistics.sceneFlicker} key can assist 588 * the application in this.</p> 589 * 590 * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES 591 * @see CaptureRequest#CONTROL_AE_MODE 592 * @see CaptureRequest#CONTROL_MODE 593 * @see CaptureResult#STATISTICS_SCENE_FLICKER 594 * @see #CONTROL_AE_ANTIBANDING_MODE_OFF 595 * @see #CONTROL_AE_ANTIBANDING_MODE_50HZ 596 * @see #CONTROL_AE_ANTIBANDING_MODE_60HZ 597 * @see #CONTROL_AE_ANTIBANDING_MODE_AUTO 598 */ 599 public static final Key<Integer> CONTROL_AE_ANTIBANDING_MODE = 600 new Key<Integer>("android.control.aeAntibandingMode", int.class); 601 602 /** 603 * <p>Adjustment to auto-exposure (AE) target image 604 * brightness.</p> 605 * <p>The adjustment is measured as a count of steps, with the 606 * step size defined by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} and the 607 * allowed range by {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE android.control.aeCompensationRange}.</p> 608 * <p>For example, if the exposure value (EV) step is 0.333, '6' 609 * will mean an exposure compensation of +2 EV; -3 will mean an 610 * exposure compensation of -1 EV. One EV represents a doubling 611 * of image brightness. Note that this control will only be 612 * effective if {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF. This control 613 * will take effect even when {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock} <code>== true</code>.</p> 614 * <p>In the event of exposure compensation value being changed, camera device 615 * may take several frames to reach the newly requested exposure target. 616 * During that time, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} field will be in the SEARCHING 617 * state. Once the new exposure target is reached, {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} will 618 * change from SEARCHING to either CONVERGED, LOCKED (if AE lock is enabled), or 619 * FLASH_REQUIRED (if the scene is too dark for still capture).</p> 620 * 621 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_RANGE 622 * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP 623 * @see CaptureRequest#CONTROL_AE_LOCK 624 * @see CaptureRequest#CONTROL_AE_MODE 625 * @see CaptureResult#CONTROL_AE_STATE 626 */ 627 public static final Key<Integer> CONTROL_AE_EXPOSURE_COMPENSATION = 628 new Key<Integer>("android.control.aeExposureCompensation", int.class); 629 630 /** 631 * <p>Whether auto-exposure (AE) is currently locked to its latest 632 * calculated values.</p> 633 * <p>Note that even when AE is locked, the flash may be 634 * fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_AUTO_FLASH / ON_ALWAYS_FLASH / 635 * ON_AUTO_FLASH_REDEYE.</p> 636 * <p>When {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} is changed, even if the AE lock 637 * is ON, the camera device will still adjust its exposure value.</p> 638 * <p>If AE precapture is triggered (see {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) 639 * when AE is already locked, the camera device will not change the exposure time 640 * ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}) and sensitivity ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}) 641 * parameters. The flash may be fired if the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} 642 * is ON_AUTO_FLASH/ON_AUTO_FLASH_REDEYE and the scene is too dark. If the 643 * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is ON_ALWAYS_FLASH, the scene may become overexposed.</p> 644 * <p>See {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE lock related state transition details.</p> 645 * 646 * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION 647 * @see CaptureRequest#CONTROL_AE_MODE 648 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 649 * @see CaptureResult#CONTROL_AE_STATE 650 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 651 * @see CaptureRequest#SENSOR_SENSITIVITY 652 */ 653 public static final Key<Boolean> CONTROL_AE_LOCK = 654 new Key<Boolean>("android.control.aeLock", boolean.class); 655 656 /** 657 * <p>The desired mode for the camera device's 658 * auto-exposure routine.</p> 659 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is 660 * AUTO.</p> 661 * <p>When set to any of the ON modes, the camera device's 662 * auto-exposure routine is enabled, overriding the 663 * application's selected exposure time, sensor sensitivity, 664 * and frame duration ({@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 665 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and 666 * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}). If one of the FLASH modes 667 * is selected, the camera device's flash unit controls are 668 * also overridden.</p> 669 * <p>The FLASH modes are only available if the camera device 670 * has a flash unit ({@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} is <code>true</code>).</p> 671 * <p>If flash TORCH mode is desired, this field must be set to 672 * ON or OFF, and {@link CaptureRequest#FLASH_MODE android.flash.mode} set to TORCH.</p> 673 * <p>When set to any of the ON modes, the values chosen by the 674 * camera device auto-exposure routine for the overridden 675 * fields for a given capture will be available in its 676 * CaptureResult.</p> 677 * 678 * @see CaptureRequest#CONTROL_MODE 679 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 680 * @see CaptureRequest#FLASH_MODE 681 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 682 * @see CaptureRequest#SENSOR_FRAME_DURATION 683 * @see CaptureRequest#SENSOR_SENSITIVITY 684 * @see #CONTROL_AE_MODE_OFF 685 * @see #CONTROL_AE_MODE_ON 686 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH 687 * @see #CONTROL_AE_MODE_ON_ALWAYS_FLASH 688 * @see #CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE 689 */ 690 public static final Key<Integer> CONTROL_AE_MODE = 691 new Key<Integer>("android.control.aeMode", int.class); 692 693 /** 694 * <p>List of areas to use for 695 * metering.</p> 696 * <p>The coordinate system is based on the active pixel array, 697 * with (0,0) being the top-left pixel in the active pixel array, and 698 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 699 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 700 * bottom-right pixel in the active pixel array.</p> 701 * <p>The weight must range from 0 to 1000, and represents a weight 702 * for every pixel in the area. This means that a large metering area 703 * with the same weight as a smaller area will have more effect in 704 * the metering result. Metering areas can partially overlap and the 705 * camera device will add the weights in the overlap region.</p> 706 * <p>If all regions have 0 weight, then no specific metering area 707 * needs to be used by the camera device. If the metering region is 708 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata, 709 * the camera device will ignore the sections outside the region and output the 710 * used sections in the result metadata.</p> 711 * 712 * @see CaptureRequest#SCALER_CROP_REGION 713 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 714 */ 715 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AE_REGIONS = 716 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.aeRegions", android.hardware.camera2.params.MeteringRectangle[].class); 717 718 /** 719 * <p>Range over which fps can be adjusted to 720 * maintain exposure.</p> 721 * <p>Only constrains auto-exposure (AE) algorithm, not 722 * manual control of {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</p> 723 * 724 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 725 */ 726 public static final Key<android.util.Range<Integer>> CONTROL_AE_TARGET_FPS_RANGE = 727 new Key<android.util.Range<Integer>>("android.control.aeTargetFpsRange", new TypeReference<android.util.Range<Integer>>() {{ }}); 728 729 /** 730 * <p>Whether the camera device will trigger a precapture 731 * metering sequence when it processes this request.</p> 732 * <p>This entry is normally set to IDLE, or is not 733 * included at all in the request settings. When included and 734 * set to START, the camera device will trigger the autoexposure 735 * precapture metering sequence.</p> 736 * <p>The precapture sequence should triggered before starting a 737 * high-quality still capture for final metering decisions to 738 * be made, and for firing pre-capture flash pulses to estimate 739 * scene brightness and required final capture flash power, when 740 * the flash is enabled.</p> 741 * <p>Normally, this entry should be set to START for only a 742 * single request, and the application should wait until the 743 * sequence completes before starting a new one.</p> 744 * <p>The exact effect of auto-exposure (AE) precapture trigger 745 * depends on the current AE mode and state; see 746 * {@link CaptureResult#CONTROL_AE_STATE android.control.aeState} for AE precapture state transition 747 * details.</p> 748 * 749 * @see CaptureResult#CONTROL_AE_STATE 750 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_IDLE 751 * @see #CONTROL_AE_PRECAPTURE_TRIGGER_START 752 */ 753 public static final Key<Integer> CONTROL_AE_PRECAPTURE_TRIGGER = 754 new Key<Integer>("android.control.aePrecaptureTrigger", int.class); 755 756 /** 757 * <p>Whether auto-focus (AF) is currently enabled, and what 758 * mode it is set to.</p> 759 * <p>Only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} = AUTO and the lens is not fixed focus 760 * (i.e. <code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0</code>).</p> 761 * <p>If the lens is controlled by the camera device auto-focus algorithm, 762 * the camera device will report the current AF status in {@link CaptureResult#CONTROL_AF_STATE android.control.afState} 763 * in result metadata.</p> 764 * 765 * @see CaptureResult#CONTROL_AF_STATE 766 * @see CaptureRequest#CONTROL_MODE 767 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 768 * @see #CONTROL_AF_MODE_OFF 769 * @see #CONTROL_AF_MODE_AUTO 770 * @see #CONTROL_AF_MODE_MACRO 771 * @see #CONTROL_AF_MODE_CONTINUOUS_VIDEO 772 * @see #CONTROL_AF_MODE_CONTINUOUS_PICTURE 773 * @see #CONTROL_AF_MODE_EDOF 774 */ 775 public static final Key<Integer> CONTROL_AF_MODE = 776 new Key<Integer>("android.control.afMode", int.class); 777 778 /** 779 * <p>List of areas to use for focus 780 * estimation.</p> 781 * <p>The coordinate system is based on the active pixel array, 782 * with (0,0) being the top-left pixel in the active pixel array, and 783 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 784 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 785 * bottom-right pixel in the active pixel array.</p> 786 * <p>The weight must range from 0 to 1000, and represents a weight 787 * for every pixel in the area. This means that a large metering area 788 * with the same weight as a smaller area will have more effect in 789 * the metering result. Metering areas can partially overlap and the 790 * camera device will add the weights in the overlap region.</p> 791 * <p>If all regions have 0 weight, then no specific metering area 792 * needs to be used by the camera device. If the metering region is 793 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata, 794 * the camera device will ignore the sections outside the region and output the 795 * used sections in the result metadata.</p> 796 * 797 * @see CaptureRequest#SCALER_CROP_REGION 798 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 799 */ 800 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AF_REGIONS = 801 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.afRegions", android.hardware.camera2.params.MeteringRectangle[].class); 802 803 /** 804 * <p>Whether the camera device will trigger autofocus for this request.</p> 805 * <p>This entry is normally set to IDLE, or is not 806 * included at all in the request settings.</p> 807 * <p>When included and set to START, the camera device will trigger the 808 * autofocus algorithm. If autofocus is disabled, this trigger has no effect.</p> 809 * <p>When set to CANCEL, the camera device will cancel any active trigger, 810 * and return to its initial AF state.</p> 811 * <p>Generally, applications should set this entry to START or CANCEL for only a 812 * single capture, and then return it to IDLE (or not set at all). Specifying 813 * START for multiple captures in a row means restarting the AF operation over 814 * and over again.</p> 815 * <p>See {@link CaptureResult#CONTROL_AF_STATE android.control.afState} for what the trigger means for each AF mode.</p> 816 * 817 * @see CaptureResult#CONTROL_AF_STATE 818 * @see #CONTROL_AF_TRIGGER_IDLE 819 * @see #CONTROL_AF_TRIGGER_START 820 * @see #CONTROL_AF_TRIGGER_CANCEL 821 */ 822 public static final Key<Integer> CONTROL_AF_TRIGGER = 823 new Key<Integer>("android.control.afTrigger", int.class); 824 825 /** 826 * <p>Whether auto-white balance (AWB) is currently locked to its 827 * latest calculated values.</p> 828 * <p>Note that AWB lock is only meaningful when 829 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} is in the AUTO mode; in other modes, 830 * AWB is already fixed to a specific setting.</p> 831 * 832 * @see CaptureRequest#CONTROL_AWB_MODE 833 */ 834 public static final Key<Boolean> CONTROL_AWB_LOCK = 835 new Key<Boolean>("android.control.awbLock", boolean.class); 836 837 /** 838 * <p>Whether auto-white balance (AWB) is currently setting the color 839 * transform fields, and what its illumination target 840 * is.</p> 841 * <p>This control is only effective if {@link CaptureRequest#CONTROL_MODE android.control.mode} is AUTO.</p> 842 * <p>When set to the ON mode, the camera device's auto-white balance 843 * routine is enabled, overriding the application's selected 844 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 845 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> 846 * <p>When set to the OFF mode, the camera device's auto-white balance 847 * routine is disabled. The application manually controls the white 848 * balance by {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} 849 * and {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode}.</p> 850 * <p>When set to any other modes, the camera device's auto-white 851 * balance routine is disabled. The camera device uses each 852 * particular illumination target for white balance 853 * adjustment. The application's values for 854 * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}, 855 * {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} and 856 * {@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} are ignored.</p> 857 * 858 * @see CaptureRequest#COLOR_CORRECTION_GAINS 859 * @see CaptureRequest#COLOR_CORRECTION_MODE 860 * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM 861 * @see CaptureRequest#CONTROL_MODE 862 * @see #CONTROL_AWB_MODE_OFF 863 * @see #CONTROL_AWB_MODE_AUTO 864 * @see #CONTROL_AWB_MODE_INCANDESCENT 865 * @see #CONTROL_AWB_MODE_FLUORESCENT 866 * @see #CONTROL_AWB_MODE_WARM_FLUORESCENT 867 * @see #CONTROL_AWB_MODE_DAYLIGHT 868 * @see #CONTROL_AWB_MODE_CLOUDY_DAYLIGHT 869 * @see #CONTROL_AWB_MODE_TWILIGHT 870 * @see #CONTROL_AWB_MODE_SHADE 871 */ 872 public static final Key<Integer> CONTROL_AWB_MODE = 873 new Key<Integer>("android.control.awbMode", int.class); 874 875 /** 876 * <p>List of areas to use for illuminant 877 * estimation.</p> 878 * <p>The coordinate system is based on the active pixel array, 879 * with (0,0) being the top-left pixel in the active pixel array, and 880 * ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.width - 1, 881 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.height - 1) being the 882 * bottom-right pixel in the active pixel array.</p> 883 * <p>The weight must range from 0 to 1000, and represents a weight 884 * for every pixel in the area. This means that a large metering area 885 * with the same weight as a smaller area will have more effect in 886 * the metering result. Metering areas can partially overlap and the 887 * camera device will add the weights in the overlap region.</p> 888 * <p>If all regions have 0 weight, then no specific metering area 889 * needs to be used by the camera device. If the metering region is 890 * outside the used {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} returned in capture result metadata, 891 * the camera device will ignore the sections outside the region and output the 892 * used sections in the result metadata.</p> 893 * 894 * @see CaptureRequest#SCALER_CROP_REGION 895 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 896 */ 897 public static final Key<android.hardware.camera2.params.MeteringRectangle[]> CONTROL_AWB_REGIONS = 898 new Key<android.hardware.camera2.params.MeteringRectangle[]>("android.control.awbRegions", android.hardware.camera2.params.MeteringRectangle[].class); 899 900 /** 901 * <p>Information to the camera device 3A (auto-exposure, 902 * auto-focus, auto-white balance) routines about the purpose 903 * of this capture, to help the camera device to decide optimal 3A 904 * strategy.</p> 905 * <p>This control (except for MANUAL) is only effective if 906 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF</code> and any 3A routine is active.</p> 907 * <p>ZERO_SHUTTER_LAG will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} 908 * contains ZSL. MANUAL will be supported if {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} 909 * contains MANUAL_SENSOR.</p> 910 * 911 * @see CaptureRequest#CONTROL_MODE 912 * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES 913 * @see #CONTROL_CAPTURE_INTENT_CUSTOM 914 * @see #CONTROL_CAPTURE_INTENT_PREVIEW 915 * @see #CONTROL_CAPTURE_INTENT_STILL_CAPTURE 916 * @see #CONTROL_CAPTURE_INTENT_VIDEO_RECORD 917 * @see #CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT 918 * @see #CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG 919 * @see #CONTROL_CAPTURE_INTENT_MANUAL 920 */ 921 public static final Key<Integer> CONTROL_CAPTURE_INTENT = 922 new Key<Integer>("android.control.captureIntent", int.class); 923 924 /** 925 * <p>A special color effect to apply.</p> 926 * <p>When this mode is set, a color effect will be applied 927 * to images produced by the camera device. The interpretation 928 * and implementation of these color effects is left to the 929 * implementor of the camera device, and should not be 930 * depended on to be consistent (or present) across all 931 * devices.</p> 932 * <p>A color effect will only be applied if 933 * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p> 934 * 935 * @see CaptureRequest#CONTROL_MODE 936 * @see #CONTROL_EFFECT_MODE_OFF 937 * @see #CONTROL_EFFECT_MODE_MONO 938 * @see #CONTROL_EFFECT_MODE_NEGATIVE 939 * @see #CONTROL_EFFECT_MODE_SOLARIZE 940 * @see #CONTROL_EFFECT_MODE_SEPIA 941 * @see #CONTROL_EFFECT_MODE_POSTERIZE 942 * @see #CONTROL_EFFECT_MODE_WHITEBOARD 943 * @see #CONTROL_EFFECT_MODE_BLACKBOARD 944 * @see #CONTROL_EFFECT_MODE_AQUA 945 */ 946 public static final Key<Integer> CONTROL_EFFECT_MODE = 947 new Key<Integer>("android.control.effectMode", int.class); 948 949 /** 950 * <p>Overall mode of 3A control 951 * routines.</p> 952 * <p>High-level 3A control. When set to OFF, all 3A control 953 * by the camera device is disabled. The application must set the fields for 954 * capture parameters itself.</p> 955 * <p>When set to AUTO, the individual algorithm controls in 956 * android.control.* are in effect, such as {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p> 957 * <p>When set to USE_SCENE_MODE, the individual controls in 958 * android.control.* are mostly disabled, and the camera device implements 959 * one of the scene mode settings (such as ACTION, SUNSET, or PARTY) 960 * as it wishes. The camera device scene mode 3A settings are provided by 961 * android.control.sceneModeOverrides.</p> 962 * <p>When set to OFF_KEEP_STATE, it is similar to OFF mode, the only difference 963 * is that this frame will not be used by camera device background 3A statistics 964 * update, as if this frame is never captured. This mode can be used in the scenario 965 * where the application doesn't want a 3A manual control capture to affect 966 * the subsequent auto 3A capture results.</p> 967 * 968 * @see CaptureRequest#CONTROL_AF_MODE 969 * @see #CONTROL_MODE_OFF 970 * @see #CONTROL_MODE_AUTO 971 * @see #CONTROL_MODE_USE_SCENE_MODE 972 * @see #CONTROL_MODE_OFF_KEEP_STATE 973 */ 974 public static final Key<Integer> CONTROL_MODE = 975 new Key<Integer>("android.control.mode", int.class); 976 977 /** 978 * <p>A camera mode optimized for conditions typical in a particular 979 * capture setting.</p> 980 * <p>This is the mode that that is active when 981 * <code>{@link CaptureRequest#CONTROL_MODE android.control.mode} == USE_SCENE_MODE</code>. Aside from FACE_PRIORITY, 982 * these modes will disable {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, 983 * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} while in use. 984 * The scene modes available for a given camera device are listed in 985 * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}.</p> 986 * <p>The interpretation and implementation of these scene modes is left 987 * to the implementor of the camera device. Their behavior will not be 988 * consistent across all devices, and any given device may only implement 989 * a subset of these modes.</p> 990 * 991 * @see CaptureRequest#CONTROL_AE_MODE 992 * @see CaptureRequest#CONTROL_AF_MODE 993 * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES 994 * @see CaptureRequest#CONTROL_AWB_MODE 995 * @see CaptureRequest#CONTROL_MODE 996 * @see #CONTROL_SCENE_MODE_DISABLED 997 * @see #CONTROL_SCENE_MODE_FACE_PRIORITY 998 * @see #CONTROL_SCENE_MODE_ACTION 999 * @see #CONTROL_SCENE_MODE_PORTRAIT 1000 * @see #CONTROL_SCENE_MODE_LANDSCAPE 1001 * @see #CONTROL_SCENE_MODE_NIGHT 1002 * @see #CONTROL_SCENE_MODE_NIGHT_PORTRAIT 1003 * @see #CONTROL_SCENE_MODE_THEATRE 1004 * @see #CONTROL_SCENE_MODE_BEACH 1005 * @see #CONTROL_SCENE_MODE_SNOW 1006 * @see #CONTROL_SCENE_MODE_SUNSET 1007 * @see #CONTROL_SCENE_MODE_STEADYPHOTO 1008 * @see #CONTROL_SCENE_MODE_FIREWORKS 1009 * @see #CONTROL_SCENE_MODE_SPORTS 1010 * @see #CONTROL_SCENE_MODE_PARTY 1011 * @see #CONTROL_SCENE_MODE_CANDLELIGHT 1012 * @see #CONTROL_SCENE_MODE_BARCODE 1013 */ 1014 public static final Key<Integer> CONTROL_SCENE_MODE = 1015 new Key<Integer>("android.control.sceneMode", int.class); 1016 1017 /** 1018 * <p>Whether video stabilization is 1019 * active.</p> 1020 * <p>Video stabilization automatically translates and scales images from the camera 1021 * in order to stabilize motion between consecutive frames.</p> 1022 * <p>If enabled, video stabilization can modify the 1023 * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion} to keep the video stream 1024 * stabilized</p> 1025 * 1026 * @see CaptureRequest#SCALER_CROP_REGION 1027 * @see #CONTROL_VIDEO_STABILIZATION_MODE_OFF 1028 * @see #CONTROL_VIDEO_STABILIZATION_MODE_ON 1029 */ 1030 public static final Key<Integer> CONTROL_VIDEO_STABILIZATION_MODE = 1031 new Key<Integer>("android.control.videoStabilizationMode", int.class); 1032 1033 /** 1034 * <p>Operation mode for edge 1035 * enhancement.</p> 1036 * <p>Edge/sharpness/detail enhancement. OFF means no 1037 * enhancement will be applied by the camera device.</p> 1038 * <p>This must be set to one of the modes listed in {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes}.</p> 1039 * <p>FAST/HIGH_QUALITY both mean camera device determined enhancement 1040 * will be applied. HIGH_QUALITY mode indicates that the 1041 * camera device will use the highest-quality enhancement algorithms, 1042 * even if it slows down capture rate. FAST means the camera device will 1043 * not slow down capture rate when applying edge enhancement.</p> 1044 * 1045 * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES 1046 * @see #EDGE_MODE_OFF 1047 * @see #EDGE_MODE_FAST 1048 * @see #EDGE_MODE_HIGH_QUALITY 1049 */ 1050 public static final Key<Integer> EDGE_MODE = 1051 new Key<Integer>("android.edge.mode", int.class); 1052 1053 /** 1054 * <p>The desired mode for for the camera device's flash control.</p> 1055 * <p>This control is only effective when flash unit is available 1056 * (<code>{@link CameraCharacteristics#FLASH_INFO_AVAILABLE android.flash.info.available} == true</code>).</p> 1057 * <p>When this control is used, the {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} must be set to ON or OFF. 1058 * Otherwise, the camera device auto-exposure related flash control (ON_AUTO_FLASH, 1059 * ON_ALWAYS_FLASH, or ON_AUTO_FLASH_REDEYE) will override this control.</p> 1060 * <p>When set to OFF, the camera device will not fire flash for this capture.</p> 1061 * <p>When set to SINGLE, the camera device will fire flash regardless of the camera 1062 * device's auto-exposure routine's result. When used in still capture case, this 1063 * control should be used along with auto-exposure (AE) precapture metering sequence 1064 * ({@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}), otherwise, the image may be incorrectly exposed.</p> 1065 * <p>When set to TORCH, the flash will be on continuously. This mode can be used 1066 * for use cases such as preview, auto-focus assist, still capture, or video recording.</p> 1067 * <p>The flash status will be reported by {@link CaptureResult#FLASH_STATE android.flash.state} in the capture result metadata.</p> 1068 * 1069 * @see CaptureRequest#CONTROL_AE_MODE 1070 * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER 1071 * @see CameraCharacteristics#FLASH_INFO_AVAILABLE 1072 * @see CaptureResult#FLASH_STATE 1073 * @see #FLASH_MODE_OFF 1074 * @see #FLASH_MODE_SINGLE 1075 * @see #FLASH_MODE_TORCH 1076 */ 1077 public static final Key<Integer> FLASH_MODE = 1078 new Key<Integer>("android.flash.mode", int.class); 1079 1080 /** 1081 * <p>Set operational mode for hot pixel correction.</p> 1082 * <p>Valid modes for this camera device are listed in 1083 * {@link CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES android.hotPixel.availableHotPixelModes}.</p> 1084 * <p>Hotpixel correction interpolates out, or otherwise removes, pixels 1085 * that do not accurately encode the incoming light (i.e. pixels that 1086 * are stuck at an arbitrary value).</p> 1087 * 1088 * @see CameraCharacteristics#HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES 1089 * @see #HOT_PIXEL_MODE_OFF 1090 * @see #HOT_PIXEL_MODE_FAST 1091 * @see #HOT_PIXEL_MODE_HIGH_QUALITY 1092 */ 1093 public static final Key<Integer> HOT_PIXEL_MODE = 1094 new Key<Integer>("android.hotPixel.mode", int.class); 1095 1096 /** 1097 * <p>A location object to use when generating image GPS metadata.</p> 1098 */ 1099 public static final Key<android.location.Location> JPEG_GPS_LOCATION = 1100 new Key<android.location.Location>("android.jpeg.gpsLocation", android.location.Location.class); 1101 1102 /** 1103 * <p>GPS coordinates to include in output JPEG 1104 * EXIF</p> 1105 * @hide 1106 */ 1107 public static final Key<double[]> JPEG_GPS_COORDINATES = 1108 new Key<double[]>("android.jpeg.gpsCoordinates", double[].class); 1109 1110 /** 1111 * <p>32 characters describing GPS algorithm to 1112 * include in EXIF</p> 1113 * @hide 1114 */ 1115 public static final Key<String> JPEG_GPS_PROCESSING_METHOD = 1116 new Key<String>("android.jpeg.gpsProcessingMethod", String.class); 1117 1118 /** 1119 * <p>Time GPS fix was made to include in 1120 * EXIF</p> 1121 * @hide 1122 */ 1123 public static final Key<Long> JPEG_GPS_TIMESTAMP = 1124 new Key<Long>("android.jpeg.gpsTimestamp", long.class); 1125 1126 /** 1127 * <p>Orientation of JPEG image to 1128 * write</p> 1129 */ 1130 public static final Key<Integer> JPEG_ORIENTATION = 1131 new Key<Integer>("android.jpeg.orientation", int.class); 1132 1133 /** 1134 * <p>Compression quality of the final JPEG 1135 * image.</p> 1136 * <p>85-95 is typical usage range.</p> 1137 */ 1138 public static final Key<Byte> JPEG_QUALITY = 1139 new Key<Byte>("android.jpeg.quality", byte.class); 1140 1141 /** 1142 * <p>Compression quality of JPEG 1143 * thumbnail.</p> 1144 */ 1145 public static final Key<Byte> JPEG_THUMBNAIL_QUALITY = 1146 new Key<Byte>("android.jpeg.thumbnailQuality", byte.class); 1147 1148 /** 1149 * <p>Resolution of embedded JPEG thumbnail.</p> 1150 * <p>When set to (0, 0) value, the JPEG EXIF will not contain thumbnail, 1151 * but the captured JPEG will still be a valid image.</p> 1152 * <p>When a jpeg image capture is issued, the thumbnail size selected should have 1153 * the same aspect ratio as the jpeg image.</p> 1154 * <p>If the thumbnail image aspect ratio differs from the JPEG primary image aspect 1155 * ratio, the camera device creates the thumbnail by cropping it from the primary image. 1156 * For example, if the primary image has 4:3 aspect ratio, the thumbnail image has 1157 * 16:9 aspect ratio, the primary image will be cropped vertically (letterbox) to 1158 * generate the thumbnail image. The thumbnail image will always have a smaller Field 1159 * Of View (FOV) than the primary image when aspect ratios differ.</p> 1160 */ 1161 public static final Key<android.util.Size> JPEG_THUMBNAIL_SIZE = 1162 new Key<android.util.Size>("android.jpeg.thumbnailSize", android.util.Size.class); 1163 1164 /** 1165 * <p>The ratio of lens focal length to the effective 1166 * aperture diameter.</p> 1167 * <p>This will only be supported on the camera devices that 1168 * have variable aperture lens. The aperture value can only be 1169 * one of the values listed in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES android.lens.info.availableApertures}.</p> 1170 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is OFF, 1171 * this can be set along with {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, 1172 * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} 1173 * to achieve manual exposure control.</p> 1174 * <p>The requested aperture value may take several frames to reach the 1175 * requested value; the camera device will report the current (intermediate) 1176 * aperture size in capture result metadata while the aperture is changing. 1177 * While the aperture is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 1178 * <p>When this is supported and {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of 1179 * the ON modes, this will be overridden by the camera device 1180 * auto-exposure algorithm, the overridden values are then provided 1181 * back to the user in the corresponding result.</p> 1182 * 1183 * @see CaptureRequest#CONTROL_AE_MODE 1184 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_APERTURES 1185 * @see CaptureResult#LENS_STATE 1186 * @see CaptureRequest#SENSOR_EXPOSURE_TIME 1187 * @see CaptureRequest#SENSOR_FRAME_DURATION 1188 * @see CaptureRequest#SENSOR_SENSITIVITY 1189 */ 1190 public static final Key<Float> LENS_APERTURE = 1191 new Key<Float>("android.lens.aperture", float.class); 1192 1193 /** 1194 * <p>State of lens neutral density filter(s).</p> 1195 * <p>This will not be supported on most camera devices. On devices 1196 * where this is supported, this may only be set to one of the 1197 * values included in {@link CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES android.lens.info.availableFilterDensities}.</p> 1198 * <p>Lens filters are typically used to lower the amount of light the 1199 * sensor is exposed to (measured in steps of EV). As used here, an EV 1200 * step is the standard logarithmic representation, which are 1201 * non-negative, and inversely proportional to the amount of light 1202 * hitting the sensor. For example, setting this to 0 would result 1203 * in no reduction of the incoming light, and setting this to 2 would 1204 * mean that the filter is set to reduce incoming light by two stops 1205 * (allowing 1/4 of the prior amount of light to the sensor).</p> 1206 * <p>It may take several frames before the lens filter density changes 1207 * to the requested value. While the filter density is still changing, 1208 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 1209 * 1210 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_FILTER_DENSITIES 1211 * @see CaptureResult#LENS_STATE 1212 */ 1213 public static final Key<Float> LENS_FILTER_DENSITY = 1214 new Key<Float>("android.lens.filterDensity", float.class); 1215 1216 /** 1217 * <p>The current lens focal length; used for optical zoom.</p> 1218 * <p>This setting controls the physical focal length of the camera 1219 * device's lens. Changing the focal length changes the field of 1220 * view of the camera device, and is usually used for optical zoom.</p> 1221 * <p>Like {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}, this 1222 * setting won't be applied instantaneously, and it may take several 1223 * frames before the lens can change to the requested focal length. 1224 * While the focal length is still changing, {@link CaptureResult#LENS_STATE android.lens.state} will 1225 * be set to MOVING.</p> 1226 * <p>This is expected not to be supported on most devices.</p> 1227 * 1228 * @see CaptureRequest#LENS_APERTURE 1229 * @see CaptureRequest#LENS_FOCUS_DISTANCE 1230 * @see CaptureResult#LENS_STATE 1231 */ 1232 public static final Key<Float> LENS_FOCAL_LENGTH = 1233 new Key<Float>("android.lens.focalLength", float.class); 1234 1235 /** 1236 * <p>Distance to plane of sharpest focus, 1237 * measured from frontmost surface of the lens.</p> 1238 * <p>0 means infinity focus. Used value will be clamped 1239 * to [0, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}].</p> 1240 * <p>Like {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, this setting won't be applied 1241 * instantaneously, and it may take several frames before the lens 1242 * can move to the requested focus distance. While the lens is still moving, 1243 * {@link CaptureResult#LENS_STATE android.lens.state} will be set to MOVING.</p> 1244 * 1245 * @see CaptureRequest#LENS_FOCAL_LENGTH 1246 * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE 1247 * @see CaptureResult#LENS_STATE 1248 */ 1249 public static final Key<Float> LENS_FOCUS_DISTANCE = 1250 new Key<Float>("android.lens.focusDistance", float.class); 1251 1252 /** 1253 * <p>Sets whether the camera device uses optical image stabilization (OIS) 1254 * when capturing images.</p> 1255 * <p>OIS is used to compensate for motion blur due to small 1256 * movements of the camera during capture. Unlike digital image 1257 * stabilization ({@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}), OIS 1258 * makes use of mechanical elements to stabilize the camera 1259 * sensor, and thus allows for longer exposure times before 1260 * camera shake becomes apparent.</p> 1261 * <p>Not all devices will support OIS; see 1262 * {@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization} for 1263 * available controls.</p> 1264 * 1265 * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE 1266 * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION 1267 * @see #LENS_OPTICAL_STABILIZATION_MODE_OFF 1268 * @see #LENS_OPTICAL_STABILIZATION_MODE_ON 1269 */ 1270 public static final Key<Integer> LENS_OPTICAL_STABILIZATION_MODE = 1271 new Key<Integer>("android.lens.opticalStabilizationMode", int.class); 1272 1273 /** 1274 * <p>Mode of operation for the noise reduction algorithm.</p> 1275 * <p>Noise filtering control. OFF means no noise reduction 1276 * will be applied by the camera device.</p> 1277 * <p>This must be set to a valid mode from 1278 * {@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes}.</p> 1279 * <p>FAST/HIGH_QUALITY both mean camera device determined noise filtering 1280 * will be applied. HIGH_QUALITY mode indicates that the camera device 1281 * will use the highest-quality noise filtering algorithms, 1282 * even if it slows down capture rate. FAST means the camera device will not 1283 * slow down capture rate when applying noise filtering.</p> 1284 * 1285 * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES 1286 * @see #NOISE_REDUCTION_MODE_OFF 1287 * @see #NOISE_REDUCTION_MODE_FAST 1288 * @see #NOISE_REDUCTION_MODE_HIGH_QUALITY 1289 */ 1290 public static final Key<Integer> NOISE_REDUCTION_MODE = 1291 new Key<Integer>("android.noiseReduction.mode", int.class); 1292 1293 /** 1294 * <p>An application-specified ID for the current 1295 * request. Must be maintained unchanged in output 1296 * frame</p> 1297 * @hide 1298 */ 1299 public static final Key<Integer> REQUEST_ID = 1300 new Key<Integer>("android.request.id", int.class); 1301 1302 /** 1303 * <p>The region of the sensor to read out for this capture.</p> 1304 * <p>The crop region coordinate system is based off 1305 * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, with <code>(0, 0)</code> being the 1306 * top-left corner of the sensor active array.</p> 1307 * <p>Output streams use this rectangle to produce their output, 1308 * cropping to a smaller region if necessary to maintain the 1309 * stream's aspect ratio, then scaling the sensor input to 1310 * match the output's configured resolution.</p> 1311 * <p>The crop region is applied after the RAW to other color 1312 * space (e.g. YUV) conversion. Since raw streams 1313 * (e.g. RAW16) don't have the conversion stage, they are not 1314 * croppable. The crop region will be ignored by raw streams.</p> 1315 * <p>For non-raw streams, any additional per-stream cropping will 1316 * be done to maximize the final pixel area of the stream.</p> 1317 * <p>For example, if the crop region is set to a 4:3 aspect 1318 * ratio, then 4:3 streams will use the exact crop 1319 * region. 16:9 streams will further crop vertically 1320 * (letterbox).</p> 1321 * <p>Conversely, if the crop region is set to a 16:9, then 4:3 1322 * outputs will crop horizontally (pillarbox), and 16:9 1323 * streams will match exactly. These additional crops will 1324 * be centered within the crop region.</p> 1325 * <p>The width and height of the crop region cannot 1326 * be set to be smaller than 1327 * <code>floor( activeArraySize.width / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code> and 1328 * <code>floor( activeArraySize.height / {@link CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM android.scaler.availableMaxDigitalZoom} )</code>, respectively.</p> 1329 * <p>The camera device may adjust the crop region to account 1330 * for rounding and other hardware requirements; the final 1331 * crop region used will be included in the output capture 1332 * result.</p> 1333 * 1334 * @see CameraCharacteristics#SCALER_AVAILABLE_MAX_DIGITAL_ZOOM 1335 * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE 1336 */ 1337 public static final Key<android.graphics.Rect> SCALER_CROP_REGION = 1338 new Key<android.graphics.Rect>("android.scaler.cropRegion", android.graphics.Rect.class); 1339 1340 /** 1341 * <p>Duration each pixel is exposed to 1342 * light.</p> 1343 * <p>If the sensor can't expose this exact duration, it should shorten the 1344 * duration exposed to the nearest possible value (rather than expose longer).</p> 1345 */ 1346 public static final Key<Long> SENSOR_EXPOSURE_TIME = 1347 new Key<Long>("android.sensor.exposureTime", long.class); 1348 1349 /** 1350 * <p>Duration from start of frame exposure to 1351 * start of next frame exposure.</p> 1352 * <p>The maximum frame rate that can be supported by a camera subsystem is 1353 * a function of many factors:</p> 1354 * <ul> 1355 * <li>Requested resolutions of output image streams</li> 1356 * <li>Availability of binning / skipping modes on the imager</li> 1357 * <li>The bandwidth of the imager interface</li> 1358 * <li>The bandwidth of the various ISP processing blocks</li> 1359 * </ul> 1360 * <p>Since these factors can vary greatly between different ISPs and 1361 * sensors, the camera abstraction tries to represent the bandwidth 1362 * restrictions with as simple a model as possible.</p> 1363 * <p>The model presented has the following characteristics:</p> 1364 * <ul> 1365 * <li>The image sensor is always configured to output the smallest 1366 * resolution possible given the application's requested output stream 1367 * sizes. The smallest resolution is defined as being at least as large 1368 * as the largest requested output stream size; the camera pipeline must 1369 * never digitally upsample sensor data when the crop region covers the 1370 * whole sensor. In general, this means that if only small output stream 1371 * resolutions are configured, the sensor can provide a higher frame 1372 * rate.</li> 1373 * <li>Since any request may use any or all the currently configured 1374 * output streams, the sensor and ISP must be configured to support 1375 * scaling a single capture to all the streams at the same time. This 1376 * means the camera pipeline must be ready to produce the largest 1377 * requested output size without any delay. Therefore, the overall 1378 * frame rate of a given configured stream set is governed only by the 1379 * largest requested stream resolution.</li> 1380 * <li>Using more than one output stream in a request does not affect the 1381 * frame duration.</li> 1382 * <li>Certain format-streams may need to do additional background processing 1383 * before data is consumed/produced by that stream. These processors 1384 * can run concurrently to the rest of the camera pipeline, but 1385 * cannot process more than 1 capture at a time.</li> 1386 * </ul> 1387 * <p>The necessary information for the application, given the model above, 1388 * is provided via the {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} field 1389 * using StreamConfigurationMap#getOutputMinFrameDuration(int, Size). 1390 * These are used to determine the maximum frame rate / minimum frame 1391 * duration that is possible for a given stream configuration.</p> 1392 * <p>Specifically, the application can use the following rules to 1393 * determine the minimum frame duration it can request from the camera 1394 * device:</p> 1395 * <ol> 1396 * <li>Let the set of currently configured input/output streams 1397 * be called <code>S</code>.</li> 1398 * <li>Find the minimum frame durations for each stream in <code>S</code>, by 1399 * looking it up in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} using 1400 * StreamConfigurationMap#getOutputMinFrameDuration(int, Size) (with 1401 * its respective size/format). Let this set of frame durations be called 1402 * <code>F</code>.</li> 1403 * <li>For any given request <code>R</code>, the minimum frame duration allowed 1404 * for <code>R</code> is the maximum out of all values in <code>F</code>. Let the streams 1405 * used in <code>R</code> be called <code>S_r</code>.</li> 1406 * </ol> 1407 * <p>If none of the streams in <code>S_r</code> have a stall time (listed in 1408 * StreamConfigurationMap#getOutputStallDuration(int,Size) using its 1409 * respective size/format), then the frame duration in 1410 * <code>F</code> determines the steady state frame rate that the application will 1411 * get if it uses <code>R</code> as a repeating request. Let this special kind 1412 * of request be called <code>Rsimple</code>.</p> 1413 * <p>A repeating request <code>Rsimple</code> can be <em>occasionally</em> interleaved 1414 * by a single capture of a new request <code>Rstall</code> (which has at least 1415 * one in-use stream with a non-0 stall time) and if <code>Rstall</code> has the 1416 * same minimum frame duration this will not cause a frame rate loss 1417 * if all buffers from the previous <code>Rstall</code> have already been 1418 * delivered.</p> 1419 * <p>For more details about stalling, see 1420 * StreamConfigurationMap#getOutputStallDuration(int,Size).</p> 1421 * 1422 * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP 1423 */ 1424 public static final Key<Long> SENSOR_FRAME_DURATION = 1425 new Key<Long>("android.sensor.frameDuration", long.class); 1426 1427 /** 1428 * <p>The amount of gain applied to sensor data 1429 * before processing.</p> 1430 * <p>The sensitivity is the standard ISO sensitivity value, 1431 * as defined in ISO 12232:2006.</p> 1432 * <p>The sensitivity must be within {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}, and 1433 * if if it less than {@link CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY android.sensor.maxAnalogSensitivity}, the camera device 1434 * is guaranteed to use only analog amplification for applying the gain.</p> 1435 * <p>If the camera device cannot apply the exact sensitivity 1436 * requested, it will reduce the gain to the nearest supported 1437 * value. The final sensitivity used will be available in the 1438 * output capture result.</p> 1439 * 1440 * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE 1441 * @see CameraCharacteristics#SENSOR_MAX_ANALOG_SENSITIVITY 1442 */ 1443 public static final Key<Integer> SENSOR_SENSITIVITY = 1444 new Key<Integer>("android.sensor.sensitivity", int.class); 1445 1446 /** 1447 * <p>A pixel <code>[R, G_even, G_odd, B]</code> that supplies the test pattern 1448 * when {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode} is SOLID_COLOR.</p> 1449 * <p>Each color channel is treated as an unsigned 32-bit integer. 1450 * The camera device then uses the most significant X bits 1451 * that correspond to how many bits are in its Bayer raw sensor 1452 * output.</p> 1453 * <p>For example, a sensor with RAW10 Bayer output would use the 1454 * 10 most significant bits from each color channel.</p> 1455 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1456 * 1457 * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE 1458 */ 1459 public static final Key<int[]> SENSOR_TEST_PATTERN_DATA = 1460 new Key<int[]>("android.sensor.testPatternData", int[].class); 1461 1462 /** 1463 * <p>When enabled, the sensor sends a test pattern instead of 1464 * doing a real exposure from the camera.</p> 1465 * <p>When a test pattern is enabled, all manual sensor controls specified 1466 * by android.sensor.* will be ignored. All other controls should 1467 * work as normal.</p> 1468 * <p>For example, if manual flash is enabled, flash firing should still 1469 * occur (and that the test pattern remain unmodified, since the flash 1470 * would not actually affect it).</p> 1471 * <p><b>Optional</b> - This value may be {@code null} on some devices.</p> 1472 * @see #SENSOR_TEST_PATTERN_MODE_OFF 1473 * @see #SENSOR_TEST_PATTERN_MODE_SOLID_COLOR 1474 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS 1475 * @see #SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY 1476 * @see #SENSOR_TEST_PATTERN_MODE_PN9 1477 * @see #SENSOR_TEST_PATTERN_MODE_CUSTOM1 1478 */ 1479 public static final Key<Integer> SENSOR_TEST_PATTERN_MODE = 1480 new Key<Integer>("android.sensor.testPatternMode", int.class); 1481 1482 /** 1483 * <p>Quality of lens shading correction applied 1484 * to the image data.</p> 1485 * <p>When set to OFF mode, no lens shading correction will be applied by the 1486 * camera device, and an identity lens shading map data will be provided 1487 * if <code>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON</code>. For example, for lens 1488 * shading map with size specified as <code>android.lens.info.shadingMapSize = [ 4, 3 ]</code>, 1489 * the output android.statistics.lensShadingMap for this case will be an identity map 1490 * shown below:</p> 1491 * <pre><code>[ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1492 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1493 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1494 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1495 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1496 * 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ] 1497 * </code></pre> 1498 * <p>When set to other modes, lens shading correction will be applied by the 1499 * camera device. Applications can request lens shading map data by setting 1500 * {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} to ON, and then the camera device will provide 1501 * lens shading map data in android.statistics.lensShadingMap, with size specified 1502 * by android.lens.info.shadingMapSize; the returned shading map data will be the one 1503 * applied by the camera device for this capture request.</p> 1504 * <p>The shading map data may depend on the auto-exposure (AE) and AWB statistics, therefore the reliability 1505 * of the map data may be affected by the AE and AWB algorithms. When AE and AWB are in 1506 * AUTO modes({@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} <code>!=</code> OFF and {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} <code>!=</code> OFF), 1507 * to get best results, it is recommended that the applications wait for the AE and AWB to 1508 * be converged before using the returned shading map data.</p> 1509 * 1510 * @see CaptureRequest#CONTROL_AE_MODE 1511 * @see CaptureRequest#CONTROL_AWB_MODE 1512 * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE 1513 * @see #SHADING_MODE_OFF 1514 * @see #SHADING_MODE_FAST 1515 * @see #SHADING_MODE_HIGH_QUALITY 1516 */ 1517 public static final Key<Integer> SHADING_MODE = 1518 new Key<Integer>("android.shading.mode", int.class); 1519 1520 /** 1521 * <p>Control for the face detector 1522 * unit.</p> 1523 * <p>Whether face detection is enabled, and whether it 1524 * should output just the basic fields or the full set of 1525 * fields. Value must be one of the 1526 * {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes}.</p> 1527 * 1528 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES 1529 * @see #STATISTICS_FACE_DETECT_MODE_OFF 1530 * @see #STATISTICS_FACE_DETECT_MODE_SIMPLE 1531 * @see #STATISTICS_FACE_DETECT_MODE_FULL 1532 */ 1533 public static final Key<Integer> STATISTICS_FACE_DETECT_MODE = 1534 new Key<Integer>("android.statistics.faceDetectMode", int.class); 1535 1536 /** 1537 * <p>Operating mode for hotpixel map generation.</p> 1538 * <p>If set to ON, a hotpixel map is returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}. 1539 * If set to OFF, no hotpixel map will be returned.</p> 1540 * <p>This must be set to a valid mode from {@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES android.statistics.info.availableHotPixelMapModes}.</p> 1541 * 1542 * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP 1543 * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES 1544 */ 1545 public static final Key<Boolean> STATISTICS_HOT_PIXEL_MAP_MODE = 1546 new Key<Boolean>("android.statistics.hotPixelMapMode", boolean.class); 1547 1548 /** 1549 * <p>Whether the camera device will output the lens 1550 * shading map in output result metadata.</p> 1551 * <p>When set to ON, 1552 * android.statistics.lensShadingMap will be provided in 1553 * the output result metadata.</p> 1554 * @see #STATISTICS_LENS_SHADING_MAP_MODE_OFF 1555 * @see #STATISTICS_LENS_SHADING_MAP_MODE_ON 1556 */ 1557 public static final Key<Integer> STATISTICS_LENS_SHADING_MAP_MODE = 1558 new Key<Integer>("android.statistics.lensShadingMapMode", int.class); 1559 1560 /** 1561 * <p>Tonemapping / contrast / gamma curve for the blue 1562 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1563 * CONTRAST_CURVE.</p> 1564 * <p>See android.tonemap.curveRed for more details.</p> 1565 * 1566 * @see CaptureRequest#TONEMAP_MODE 1567 * @hide 1568 */ 1569 public static final Key<float[]> TONEMAP_CURVE_BLUE = 1570 new Key<float[]>("android.tonemap.curveBlue", float[].class); 1571 1572 /** 1573 * <p>Tonemapping / contrast / gamma curve for the green 1574 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1575 * CONTRAST_CURVE.</p> 1576 * <p>See android.tonemap.curveRed for more details.</p> 1577 * 1578 * @see CaptureRequest#TONEMAP_MODE 1579 * @hide 1580 */ 1581 public static final Key<float[]> TONEMAP_CURVE_GREEN = 1582 new Key<float[]>("android.tonemap.curveGreen", float[].class); 1583 1584 /** 1585 * <p>Tonemapping / contrast / gamma curve for the red 1586 * channel, to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1587 * CONTRAST_CURVE.</p> 1588 * <p>Each channel's curve is defined by an array of control points:</p> 1589 * <pre><code>android.tonemap.curveRed = 1590 * [ P0in, P0out, P1in, P1out, P2in, P2out, P3in, P3out, ..., PNin, PNout ] 1591 * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 1592 * <p>These are sorted in order of increasing <code>Pin</code>; it is always 1593 * guaranteed that input values 0.0 and 1.0 are included in the list to 1594 * define a complete mapping. For input values between control points, 1595 * the camera device must linearly interpolate between the control 1596 * points.</p> 1597 * <p>Each curve can have an independent number of points, and the number 1598 * of points can be less than max (that is, the request doesn't have to 1599 * always provide a curve with number of points equivalent to 1600 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 1601 * <p>A few examples, and their corresponding graphical mappings; these 1602 * only specify the red channel and the precision is limited to 4 1603 * digits, for conciseness.</p> 1604 * <p>Linear mapping:</p> 1605 * <pre><code>android.tonemap.curveRed = [ 0, 0, 1.0, 1.0 ] 1606 * </code></pre> 1607 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 1608 * <p>Invert mapping:</p> 1609 * <pre><code>android.tonemap.curveRed = [ 0, 1.0, 1.0, 0 ] 1610 * </code></pre> 1611 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 1612 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 1613 * <pre><code>android.tonemap.curveRed = [ 1614 * 0.0000, 0.0000, 0.0667, 0.2920, 0.1333, 0.4002, 0.2000, 0.4812, 1615 * 0.2667, 0.5484, 0.3333, 0.6069, 0.4000, 0.6594, 0.4667, 0.7072, 1616 * 0.5333, 0.7515, 0.6000, 0.7928, 0.6667, 0.8317, 0.7333, 0.8685, 1617 * 0.8000, 0.9035, 0.8667, 0.9370, 0.9333, 0.9691, 1.0000, 1.0000 ] 1618 * </code></pre> 1619 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 1620 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 1621 * <pre><code>android.tonemap.curveRed = [ 1622 * 0.0000, 0.0000, 0.0667, 0.2864, 0.1333, 0.4007, 0.2000, 0.4845, 1623 * 0.2667, 0.5532, 0.3333, 0.6125, 0.4000, 0.6652, 0.4667, 0.7130, 1624 * 0.5333, 0.7569, 0.6000, 0.7977, 0.6667, 0.8360, 0.7333, 0.8721, 1625 * 0.8000, 0.9063, 0.8667, 0.9389, 0.9333, 0.9701, 1.0000, 1.0000 ] 1626 * </code></pre> 1627 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 1628 * 1629 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 1630 * @see CaptureRequest#TONEMAP_MODE 1631 * @hide 1632 */ 1633 public static final Key<float[]> TONEMAP_CURVE_RED = 1634 new Key<float[]>("android.tonemap.curveRed", float[].class); 1635 1636 /** 1637 * <p>Tonemapping / contrast / gamma curve to use when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} 1638 * is CONTRAST_CURVE.</p> 1639 * <p>The tonemapCurve consist of three curves for each of red, green, and blue 1640 * channels respectively. The following example uses the red channel as an 1641 * example. The same logic applies to green and blue channel. 1642 * Each channel's curve is defined by an array of control points:</p> 1643 * <pre><code>curveRed = 1644 * [ P0(in, out), P1(in, out), P2(in, out), P3(in, out), ..., PN(in, out) ] 1645 * 2 <= N <= {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</code></pre> 1646 * <p>These are sorted in order of increasing <code>Pin</code>; it is always 1647 * guaranteed that input values 0.0 and 1.0 are included in the list to 1648 * define a complete mapping. For input values between control points, 1649 * the camera device must linearly interpolate between the control 1650 * points.</p> 1651 * <p>Each curve can have an independent number of points, and the number 1652 * of points can be less than max (that is, the request doesn't have to 1653 * always provide a curve with number of points equivalent to 1654 * {@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}).</p> 1655 * <p>A few examples, and their corresponding graphical mappings; these 1656 * only specify the red channel and the precision is limited to 4 1657 * digits, for conciseness.</p> 1658 * <p>Linear mapping:</p> 1659 * <pre><code>curveRed = [ (0, 0), (1.0, 1.0) ] 1660 * </code></pre> 1661 * <p><img alt="Linear mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png" /></p> 1662 * <p>Invert mapping:</p> 1663 * <pre><code>curveRed = [ (0, 1.0), (1.0, 0) ] 1664 * </code></pre> 1665 * <p><img alt="Inverting mapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png" /></p> 1666 * <p>Gamma 1/2.2 mapping, with 16 control points:</p> 1667 * <pre><code>curveRed = [ 1668 * (0.0000, 0.0000), (0.0667, 0.2920), (0.1333, 0.4002), (0.2000, 0.4812), 1669 * (0.2667, 0.5484), (0.3333, 0.6069), (0.4000, 0.6594), (0.4667, 0.7072), 1670 * (0.5333, 0.7515), (0.6000, 0.7928), (0.6667, 0.8317), (0.7333, 0.8685), 1671 * (0.8000, 0.9035), (0.8667, 0.9370), (0.9333, 0.9691), (1.0000, 1.0000) ] 1672 * </code></pre> 1673 * <p><img alt="Gamma = 1/2.2 tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png" /></p> 1674 * <p>Standard sRGB gamma mapping, per IEC 61966-2-1:1999, with 16 control points:</p> 1675 * <pre><code>curveRed = [ 1676 * (0.0000, 0.0000), (0.0667, 0.2864), (0.1333, 0.4007), (0.2000, 0.4845), 1677 * (0.2667, 0.5532), (0.3333, 0.6125), (0.4000, 0.6652), (0.4667, 0.7130), 1678 * (0.5333, 0.7569), (0.6000, 0.7977), (0.6667, 0.8360), (0.7333, 0.8721), 1679 * (0.8000, 0.9063), (0.8667, 0.9389), (0.9333, 0.9701), (1.0000, 1.0000) ] 1680 * </code></pre> 1681 * <p><img alt="sRGB tonemapping curve" src="../../../../images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png" /></p> 1682 * 1683 * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS 1684 * @see CaptureRequest#TONEMAP_MODE 1685 */ 1686 public static final Key<android.hardware.camera2.params.TonemapCurve> TONEMAP_CURVE = 1687 new Key<android.hardware.camera2.params.TonemapCurve>("android.tonemap.curve", android.hardware.camera2.params.TonemapCurve.class); 1688 1689 /** 1690 * <p>High-level global contrast/gamma/tonemapping control.</p> 1691 * <p>When switching to an application-defined contrast curve by setting 1692 * {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} to CONTRAST_CURVE, the curve is defined 1693 * per-channel with a set of <code>(in, out)</code> points that specify the 1694 * mapping from input high-bit-depth pixel value to the output 1695 * low-bit-depth value. Since the actual pixel ranges of both input 1696 * and output may change depending on the camera pipeline, the values 1697 * are specified by normalized floating-point numbers.</p> 1698 * <p>More-complex color mapping operations such as 3D color look-up 1699 * tables, selective chroma enhancement, or other non-linear color 1700 * transforms will be disabled when {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} is 1701 * CONTRAST_CURVE.</p> 1702 * <p>This must be set to a valid mode in 1703 * {@link CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES android.tonemap.availableToneMapModes}.</p> 1704 * <p>When using either FAST or HIGH_QUALITY, the camera device will 1705 * emit its own tonemap curve in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}. 1706 * These values are always available, and as close as possible to the 1707 * actually used nonlinear/nonglobal transforms.</p> 1708 * <p>If a request is sent with CONTRAST_CURVE with the camera device's 1709 * provided curve in FAST or HIGH_QUALITY, the image's tonemap will be 1710 * roughly the same.</p> 1711 * 1712 * @see CameraCharacteristics#TONEMAP_AVAILABLE_TONE_MAP_MODES 1713 * @see CaptureRequest#TONEMAP_CURVE 1714 * @see CaptureRequest#TONEMAP_MODE 1715 * @see #TONEMAP_MODE_CONTRAST_CURVE 1716 * @see #TONEMAP_MODE_FAST 1717 * @see #TONEMAP_MODE_HIGH_QUALITY 1718 */ 1719 public static final Key<Integer> TONEMAP_MODE = 1720 new Key<Integer>("android.tonemap.mode", int.class); 1721 1722 /** 1723 * <p>This LED is nominally used to indicate to the user 1724 * that the camera is powered on and may be streaming images back to the 1725 * Application Processor. In certain rare circumstances, the OS may 1726 * disable this when video is processed locally and not transmitted to 1727 * any untrusted applications.</p> 1728 * <p>In particular, the LED <em>must</em> always be on when the data could be 1729 * transmitted off the device. The LED <em>should</em> always be on whenever 1730 * data is stored locally on the device.</p> 1731 * <p>The LED <em>may</em> be off if a trusted application is using the data that 1732 * doesn't violate the above rules.</p> 1733 * @hide 1734 */ 1735 public static final Key<Boolean> LED_TRANSMIT = 1736 new Key<Boolean>("android.led.transmit", boolean.class); 1737 1738 /** 1739 * <p>Whether black-level compensation is locked 1740 * to its current values, or is free to vary.</p> 1741 * <p>When set to ON, the values used for black-level 1742 * compensation will not change until the lock is set to 1743 * OFF.</p> 1744 * <p>Since changes to certain capture parameters (such as 1745 * exposure time) may require resetting of black level 1746 * compensation, the camera device must report whether setting 1747 * the black level lock was successful in the output result 1748 * metadata.</p> 1749 * <p>For example, if a sequence of requests is as follows:</p> 1750 * <ul> 1751 * <li>Request 1: Exposure = 10ms, Black level lock = OFF</li> 1752 * <li>Request 2: Exposure = 10ms, Black level lock = ON</li> 1753 * <li>Request 3: Exposure = 10ms, Black level lock = ON</li> 1754 * <li>Request 4: Exposure = 20ms, Black level lock = ON</li> 1755 * <li>Request 5: Exposure = 20ms, Black level lock = ON</li> 1756 * <li>Request 6: Exposure = 20ms, Black level lock = ON</li> 1757 * </ul> 1758 * <p>And the exposure change in Request 4 requires the camera 1759 * device to reset the black level offsets, then the output 1760 * result metadata is expected to be:</p> 1761 * <ul> 1762 * <li>Result 1: Exposure = 10ms, Black level lock = OFF</li> 1763 * <li>Result 2: Exposure = 10ms, Black level lock = ON</li> 1764 * <li>Result 3: Exposure = 10ms, Black level lock = ON</li> 1765 * <li>Result 4: Exposure = 20ms, Black level lock = OFF</li> 1766 * <li>Result 5: Exposure = 20ms, Black level lock = ON</li> 1767 * <li>Result 6: Exposure = 20ms, Black level lock = ON</li> 1768 * </ul> 1769 * <p>This indicates to the application that on frame 4, black 1770 * levels were reset due to exposure value changes, and pixel 1771 * values may not be consistent across captures.</p> 1772 * <p>The camera device will maintain the lock to the extent 1773 * possible, only overriding the lock to OFF when changes to 1774 * other request parameters require a black level recalculation 1775 * or reset.</p> 1776 */ 1777 public static final Key<Boolean> BLACK_LEVEL_LOCK = 1778 new Key<Boolean>("android.blackLevel.lock", boolean.class); 1779 1780 /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ 1781 * End generated code 1782 *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ 1783} 1784