Home | History | Annotate | Download | only in camera2
      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 
     17 package android.hardware.camera2;
     18 
     19 import android.annotation.NonNull;
     20 import android.annotation.Nullable;
     21 import android.hardware.camera2.impl.CameraMetadataNative;
     22 import android.hardware.camera2.impl.PublicKey;
     23 import android.hardware.camera2.impl.SyntheticKey;
     24 import android.hardware.camera2.utils.TypeReference;
     25 import android.util.Rational;
     26 
     27 import java.util.Collections;
     28 import java.util.List;
     29 
     30 /**
     31  * <p>The properties describing a
     32  * {@link CameraDevice CameraDevice}.</p>
     33  *
     34  * <p>These properties are fixed for a given CameraDevice, and can be queried
     35  * through the {@link CameraManager CameraManager}
     36  * interface with {@link CameraManager#getCameraCharacteristics}.</p>
     37  *
     38  * <p>{@link CameraCharacteristics} objects are immutable.</p>
     39  *
     40  * @see CameraDevice
     41  * @see CameraManager
     42  */
     43 public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
     44 
     45     /**
     46      * A {@code Key} is used to do camera characteristics field lookups with
     47      * {@link CameraCharacteristics#get}.
     48      *
     49      * <p>For example, to get the stream configuration map:
     50      * <code><pre>
     51      * StreamConfigurationMap map = cameraCharacteristics.get(
     52      *      CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
     53      * </pre></code>
     54      * </p>
     55      *
     56      * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
     57      * {@link CameraCharacteristics#getKeys()}.</p>
     58      *
     59      * @see CameraCharacteristics#get
     60      * @see CameraCharacteristics#getKeys()
     61      */
     62     public static final class Key<T> {
     63         private final CameraMetadataNative.Key<T> mKey;
     64 
     65         /**
     66          * Visible for testing and vendor extensions only.
     67          *
     68          * @hide
     69          */
     70         public Key(String name, Class<T> type) {
     71             mKey = new CameraMetadataNative.Key<T>(name,  type);
     72         }
     73 
     74         /**
     75          * Visible for testing and vendor extensions only.
     76          *
     77          * @hide
     78          */
     79         public Key(String name, TypeReference<T> typeReference) {
     80             mKey = new CameraMetadataNative.Key<T>(name,  typeReference);
     81         }
     82 
     83         /**
     84          * Return a camelCase, period separated name formatted like:
     85          * {@code "root.section[.subsections].name"}.
     86          *
     87          * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
     88          * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
     89          *
     90          * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
     91          * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
     92          * specific key might look like {@code "com.google.nexus.data.private"}.</p>
     93          *
     94          * @return String representation of the key name
     95          */
     96         @NonNull
     97         public String getName() {
     98             return mKey.getName();
     99         }
    100 
    101         /**
    102          * {@inheritDoc}
    103          */
    104         @Override
    105         public final int hashCode() {
    106             return mKey.hashCode();
    107         }
    108 
    109         /**
    110          * {@inheritDoc}
    111          */
    112         @SuppressWarnings("unchecked")
    113         @Override
    114         public final boolean equals(Object o) {
    115             return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
    116         }
    117 
    118         /**
    119          * Return this {@link Key} as a string representation.
    120          *
    121          * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
    122          * the name of this key as returned by {@link #getName}.</p>
    123          *
    124          * @return string representation of {@link Key}
    125          */
    126         @NonNull
    127         @Override
    128         public String toString() {
    129             return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
    130         }
    131 
    132         /**
    133          * Visible for CameraMetadataNative implementation only; do not use.
    134          *
    135          * TODO: Make this private or remove it altogether.
    136          *
    137          * @hide
    138          */
    139         public CameraMetadataNative.Key<T> getNativeKey() {
    140             return mKey;
    141         }
    142 
    143         @SuppressWarnings({
    144                 "unused", "unchecked"
    145         })
    146         private Key(CameraMetadataNative.Key<?> nativeKey) {
    147             mKey = (CameraMetadataNative.Key<T>) nativeKey;
    148         }
    149     }
    150 
    151     private final CameraMetadataNative mProperties;
    152     private List<CameraCharacteristics.Key<?>> mKeys;
    153     private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
    154     private List<CaptureResult.Key<?>> mAvailableResultKeys;
    155 
    156     /**
    157      * Takes ownership of the passed-in properties object
    158      * @hide
    159      */
    160     public CameraCharacteristics(CameraMetadataNative properties) {
    161         mProperties = CameraMetadataNative.move(properties);
    162     }
    163 
    164     /**
    165      * Returns a copy of the underlying {@link CameraMetadataNative}.
    166      * @hide
    167      */
    168     public CameraMetadataNative getNativeCopy() {
    169         return new CameraMetadataNative(mProperties);
    170     }
    171 
    172     /**
    173      * Get a camera characteristics field value.
    174      *
    175      * <p>The field definitions can be
    176      * found in {@link CameraCharacteristics}.</p>
    177      *
    178      * <p>Querying the value for the same key more than once will return a value
    179      * which is equal to the previous queried value.</p>
    180      *
    181      * @throws IllegalArgumentException if the key was not valid
    182      *
    183      * @param key The characteristics field to read.
    184      * @return The value of that key, or {@code null} if the field is not set.
    185      */
    186     @Nullable
    187     public <T> T get(Key<T> key) {
    188         return mProperties.get(key);
    189     }
    190 
    191     /**
    192      * {@inheritDoc}
    193      * @hide
    194      */
    195     @SuppressWarnings("unchecked")
    196     @Override
    197     protected <T> T getProtected(Key<?> key) {
    198         return (T) mProperties.get(key);
    199     }
    200 
    201     /**
    202      * {@inheritDoc}
    203      * @hide
    204      */
    205     @SuppressWarnings("unchecked")
    206     @Override
    207     protected Class<Key<?>> getKeyClass() {
    208         Object thisClass = Key.class;
    209         return (Class<Key<?>>)thisClass;
    210     }
    211 
    212     /**
    213      * {@inheritDoc}
    214      */
    215     @NonNull
    216     @Override
    217     public List<Key<?>> getKeys() {
    218         // List of keys is immutable; cache the results after we calculate them
    219         if (mKeys != null) {
    220             return mKeys;
    221         }
    222 
    223         int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
    224         if (filterTags == null) {
    225             throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
    226                     + " in the characteristics");
    227         }
    228 
    229         mKeys = Collections.unmodifiableList(
    230                 getKeysStatic(getClass(), getKeyClass(), this, filterTags));
    231         return mKeys;
    232     }
    233 
    234     /**
    235      * Returns the list of keys supported by this {@link CameraDevice} for querying
    236      * with a {@link CaptureRequest}.
    237      *
    238      * <p>The list returned is not modifiable, so any attempts to modify it will throw
    239      * a {@code UnsupportedOperationException}.</p>
    240      *
    241      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
    242      *
    243      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
    244      * {@link #getKeys()} instead.</p>
    245      *
    246      * @return List of keys supported by this CameraDevice for CaptureRequests.
    247      */
    248     @SuppressWarnings({"unchecked"})
    249     @NonNull
    250     public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
    251         if (mAvailableRequestKeys == null) {
    252             Object crKey = CaptureRequest.Key.class;
    253             Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
    254 
    255             int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
    256             if (filterTags == null) {
    257                 throw new AssertionError("android.request.availableRequestKeys must be non-null "
    258                         + "in the characteristics");
    259             }
    260             mAvailableRequestKeys =
    261                     getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
    262         }
    263         return mAvailableRequestKeys;
    264     }
    265 
    266     /**
    267      * Returns the list of keys supported by this {@link CameraDevice} for querying
    268      * with a {@link CaptureResult}.
    269      *
    270      * <p>The list returned is not modifiable, so any attempts to modify it will throw
    271      * a {@code UnsupportedOperationException}.</p>
    272      *
    273      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
    274      *
    275      * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
    276      * {@link #getKeys()} instead.</p>
    277      *
    278      * @return List of keys supported by this CameraDevice for CaptureResults.
    279      */
    280     @SuppressWarnings({"unchecked"})
    281     @NonNull
    282     public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
    283         if (mAvailableResultKeys == null) {
    284             Object crKey = CaptureResult.Key.class;
    285             Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
    286 
    287             int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
    288             if (filterTags == null) {
    289                 throw new AssertionError("android.request.availableResultKeys must be non-null "
    290                         + "in the characteristics");
    291             }
    292             mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags);
    293         }
    294         return mAvailableResultKeys;
    295     }
    296 
    297     /**
    298      * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
    299      *
    300      * <p>The list returned is not modifiable, so any attempts to modify it will throw
    301      * a {@code UnsupportedOperationException}.</p>
    302      *
    303      * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
    304      *
    305      * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
    306      * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
    307      *
    308      * @return List of keys supported by this CameraDevice for metadataClass.
    309      *
    310      * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
    311      */
    312     private <TKey> List<TKey>
    313     getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags) {
    314 
    315         if (metadataClass.equals(CameraMetadata.class)) {
    316             throw new AssertionError(
    317                     "metadataClass must be a strict subclass of CameraMetadata");
    318         } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
    319             throw new AssertionError(
    320                     "metadataClass must be a subclass of CameraMetadata");
    321         }
    322 
    323         List<TKey> staticKeyList = CameraCharacteristics.<TKey>getKeysStatic(
    324                 metadataClass, keyClass, /*instance*/null, filterTags);
    325         return Collections.unmodifiableList(staticKeyList);
    326     }
    327 
    328     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
    329      * The key entries below this point are generated from metadata
    330      * definitions in /system/media/camera/docs. Do not modify by hand or
    331      * modify the comment blocks at the start or end.
    332      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
    333 
    334     /**
    335      * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
    336      * supported by this camera device.</p>
    337      * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}.  If no
    338      * aberration correction modes are available for a device, this list will solely include
    339      * OFF mode. All camera devices will support either OFF or FAST mode.</p>
    340      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
    341      * OFF mode. This includes all FULL level devices.</p>
    342      * <p>LEGACY devices will always only support FAST mode.</p>
    343      * <p><b>Range of valid values:</b><br>
    344      * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
    345      * <p>This key is available on all devices.</p>
    346      *
    347      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
    348      */
    349     @PublicKey
    350     public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
    351             new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
    352 
    353     /**
    354      * <p>List of auto-exposure antibanding modes for {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} that are
    355      * supported by this camera device.</p>
    356      * <p>Not all of the auto-exposure anti-banding modes may be
    357      * supported by a given camera device. This field lists the
    358      * valid anti-banding modes that the application may request
    359      * for this camera device with the
    360      * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
    361      * <p><b>Range of valid values:</b><br>
    362      * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
    363      * <p>This key is available on all devices.</p>
    364      *
    365      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
    366      */
    367     @PublicKey
    368     public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
    369             new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
    370 
    371     /**
    372      * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
    373      * device.</p>
    374      * <p>Not all the auto-exposure modes may be supported by a
    375      * given camera device, especially if no flash unit is
    376      * available. This entry lists the valid modes for
    377      * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
    378      * <p>All camera devices support ON, and all camera devices with flash
    379      * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
    380      * <p>FULL mode camera devices always support OFF mode,
    381      * which enables application control of camera exposure time,
    382      * sensitivity, and frame duration.</p>
    383      * <p>LEGACY mode camera devices never support OFF mode.
    384      * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
    385      * capability.</p>
    386      * <p><b>Range of valid values:</b><br>
    387      * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
    388      * <p>This key is available on all devices.</p>
    389      *
    390      * @see CaptureRequest#CONTROL_AE_MODE
    391      */
    392     @PublicKey
    393     public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
    394             new Key<int[]>("android.control.aeAvailableModes", int[].class);
    395 
    396     /**
    397      * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
    398      * this camera device.</p>
    399      * <p>For devices at the LEGACY level or above:</p>
    400      * <ul>
    401      * <li>This list will always include (30, 30).</li>
    402      * <li>Also, for constant-framerate recording, for each normal
    403      * {@link android.media.CamcorderProfile CamcorderProfile} that has
    404      * {@link android.media.CamcorderProfile#quality quality} in
    405      * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
    406      * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
    407      * supported by the device and has
    408      * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
    409      * always include (<code>x</code>,<code>x</code>).</li>
    410      * <li>For preview streaming use case, this list will always include (<code>min</code>, <code>max</code>) where
    411      * <code>min</code> &lt;= 15 and <code>max</code> &gt;= 30.</li>
    412      * </ul>
    413      * <p>For devices at the LIMITED level or above:</p>
    414      * <ul>
    415      * <li>For YUV_420_888 burst capture use case, this list will always include (<code>min</code>, <code>max</code>)
    416      * and (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
    417      * maximum YUV_420_888 output size.</li>
    418      * </ul>
    419      * <p><b>Units</b>: Frames per second (FPS)</p>
    420      * <p>This key is available on all devices.</p>
    421      *
    422      * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
    423      */
    424     @PublicKey
    425     public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
    426             new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
    427 
    428     /**
    429      * <p>Maximum and minimum exposure compensation values for
    430      * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
    431      * that are supported by this camera device.</p>
    432      * <p><b>Range of valid values:</b><br></p>
    433      * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
    434      * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
    435      * compensation is supported (<code>range != [0, 0]</code>):</p>
    436      * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
    437      * <p><code>Max.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &gt;= 2 EV</code></p>
    438      * <p>LEGACY devices may support a smaller range than this.</p>
    439      * <p>This key is available on all devices.</p>
    440      *
    441      * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
    442      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
    443      */
    444     @PublicKey
    445     public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
    446             new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
    447 
    448     /**
    449      * <p>Smallest step by which the exposure compensation
    450      * can be changed.</p>
    451      * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
    452      * a value of <code>1/2</code>, then a setting of <code>-2</code> for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} means
    453      * that the target EV offset for the auto-exposure routine is -1 EV.</p>
    454      * <p>One unit of EV compensation changes the brightness of the captured image by a factor
    455      * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
    456      * <p><b>Units</b>: Exposure Value (EV)</p>
    457      * <p>This key is available on all devices.</p>
    458      *
    459      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
    460      */
    461     @PublicKey
    462     public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
    463             new Key<Rational>("android.control.aeCompensationStep", Rational.class);
    464 
    465     /**
    466      * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
    467      * supported by this camera device.</p>
    468      * <p>Not all the auto-focus modes may be supported by a
    469      * given camera device. This entry lists the valid modes for
    470      * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
    471      * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
    472      * camera devices with adjustable focuser units
    473      * (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>) will support AUTO mode.</p>
    474      * <p>LEGACY devices will support OFF mode only if they support
    475      * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
    476      * <code>0.0f</code>).</p>
    477      * <p><b>Range of valid values:</b><br>
    478      * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
    479      * <p>This key is available on all devices.</p>
    480      *
    481      * @see CaptureRequest#CONTROL_AF_MODE
    482      * @see CaptureRequest#LENS_FOCUS_DISTANCE
    483      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
    484      */
    485     @PublicKey
    486     public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
    487             new Key<int[]>("android.control.afAvailableModes", int[].class);
    488 
    489     /**
    490      * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
    491      * device.</p>
    492      * <p>This list contains the color effect modes that can be applied to
    493      * images produced by the camera device.
    494      * Implementations are not expected to be consistent across all devices.
    495      * If no color effect modes are available for a device, this will only list
    496      * OFF.</p>
    497      * <p>A color effect will only be applied if
    498      * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.  OFF is always included in this list.</p>
    499      * <p>This control has no effect on the operation of other control routines such
    500      * as auto-exposure, white balance, or focus.</p>
    501      * <p><b>Range of valid values:</b><br>
    502      * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
    503      * <p>This key is available on all devices.</p>
    504      *
    505      * @see CaptureRequest#CONTROL_EFFECT_MODE
    506      * @see CaptureRequest#CONTROL_MODE
    507      */
    508     @PublicKey
    509     public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
    510             new Key<int[]>("android.control.availableEffects", int[].class);
    511 
    512     /**
    513      * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
    514      * device.</p>
    515      * <p>This list contains scene modes that can be set for the camera device.
    516      * Only scene modes that have been fully implemented for the
    517      * camera device may be included here. Implementations are not expected
    518      * to be consistent across all devices.</p>
    519      * <p>If no scene modes are supported by the camera device, this
    520      * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
    521      * <p>FACE_PRIORITY is always listed if face detection is
    522      * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
    523      * 0</code>).</p>
    524      * <p><b>Range of valid values:</b><br>
    525      * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
    526      * <p>This key is available on all devices.</p>
    527      *
    528      * @see CaptureRequest#CONTROL_SCENE_MODE
    529      * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
    530      */
    531     @PublicKey
    532     public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
    533             new Key<int[]>("android.control.availableSceneModes", int[].class);
    534 
    535     /**
    536      * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
    537      * that are supported by this camera device.</p>
    538      * <p>OFF will always be listed.</p>
    539      * <p><b>Range of valid values:</b><br>
    540      * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
    541      * <p>This key is available on all devices.</p>
    542      *
    543      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
    544      */
    545     @PublicKey
    546     public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
    547             new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
    548 
    549     /**
    550      * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
    551      * camera device.</p>
    552      * <p>Not all the auto-white-balance modes may be supported by a
    553      * given camera device. This entry lists the valid modes for
    554      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
    555      * <p>All camera devices will support ON mode.</p>
    556      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
    557      * mode, which enables application control of white balance, by using
    558      * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}({@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} must be set to TRANSFORM_MATRIX). This includes all FULL
    559      * mode camera devices.</p>
    560      * <p><b>Range of valid values:</b><br>
    561      * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
    562      * <p>This key is available on all devices.</p>
    563      *
    564      * @see CaptureRequest#COLOR_CORRECTION_GAINS
    565      * @see CaptureRequest#COLOR_CORRECTION_MODE
    566      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
    567      * @see CaptureRequest#CONTROL_AWB_MODE
    568      */
    569     @PublicKey
    570     public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
    571             new Key<int[]>("android.control.awbAvailableModes", int[].class);
    572 
    573     /**
    574      * <p>List of the maximum number of regions that can be used for metering in
    575      * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
    576      * this corresponds to the the maximum number of elements in
    577      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
    578      * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
    579      * <p><b>Range of valid values:</b><br></p>
    580      * <p>Value must be &gt;= 0 for each element. For full-capability devices
    581      * this value must be &gt;= 1 for AE and AF. The order of the elements is:
    582      * <code>(AE, AWB, AF)</code>.</p>
    583      * <p>This key is available on all devices.</p>
    584      *
    585      * @see CaptureRequest#CONTROL_AE_REGIONS
    586      * @see CaptureRequest#CONTROL_AF_REGIONS
    587      * @see CaptureRequest#CONTROL_AWB_REGIONS
    588      * @hide
    589      */
    590     public static final Key<int[]> CONTROL_MAX_REGIONS =
    591             new Key<int[]>("android.control.maxRegions", int[].class);
    592 
    593     /**
    594      * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
    595      * routine.</p>
    596      * <p>This corresponds to the the maximum allowed number of elements in
    597      * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
    598      * <p><b>Range of valid values:</b><br>
    599      * Value will be &gt;= 0. For FULL-capability devices, this
    600      * value will be &gt;= 1.</p>
    601      * <p>This key is available on all devices.</p>
    602      *
    603      * @see CaptureRequest#CONTROL_AE_REGIONS
    604      */
    605     @PublicKey
    606     @SyntheticKey
    607     public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
    608             new Key<Integer>("android.control.maxRegionsAe", int.class);
    609 
    610     /**
    611      * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
    612      * routine.</p>
    613      * <p>This corresponds to the the maximum allowed number of elements in
    614      * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
    615      * <p><b>Range of valid values:</b><br>
    616      * Value will be &gt;= 0.</p>
    617      * <p>This key is available on all devices.</p>
    618      *
    619      * @see CaptureRequest#CONTROL_AWB_REGIONS
    620      */
    621     @PublicKey
    622     @SyntheticKey
    623     public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
    624             new Key<Integer>("android.control.maxRegionsAwb", int.class);
    625 
    626     /**
    627      * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
    628      * <p>This corresponds to the the maximum allowed number of elements in
    629      * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
    630      * <p><b>Range of valid values:</b><br>
    631      * Value will be &gt;= 0. For FULL-capability devices, this
    632      * value will be &gt;= 1.</p>
    633      * <p>This key is available on all devices.</p>
    634      *
    635      * @see CaptureRequest#CONTROL_AF_REGIONS
    636      */
    637     @PublicKey
    638     @SyntheticKey
    639     public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
    640             new Key<Integer>("android.control.maxRegionsAf", int.class);
    641 
    642     /**
    643      * <p>List of available high speed video size, fps range and max batch size configurations
    644      * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).</p>
    645      * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
    646      * this metadata will list the supported high speed video size, fps range and max batch size
    647      * configurations. All the sizes listed in this configuration will be a subset of the sizes
    648      * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
    649      * for processed non-stalling formats.</p>
    650      * <p>For the high speed video use case, the application must
    651      * select the video size and fps range from this metadata to configure the recording and
    652      * preview streams and setup the recording requests. For example, if the application intends
    653      * to do high speed recording, it can select the maximum size reported by this metadata to
    654      * configure output streams. Once the size is selected, application can filter this metadata
    655      * by selected size and get the supported fps ranges, and use these fps ranges to setup the
    656      * recording requests. Note that for the use case of multiple output streams, application
    657      * must select one unique size from this metadata to use (e.g., preview and recording streams
    658      * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
    659      * <p>The min and max fps will be multiple times of 30fps.</p>
    660      * <p>High speed video streaming extends significant performance pressue to camera hardware,
    661      * to achieve efficient high speed streaming, the camera device may have to aggregate
    662      * multiple frames together and send to camera device for processing where the request
    663      * controls are same for all the frames in this batch. Max batch size indicates
    664      * the max possible number of frames the camera device will group together for this high
    665      * speed stream configuration. This max batch size will be used to generate a high speed
    666      * recording request list by
    667      * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.
    668      * The max batch size for each configuration will satisfy below conditions:</p>
    669      * <ul>
    670      * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
    671      * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
    672      * <li>The camera device may choose smaller internal batch size for each configuration, but
    673      * the actual batch size will be a divisor of max batch size. For example, if the max batch
    674      * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
    675      * <li>The max batch size in each configuration entry must be no larger than 32.</li>
    676      * </ul>
    677      * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
    678      * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
    679      * <p>This fps ranges in this configuration list can only be used to create requests
    680      * that are submitted to a high speed camera capture session created by
    681      * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
    682      * The fps ranges reported in this metadata must not be used to setup capture requests for
    683      * normal capture session, or it will cause request error.</p>
    684      * <p><b>Range of valid values:</b><br></p>
    685      * <p>For each configuration, the fps_max &gt;= 120fps.</p>
    686      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    687      * <p><b>Limited capability</b> -
    688      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
    689      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    690      *
    691      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    692      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    693      * @hide
    694      */
    695     public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
    696             new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
    697 
    698     /**
    699      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
    700      * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
    701      * list <code>true</code>. This includes FULL devices.</p>
    702      * <p>This key is available on all devices.</p>
    703      *
    704      * @see CaptureRequest#CONTROL_AE_LOCK
    705      */
    706     @PublicKey
    707     public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
    708             new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
    709 
    710     /**
    711      * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
    712      * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
    713      * always list <code>true</code>. This includes FULL devices.</p>
    714      * <p>This key is available on all devices.</p>
    715      *
    716      * @see CaptureRequest#CONTROL_AWB_LOCK
    717      */
    718     @PublicKey
    719     public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
    720             new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
    721 
    722     /**
    723      * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
    724      * device.</p>
    725      * <p>This list contains control modes that can be set for the camera device.
    726      * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
    727      * devices will always support OFF, AUTO modes.</p>
    728      * <p><b>Range of valid values:</b><br>
    729      * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
    730      * <p>This key is available on all devices.</p>
    731      *
    732      * @see CaptureRequest#CONTROL_MODE
    733      */
    734     @PublicKey
    735     public static final Key<int[]> CONTROL_AVAILABLE_MODES =
    736             new Key<int[]>("android.control.availableModes", int[].class);
    737 
    738     /**
    739      * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
    740      * device.</p>
    741      * <p>Full-capability camera devices must always support OFF; camera devices that support
    742      * YUV_REPROCESSING or PRIVATE_REPROCESSING will list ZERO_SHUTTER_LAG; all devices will
    743      * list FAST.</p>
    744      * <p><b>Range of valid values:</b><br>
    745      * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
    746      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    747      * <p><b>Full capability</b> -
    748      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
    749      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    750      *
    751      * @see CaptureRequest#EDGE_MODE
    752      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    753      */
    754     @PublicKey
    755     public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
    756             new Key<int[]>("android.edge.availableEdgeModes", int[].class);
    757 
    758     /**
    759      * <p>Whether this camera device has a
    760      * flash unit.</p>
    761      * <p>Will be <code>false</code> if no flash is available.</p>
    762      * <p>If there is no flash unit, none of the flash controls do
    763      * anything.
    764      * This key is available on all devices.</p>
    765      */
    766     @PublicKey
    767     public static final Key<Boolean> FLASH_INFO_AVAILABLE =
    768             new Key<Boolean>("android.flash.info.available", boolean.class);
    769 
    770     /**
    771      * <p>List of hot pixel correction modes for {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode} that are supported by this
    772      * camera device.</p>
    773      * <p>FULL mode camera devices will always support FAST.</p>
    774      * <p><b>Range of valid values:</b><br>
    775      * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
    776      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    777      *
    778      * @see CaptureRequest#HOT_PIXEL_MODE
    779      */
    780     @PublicKey
    781     public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
    782             new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
    783 
    784     /**
    785      * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
    786      * camera device.</p>
    787      * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
    788      * thumbnail should be generated.</p>
    789      * <p>Below condiditions will be satisfied for this size list:</p>
    790      * <ul>
    791      * <li>The sizes will be sorted by increasing pixel area (width x height).
    792      * If several resolutions have the same area, they will be sorted by increasing width.</li>
    793      * <li>The aspect ratio of the largest thumbnail size will be same as the
    794      * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
    795      * The largest size is defined as the size that has the largest pixel area
    796      * in a given size list.</li>
    797      * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
    798      * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
    799      * and vice versa.</li>
    800      * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.
    801      * This key is available on all devices.</li>
    802      * </ul>
    803      *
    804      * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
    805      */
    806     @PublicKey
    807     public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
    808             new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
    809 
    810     /**
    811      * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
    812      * supported by this camera device.</p>
    813      * <p>If the camera device doesn't support a variable lens aperture,
    814      * this list will contain only one value, which is the fixed aperture size.</p>
    815      * <p>If the camera device supports a variable aperture, the aperture values
    816      * in this list will be sorted in ascending order.</p>
    817      * <p><b>Units</b>: The aperture f-number</p>
    818      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    819      * <p><b>Full capability</b> -
    820      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
    821      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    822      *
    823      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    824      * @see CaptureRequest#LENS_APERTURE
    825      */
    826     @PublicKey
    827     public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
    828             new Key<float[]>("android.lens.info.availableApertures", float[].class);
    829 
    830     /**
    831      * <p>List of neutral density filter values for
    832      * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
    833      * <p>If a neutral density filter is not supported by this camera device,
    834      * this list will contain only 0. Otherwise, this list will include every
    835      * filter density supported by the camera device, in ascending order.</p>
    836      * <p><b>Units</b>: Exposure value (EV)</p>
    837      * <p><b>Range of valid values:</b><br></p>
    838      * <p>Values are &gt;= 0</p>
    839      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    840      * <p><b>Full capability</b> -
    841      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
    842      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    843      *
    844      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    845      * @see CaptureRequest#LENS_FILTER_DENSITY
    846      */
    847     @PublicKey
    848     public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
    849             new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
    850 
    851     /**
    852      * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
    853      * device.</p>
    854      * <p>If optical zoom is not supported, this list will only contain
    855      * a single value corresponding to the fixed focal length of the
    856      * device. Otherwise, this list will include every focal length supported
    857      * by the camera device, in ascending order.</p>
    858      * <p><b>Units</b>: Millimeters</p>
    859      * <p><b>Range of valid values:</b><br></p>
    860      * <p>Values are &gt; 0</p>
    861      * <p>This key is available on all devices.</p>
    862      *
    863      * @see CaptureRequest#LENS_FOCAL_LENGTH
    864      */
    865     @PublicKey
    866     public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
    867             new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
    868 
    869     /**
    870      * <p>List of optical image stabilization (OIS) modes for
    871      * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
    872      * <p>If OIS is not supported by a given camera device, this list will
    873      * contain only OFF.</p>
    874      * <p><b>Range of valid values:</b><br>
    875      * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
    876      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    877      * <p><b>Limited capability</b> -
    878      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
    879      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    880      *
    881      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    882      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
    883      */
    884     @PublicKey
    885     public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
    886             new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
    887 
    888     /**
    889      * <p>Hyperfocal distance for this lens.</p>
    890      * <p>If the lens is not fixed focus, the camera device will report this
    891      * field when {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} is APPROXIMATE or CALIBRATED.</p>
    892      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
    893      * <p><b>Range of valid values:</b><br>
    894      * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
    895      * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
    896      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    897      * <p><b>Limited capability</b> -
    898      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
    899      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    900      *
    901      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    902      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
    903      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
    904      */
    905     @PublicKey
    906     public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
    907             new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
    908 
    909     /**
    910      * <p>Shortest distance from frontmost surface
    911      * of the lens that can be brought into sharp focus.</p>
    912      * <p>If the lens is fixed-focus, this will be
    913      * 0.</p>
    914      * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
    915      * <p><b>Range of valid values:</b><br>
    916      * &gt;= 0</p>
    917      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    918      * <p><b>Limited capability</b> -
    919      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
    920      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    921      *
    922      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    923      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
    924      */
    925     @PublicKey
    926     public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
    927             new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
    928 
    929     /**
    930      * <p>Dimensions of lens shading map.</p>
    931      * <p>The map should be on the order of 30-40 rows and columns, and
    932      * must be smaller than 64x64.</p>
    933      * <p><b>Range of valid values:</b><br>
    934      * Both values &gt;= 1</p>
    935      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    936      * <p><b>Full capability</b> -
    937      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
    938      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    939      *
    940      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    941      * @hide
    942      */
    943     public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
    944             new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
    945 
    946     /**
    947      * <p>The lens focus distance calibration quality.</p>
    948      * <p>The lens focus distance calibration quality determines the reliability of
    949      * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
    950      * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
    951      * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
    952      * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
    953      * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
    954      * and increasing positive numbers represent focusing closer and closer
    955      * to the camera device. The focus distance control also uses diopters
    956      * on these devices.</p>
    957      * <p>UNCALIBRATED devices do not use units that are directly comparable
    958      * to any real physical measurement, but <code>0.0f</code> still represents farthest
    959      * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
    960      * nearest focus the device can achieve.</p>
    961      * <p><b>Possible values:</b>
    962      * <ul>
    963      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
    964      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
    965      *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
    966      * </ul></p>
    967      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
    968      * <p><b>Limited capability</b> -
    969      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
    970      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
    971      *
    972      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    973      * @see CaptureRequest#LENS_FOCUS_DISTANCE
    974      * @see CaptureResult#LENS_FOCUS_RANGE
    975      * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
    976      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
    977      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
    978      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
    979      * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
    980      */
    981     @PublicKey
    982     public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
    983             new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
    984 
    985     /**
    986      * <p>Direction the camera faces relative to
    987      * device screen.</p>
    988      * <p><b>Possible values:</b>
    989      * <ul>
    990      *   <li>{@link #LENS_FACING_FRONT FRONT}</li>
    991      *   <li>{@link #LENS_FACING_BACK BACK}</li>
    992      *   <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
    993      * </ul></p>
    994      * <p>This key is available on all devices.</p>
    995      * @see #LENS_FACING_FRONT
    996      * @see #LENS_FACING_BACK
    997      * @see #LENS_FACING_EXTERNAL
    998      */
    999     @PublicKey
   1000     public static final Key<Integer> LENS_FACING =
   1001             new Key<Integer>("android.lens.facing", int.class);
   1002 
   1003     /**
   1004      * <p>The orientation of the camera relative to the sensor
   1005      * coordinate system.</p>
   1006      * <p>The four coefficients that describe the quaternion
   1007      * rotation from the Android sensor coordinate system to a
   1008      * camera-aligned coordinate system where the X-axis is
   1009      * aligned with the long side of the image sensor, the Y-axis
   1010      * is aligned with the short side of the image sensor, and
   1011      * the Z-axis is aligned with the optical axis of the sensor.</p>
   1012      * <p>To convert from the quaternion coefficients <code>(x,y,z,w)</code>
   1013      * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
   1014      * amount <code>theta</code>, the following formulas can be used:</p>
   1015      * <pre><code> theta = 2 * acos(w)
   1016      * a_x = x / sin(theta/2)
   1017      * a_y = y / sin(theta/2)
   1018      * a_z = z / sin(theta/2)
   1019      * </code></pre>
   1020      * <p>To create a 3x3 rotation matrix that applies the rotation
   1021      * defined by this quaternion, the following matrix can be
   1022      * used:</p>
   1023      * <pre><code>R = [ 1 - 2y^2 - 2z^2,       2xy - 2zw,       2xz + 2yw,
   1024      *            2xy + 2zw, 1 - 2x^2 - 2z^2,       2yz - 2xw,
   1025      *            2xz - 2yw,       2yz + 2xw, 1 - 2x^2 - 2y^2 ]
   1026      * </code></pre>
   1027      * <p>This matrix can then be used to apply the rotation to a
   1028      *  column vector point with</p>
   1029      * <p><code>p' = Rp</code></p>
   1030      * <p>where <code>p</code> is in the device sensor coordinate system, and
   1031      *  <code>p'</code> is in the camera-oriented coordinate system.</p>
   1032      * <p><b>Units</b>:
   1033      * Quaternion coefficients</p>
   1034      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1035      */
   1036     @PublicKey
   1037     public static final Key<float[]> LENS_POSE_ROTATION =
   1038             new Key<float[]>("android.lens.poseRotation", float[].class);
   1039 
   1040     /**
   1041      * <p>Position of the camera optical center.</p>
   1042      * <p>The position of the camera device's lens optical center,
   1043      * as a three-dimensional vector <code>(x,y,z)</code>, relative to the
   1044      * optical center of the largest camera device facing in the
   1045      * same direction as this camera, in the {@link android.hardware.SensorEvent Android sensor coordinate
   1046      * axes}. Note that only the axis definitions are shared with
   1047      * the sensor coordinate system, but not the origin.</p>
   1048      * <p>If this device is the largest or only camera device with a
   1049      * given facing, then this position will be <code>(0, 0, 0)</code>; a
   1050      * camera device with a lens optical center located 3 cm from
   1051      * the main sensor along the +X axis (to the right from the
   1052      * user's perspective) will report <code>(0.03, 0, 0)</code>.</p>
   1053      * <p>To transform a pixel coordinates between two cameras
   1054      * facing the same direction, first the source camera
   1055      * {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion} must be corrected for.  Then
   1056      * the source camera {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} needs
   1057      * to be applied, followed by the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}
   1058      * of the source camera, the translation of the source camera
   1059      * relative to the destination camera, the
   1060      * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination camera, and
   1061      * finally the inverse of {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}
   1062      * of the destination camera. This obtains a
   1063      * radial-distortion-free coordinate in the destination
   1064      * camera pixel coordinates.</p>
   1065      * <p>To compare this against a real image from the destination
   1066      * camera, the destination camera image then needs to be
   1067      * corrected for radial distortion before comparison or
   1068      * sampling.</p>
   1069      * <p><b>Units</b>: Meters</p>
   1070      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1071      *
   1072      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
   1073      * @see CameraCharacteristics#LENS_POSE_ROTATION
   1074      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
   1075      */
   1076     @PublicKey
   1077     public static final Key<float[]> LENS_POSE_TRANSLATION =
   1078             new Key<float[]>("android.lens.poseTranslation", float[].class);
   1079 
   1080     /**
   1081      * <p>The parameters for this camera device's intrinsic
   1082      * calibration.</p>
   1083      * <p>The five calibration parameters that describe the
   1084      * transform from camera-centric 3D coordinates to sensor
   1085      * pixel coordinates:</p>
   1086      * <pre><code>[f_x, f_y, c_x, c_y, s]
   1087      * </code></pre>
   1088      * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
   1089      * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
   1090      * axis, and <code>s</code> is a skew parameter for the sensor plane not
   1091      * being aligned with the lens plane.</p>
   1092      * <p>These are typically used within a transformation matrix K:</p>
   1093      * <pre><code>K = [ f_x,   s, c_x,
   1094      *        0, f_y, c_y,
   1095      *        0    0,   1 ]
   1096      * </code></pre>
   1097      * <p>which can then be combined with the camera pose rotation
   1098      * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
   1099      * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
   1100      * complete transform from world coordinates to pixel
   1101      * coordinates:</p>
   1102      * <pre><code>P = [ K 0   * [ R t
   1103      *      0 1 ]     0 1 ]
   1104      * </code></pre>
   1105      * <p>and with <code>p_w</code> being a point in the world coordinate system
   1106      * and <code>p_s</code> being a point in the camera active pixel array
   1107      * coordinate system, and with the mapping including the
   1108      * homogeneous division by z:</p>
   1109      * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
   1110      * p_s = p_h / z_h
   1111      * </code></pre>
   1112      * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
   1113      * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
   1114      * (depth) in pixel coordinates.</p>
   1115      * <p>Note that the coordinate system for this transform is the
   1116      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
   1117      * where <code>(0,0)</code> is the top-left of the
   1118      * preCorrectionActiveArraySize rectangle. Once the pose and
   1119      * intrinsic calibration transforms have been applied to a
   1120      * world point, then the {@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}
   1121      * transform needs to be applied, and the result adjusted to
   1122      * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
   1123      * system (where <code>(0, 0)</code> is the top-left of the
   1124      * activeArraySize rectangle), to determine the final pixel
   1125      * coordinate of the world point for processed (non-RAW)
   1126      * output buffers.</p>
   1127      * <p><b>Units</b>:
   1128      * Pixels in the
   1129      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
   1130      * coordinate system.</p>
   1131      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1132      *
   1133      * @see CameraCharacteristics#LENS_POSE_ROTATION
   1134      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
   1135      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
   1136      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   1137      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
   1138      */
   1139     @PublicKey
   1140     public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
   1141             new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
   1142 
   1143     /**
   1144      * <p>The correction coefficients to correct for this camera device's
   1145      * radial and tangential lens distortion.</p>
   1146      * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
   1147      * kappa_3]</code> and two tangential distortion coefficients
   1148      * <code>[kappa_4, kappa_5]</code> that can be used to correct the
   1149      * lens's geometric distortion with the mapping equations:</p>
   1150      * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
   1151      *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
   1152      *  y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
   1153      *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
   1154      * </code></pre>
   1155      * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
   1156      * input image that correspond to the pixel values in the
   1157      * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
   1158      * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
   1159      * </code></pre>
   1160      * <p>The pixel coordinates are defined in a normalized
   1161      * coordinate system related to the
   1162      * {@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration} calibration fields.
   1163      * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
   1164      * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
   1165      * of both x and y coordinates are normalized to be 1 at the
   1166      * edge further from the optical center, so the range
   1167      * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
   1168      * <p>Finally, <code>r</code> represents the radial distance from the
   1169      * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
   1170      * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
   1171      * <p>The distortion model used is the Brown-Conrady model.</p>
   1172      * <p><b>Units</b>:
   1173      * Unitless coefficients.</p>
   1174      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1175      *
   1176      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
   1177      */
   1178     @PublicKey
   1179     public static final Key<float[]> LENS_RADIAL_DISTORTION =
   1180             new Key<float[]>("android.lens.radialDistortion", float[].class);
   1181 
   1182     /**
   1183      * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
   1184      * by this camera device.</p>
   1185      * <p>Full-capability camera devices will always support OFF and FAST.</p>
   1186      * <p>Camera devices that support YUV_REPROCESSING or PRIVATE_REPROCESSING will support
   1187      * ZERO_SHUTTER_LAG.</p>
   1188      * <p>Legacy-capability camera devices will only support FAST mode.</p>
   1189      * <p><b>Range of valid values:</b><br>
   1190      * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
   1191      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1192      * <p><b>Limited capability</b> -
   1193      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
   1194      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1195      *
   1196      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1197      * @see CaptureRequest#NOISE_REDUCTION_MODE
   1198      */
   1199     @PublicKey
   1200     public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
   1201             new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
   1202 
   1203     /**
   1204      * <p>If set to 1, the HAL will always split result
   1205      * metadata for a single capture into multiple buffers,
   1206      * returned using multiple process_capture_result calls.</p>
   1207      * <p>Does not need to be listed in static
   1208      * metadata. Support for partial results will be reworked in
   1209      * future versions of camera service. This quirk will stop
   1210      * working at that point; DO NOT USE without careful
   1211      * consideration of future support.</p>
   1212      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1213      * @deprecated
   1214      * @hide
   1215      */
   1216     @Deprecated
   1217     public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
   1218             new Key<Byte>("android.quirks.usePartialResult", byte.class);
   1219 
   1220     /**
   1221      * <p>The maximum numbers of different types of output streams
   1222      * that can be configured and used simultaneously by a camera device.</p>
   1223      * <p>This is a 3 element tuple that contains the max number of output simultaneous
   1224      * streams for raw sensor, processed (but not stalling), and processed (and stalling)
   1225      * formats respectively. For example, assuming that JPEG is typically a processed and
   1226      * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
   1227      * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
   1228      * <p>This lists the upper bound of the number of output streams supported by
   1229      * the camera device. Using more streams simultaneously may require more hardware and
   1230      * CPU resources that will consume more power. The image format for an output stream can
   1231      * be any supported format provided by android.scaler.availableStreamConfigurations.
   1232      * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
   1233      * into the 3 stream types as below:</p>
   1234      * <ul>
   1235      * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
   1236      *   Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
   1237      * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
   1238      * <li>Processed (but not-stalling): any non-RAW format without a stall duration.
   1239      *   Typically {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
   1240      *   {@link android.graphics.ImageFormat#NV21 NV21}, or
   1241      *   {@link android.graphics.ImageFormat#YV12 YV12}.</li>
   1242      * </ul>
   1243      * <p><b>Range of valid values:</b><br></p>
   1244      * <p>For processed (and stalling) format streams, &gt;= 1.</p>
   1245      * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
   1246      * <p>For processed (but not stalling) format streams, &gt;= 3
   1247      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
   1248      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
   1249      * <p>This key is available on all devices.</p>
   1250      *
   1251      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1252      * @hide
   1253      */
   1254     public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
   1255             new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
   1256 
   1257     /**
   1258      * <p>The maximum numbers of different types of output streams
   1259      * that can be configured and used simultaneously by a camera device
   1260      * for any <code>RAW</code> formats.</p>
   1261      * <p>This value contains the max number of output simultaneous
   1262      * streams from the raw sensor.</p>
   1263      * <p>This lists the upper bound of the number of output streams supported by
   1264      * the camera device. Using more streams simultaneously may require more hardware and
   1265      * CPU resources that will consume more power. The image format for this kind of an output stream can
   1266      * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
   1267      * <p>In particular, a <code>RAW</code> format is typically one of:</p>
   1268      * <ul>
   1269      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
   1270      * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
   1271      * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
   1272      * </ul>
   1273      * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
   1274      * never support raw streams.</p>
   1275      * <p><b>Range of valid values:</b><br></p>
   1276      * <p>&gt;= 0</p>
   1277      * <p>This key is available on all devices.</p>
   1278      *
   1279      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1280      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
   1281      */
   1282     @PublicKey
   1283     @SyntheticKey
   1284     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
   1285             new Key<Integer>("android.request.maxNumOutputRaw", int.class);
   1286 
   1287     /**
   1288      * <p>The maximum numbers of different types of output streams
   1289      * that can be configured and used simultaneously by a camera device
   1290      * for any processed (but not-stalling) formats.</p>
   1291      * <p>This value contains the max number of output simultaneous
   1292      * streams for any processed (but not-stalling) formats.</p>
   1293      * <p>This lists the upper bound of the number of output streams supported by
   1294      * the camera device. Using more streams simultaneously may require more hardware and
   1295      * CPU resources that will consume more power. The image format for this kind of an output stream can
   1296      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
   1297      * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
   1298      * Typically:</p>
   1299      * <ul>
   1300      * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
   1301      * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
   1302      * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
   1303      * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
   1304      * </ul>
   1305      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
   1306      * processed format -- it will return 0 for a non-stalling stream.</p>
   1307      * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
   1308      * <p><b>Range of valid values:</b><br></p>
   1309      * <p>&gt;= 3
   1310      * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
   1311      * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
   1312      * <p>This key is available on all devices.</p>
   1313      *
   1314      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1315      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
   1316      */
   1317     @PublicKey
   1318     @SyntheticKey
   1319     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
   1320             new Key<Integer>("android.request.maxNumOutputProc", int.class);
   1321 
   1322     /**
   1323      * <p>The maximum numbers of different types of output streams
   1324      * that can be configured and used simultaneously by a camera device
   1325      * for any processed (and stalling) formats.</p>
   1326      * <p>This value contains the max number of output simultaneous
   1327      * streams for any processed (but not-stalling) formats.</p>
   1328      * <p>This lists the upper bound of the number of output streams supported by
   1329      * the camera device. Using more streams simultaneously may require more hardware and
   1330      * CPU resources that will consume more power. The image format for this kind of an output stream can
   1331      * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
   1332      * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
   1333      * &gt; 0.  Typically only the {@link android.graphics.ImageFormat#JPEG JPEG format} is a
   1334      * stalling format.</p>
   1335      * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
   1336      * processed format -- it will return a non-0 value for a stalling stream.</p>
   1337      * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
   1338      * <p><b>Range of valid values:</b><br></p>
   1339      * <p>&gt;= 1</p>
   1340      * <p>This key is available on all devices.</p>
   1341      *
   1342      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
   1343      */
   1344     @PublicKey
   1345     @SyntheticKey
   1346     public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
   1347             new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
   1348 
   1349     /**
   1350      * <p>The maximum numbers of any type of input streams
   1351      * that can be configured and used simultaneously by a camera device.</p>
   1352      * <p>When set to 0, it means no input stream is supported.</p>
   1353      * <p>The image format for a input stream can be any supported format returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats }. When using an
   1354      * input stream, there must be at least one output stream configured to to receive the
   1355      * reprocessed images.</p>
   1356      * <p>When an input stream and some output streams are used in a reprocessing request,
   1357      * only the input buffer will be used to produce these output stream buffers, and a
   1358      * new sensor image will not be captured.</p>
   1359      * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
   1360      * stream image format will be PRIVATE, the associated output stream image format
   1361      * should be JPEG.</p>
   1362      * <p><b>Range of valid values:</b><br></p>
   1363      * <p>0 or 1.</p>
   1364      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1365      * <p><b>Full capability</b> -
   1366      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   1367      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   1368      *
   1369      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1370      */
   1371     @PublicKey
   1372     public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
   1373             new Key<Integer>("android.request.maxNumInputStreams", int.class);
   1374 
   1375     /**
   1376      * <p>Specifies the number of maximum pipeline stages a frame
   1377      * has to go through from when it's exposed to when it's available
   1378      * to the framework.</p>
   1379      * <p>A typical minimum value for this is 2 (one stage to expose,
   1380      * one stage to readout) from the sensor. The ISP then usually adds
   1381      * its own stages to do custom HW processing. Further stages may be
   1382      * added by SW processing.</p>
   1383      * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
   1384      * processing is enabled (e.g. face detection), the actual pipeline
   1385      * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
   1386      * the max pipeline depth.</p>
   1387      * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
   1388      * X frame intervals.</p>
   1389      * <p>This value will normally be 8 or less, however, for high speed capture session,
   1390      * the max pipeline depth will be up to 8 x size of high speed capture request list.</p>
   1391      * <p>This key is available on all devices.</p>
   1392      *
   1393      * @see CaptureResult#REQUEST_PIPELINE_DEPTH
   1394      */
   1395     @PublicKey
   1396     public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
   1397             new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
   1398 
   1399     /**
   1400      * <p>Defines how many sub-components
   1401      * a result will be composed of.</p>
   1402      * <p>In order to combat the pipeline latency, partial results
   1403      * may be delivered to the application layer from the camera device as
   1404      * soon as they are available.</p>
   1405      * <p>Optional; defaults to 1. A value of 1 means that partial
   1406      * results are not supported, and only the final TotalCaptureResult will
   1407      * be produced by the camera device.</p>
   1408      * <p>A typical use case for this might be: after requesting an
   1409      * auto-focus (AF) lock the new AF state might be available 50%
   1410      * of the way through the pipeline.  The camera device could
   1411      * then immediately dispatch this state via a partial result to
   1412      * the application, and the rest of the metadata via later
   1413      * partial results.</p>
   1414      * <p><b>Range of valid values:</b><br>
   1415      * &gt;= 1</p>
   1416      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1417      */
   1418     @PublicKey
   1419     public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
   1420             new Key<Integer>("android.request.partialResultCount", int.class);
   1421 
   1422     /**
   1423      * <p>List of capabilities that this camera device
   1424      * advertises as fully supporting.</p>
   1425      * <p>A capability is a contract that the camera device makes in order
   1426      * to be able to satisfy one or more use cases.</p>
   1427      * <p>Listing a capability guarantees that the whole set of features
   1428      * required to support a common use will all be available.</p>
   1429      * <p>Using a subset of the functionality provided by an unsupported
   1430      * capability may be possible on a specific camera device implementation;
   1431      * to do this query each of android.request.availableRequestKeys,
   1432      * android.request.availableResultKeys,
   1433      * android.request.availableCharacteristicsKeys.</p>
   1434      * <p>The following capabilities are guaranteed to be available on
   1435      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
   1436      * <ul>
   1437      * <li>MANUAL_SENSOR</li>
   1438      * <li>MANUAL_POST_PROCESSING</li>
   1439      * </ul>
   1440      * <p>Other capabilities may be available on either FULL or LIMITED
   1441      * devices, but the application should query this key to be sure.</p>
   1442      * <p><b>Possible values:</b>
   1443      * <ul>
   1444      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
   1445      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
   1446      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
   1447      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
   1448      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
   1449      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
   1450      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
   1451      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
   1452      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
   1453      *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
   1454      * </ul></p>
   1455      * <p>This key is available on all devices.</p>
   1456      *
   1457      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1458      * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
   1459      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
   1460      * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
   1461      * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
   1462      * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
   1463      * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
   1464      * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
   1465      * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
   1466      * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
   1467      * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
   1468      */
   1469     @PublicKey
   1470     public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
   1471             new Key<int[]>("android.request.availableCapabilities", int[].class);
   1472 
   1473     /**
   1474      * <p>A list of all keys that the camera device has available
   1475      * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
   1476      * <p>Attempting to set a key into a CaptureRequest that is not
   1477      * listed here will result in an invalid request and will be rejected
   1478      * by the camera device.</p>
   1479      * <p>This field can be used to query the feature set of a camera device
   1480      * at a more granular level than capabilities. This is especially
   1481      * important for optional keys that are not listed under any capability
   1482      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
   1483      * <p>This key is available on all devices.</p>
   1484      *
   1485      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1486      * @hide
   1487      */
   1488     public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
   1489             new Key<int[]>("android.request.availableRequestKeys", int[].class);
   1490 
   1491     /**
   1492      * <p>A list of all keys that the camera device has available
   1493      * to use with {@link android.hardware.camera2.CaptureResult }.</p>
   1494      * <p>Attempting to get a key from a CaptureResult that is not
   1495      * listed here will always return a <code>null</code> value. Getting a key from
   1496      * a CaptureResult that is listed here will generally never return a <code>null</code>
   1497      * value.</p>
   1498      * <p>The following keys may return <code>null</code> unless they are enabled:</p>
   1499      * <ul>
   1500      * <li>android.statistics.lensShadingMap (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
   1501      * </ul>
   1502      * <p>(Those sometimes-null keys will nevertheless be listed here
   1503      * if they are available.)</p>
   1504      * <p>This field can be used to query the feature set of a camera device
   1505      * at a more granular level than capabilities. This is especially
   1506      * important for optional keys that are not listed under any capability
   1507      * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
   1508      * <p>This key is available on all devices.</p>
   1509      *
   1510      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1511      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
   1512      * @hide
   1513      */
   1514     public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
   1515             new Key<int[]>("android.request.availableResultKeys", int[].class);
   1516 
   1517     /**
   1518      * <p>A list of all keys that the camera device has available
   1519      * to use with {@link android.hardware.camera2.CameraCharacteristics }.</p>
   1520      * <p>This entry follows the same rules as
   1521      * android.request.availableResultKeys (except that it applies for
   1522      * CameraCharacteristics instead of CaptureResult). See above for more
   1523      * details.</p>
   1524      * <p>This key is available on all devices.</p>
   1525      * @hide
   1526      */
   1527     public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
   1528             new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
   1529 
   1530     /**
   1531      * <p>The list of image formats that are supported by this
   1532      * camera device for output streams.</p>
   1533      * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
   1534      * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
   1535      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1536      * @deprecated
   1537      * @hide
   1538      */
   1539     @Deprecated
   1540     public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
   1541             new Key<int[]>("android.scaler.availableFormats", int[].class);
   1542 
   1543     /**
   1544      * <p>The minimum frame duration that is supported
   1545      * for each resolution in android.scaler.availableJpegSizes.</p>
   1546      * <p>This corresponds to the minimum steady-state frame duration when only
   1547      * that JPEG stream is active and captured in a burst, with all
   1548      * processing (typically in android.*.mode) set to FAST.</p>
   1549      * <p>When multiple streams are configured, the minimum
   1550      * frame duration will be &gt;= max(individual stream min
   1551      * durations)</p>
   1552      * <p><b>Units</b>: Nanoseconds</p>
   1553      * <p><b>Range of valid values:</b><br>
   1554      * TODO: Remove property.</p>
   1555      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1556      * @deprecated
   1557      * @hide
   1558      */
   1559     @Deprecated
   1560     public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
   1561             new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
   1562 
   1563     /**
   1564      * <p>The JPEG resolutions that are supported by this camera device.</p>
   1565      * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
   1566      * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
   1567      * <p><b>Range of valid values:</b><br>
   1568      * TODO: Remove property.</p>
   1569      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1570      *
   1571      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   1572      * @deprecated
   1573      * @hide
   1574      */
   1575     @Deprecated
   1576     public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
   1577             new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
   1578 
   1579     /**
   1580      * <p>The maximum ratio between both active area width
   1581      * and crop region width, and active area height and
   1582      * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
   1583      * <p>This represents the maximum amount of zooming possible by
   1584      * the camera device, or equivalently, the minimum cropping
   1585      * window size.</p>
   1586      * <p>Crop regions that have a width or height that is smaller
   1587      * than this ratio allows will be rounded up to the minimum
   1588      * allowed size by the camera device.</p>
   1589      * <p><b>Units</b>: Zoom scale factor</p>
   1590      * <p><b>Range of valid values:</b><br>
   1591      * &gt;=1</p>
   1592      * <p>This key is available on all devices.</p>
   1593      *
   1594      * @see CaptureRequest#SCALER_CROP_REGION
   1595      */
   1596     @PublicKey
   1597     public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
   1598             new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
   1599 
   1600     /**
   1601      * <p>For each available processed output size (defined in
   1602      * android.scaler.availableProcessedSizes), this property lists the
   1603      * minimum supportable frame duration for that size.</p>
   1604      * <p>This should correspond to the frame duration when only that processed
   1605      * stream is active, with all processing (typically in android.*.mode)
   1606      * set to FAST.</p>
   1607      * <p>When multiple streams are configured, the minimum frame duration will
   1608      * be &gt;= max(individual stream min durations).</p>
   1609      * <p><b>Units</b>: Nanoseconds</p>
   1610      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1611      * @deprecated
   1612      * @hide
   1613      */
   1614     @Deprecated
   1615     public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
   1616             new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
   1617 
   1618     /**
   1619      * <p>The resolutions available for use with
   1620      * processed output streams, such as YV12, NV12, and
   1621      * platform opaque YUV/RGB streams to the GPU or video
   1622      * encoders.</p>
   1623      * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
   1624      * <p>For a given use case, the actual maximum supported resolution
   1625      * may be lower than what is listed here, depending on the destination
   1626      * Surface for the image data. For example, for recording video,
   1627      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
   1628      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
   1629      * can provide.</p>
   1630      * <p>Please reference the documentation for the image data destination to
   1631      * check if it limits the maximum size for image data.</p>
   1632      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1633      * @deprecated
   1634      * @hide
   1635      */
   1636     @Deprecated
   1637     public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
   1638             new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
   1639 
   1640     /**
   1641      * <p>The mapping of image formats that are supported by this
   1642      * camera device for input streams, to their corresponding output formats.</p>
   1643      * <p>All camera devices with at least 1
   1644      * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
   1645      * available input format.</p>
   1646      * <p>The camera device will support the following map of formats,
   1647      * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
   1648      * <table>
   1649      * <thead>
   1650      * <tr>
   1651      * <th align="left">Input Format</th>
   1652      * <th align="left">Output Format</th>
   1653      * <th align="left">Capability</th>
   1654      * </tr>
   1655      * </thead>
   1656      * <tbody>
   1657      * <tr>
   1658      * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
   1659      * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
   1660      * <td align="left">PRIVATE_REPROCESSING</td>
   1661      * </tr>
   1662      * <tr>
   1663      * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
   1664      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
   1665      * <td align="left">PRIVATE_REPROCESSING</td>
   1666      * </tr>
   1667      * <tr>
   1668      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
   1669      * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
   1670      * <td align="left">YUV_REPROCESSING</td>
   1671      * </tr>
   1672      * <tr>
   1673      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
   1674      * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
   1675      * <td align="left">YUV_REPROCESSING</td>
   1676      * </tr>
   1677      * </tbody>
   1678      * </table>
   1679      * <p>PRIVATE refers to a device-internal format that is not directly application-visible.  A
   1680      * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
   1681      * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
   1682      * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
   1683      * or output will never hurt maximum frame rate (i.e.  {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration getOutputStallDuration(ImageFormat.PRIVATE, size)} is always 0),</p>
   1684      * <p>Attempting to configure an input stream with output streams not
   1685      * listed as available in this map is not valid.</p>
   1686      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   1687      *
   1688      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1689      * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
   1690      * @hide
   1691      */
   1692     public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
   1693             new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
   1694 
   1695     /**
   1696      * <p>The available stream configurations that this
   1697      * camera device supports
   1698      * (i.e. format, width, height, output/input stream).</p>
   1699      * <p>The configurations are listed as <code>(format, width, height, input?)</code>
   1700      * tuples.</p>
   1701      * <p>For a given use case, the actual maximum supported resolution
   1702      * may be lower than what is listed here, depending on the destination
   1703      * Surface for the image data. For example, for recording video,
   1704      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
   1705      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
   1706      * can provide.</p>
   1707      * <p>Please reference the documentation for the image data destination to
   1708      * check if it limits the maximum size for image data.</p>
   1709      * <p>Not all output formats may be supported in a configuration with
   1710      * an input stream of a particular format. For more details, see
   1711      * android.scaler.availableInputOutputFormatsMap.</p>
   1712      * <p>The following table describes the minimum required output stream
   1713      * configurations based on the hardware level
   1714      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
   1715      * <table>
   1716      * <thead>
   1717      * <tr>
   1718      * <th align="center">Format</th>
   1719      * <th align="center">Size</th>
   1720      * <th align="center">Hardware Level</th>
   1721      * <th align="center">Notes</th>
   1722      * </tr>
   1723      * </thead>
   1724      * <tbody>
   1725      * <tr>
   1726      * <td align="center">JPEG</td>
   1727      * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
   1728      * <td align="center">Any</td>
   1729      * <td align="center"></td>
   1730      * </tr>
   1731      * <tr>
   1732      * <td align="center">JPEG</td>
   1733      * <td align="center">1920x1080 (1080p)</td>
   1734      * <td align="center">Any</td>
   1735      * <td align="center">if 1080p &lt;= activeArraySize</td>
   1736      * </tr>
   1737      * <tr>
   1738      * <td align="center">JPEG</td>
   1739      * <td align="center">1280x720 (720)</td>
   1740      * <td align="center">Any</td>
   1741      * <td align="center">if 720p &lt;= activeArraySize</td>
   1742      * </tr>
   1743      * <tr>
   1744      * <td align="center">JPEG</td>
   1745      * <td align="center">640x480 (480p)</td>
   1746      * <td align="center">Any</td>
   1747      * <td align="center">if 480p &lt;= activeArraySize</td>
   1748      * </tr>
   1749      * <tr>
   1750      * <td align="center">JPEG</td>
   1751      * <td align="center">320x240 (240p)</td>
   1752      * <td align="center">Any</td>
   1753      * <td align="center">if 240p &lt;= activeArraySize</td>
   1754      * </tr>
   1755      * <tr>
   1756      * <td align="center">YUV_420_888</td>
   1757      * <td align="center">all output sizes available for JPEG</td>
   1758      * <td align="center">FULL</td>
   1759      * <td align="center"></td>
   1760      * </tr>
   1761      * <tr>
   1762      * <td align="center">YUV_420_888</td>
   1763      * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
   1764      * <td align="center">LIMITED</td>
   1765      * <td align="center"></td>
   1766      * </tr>
   1767      * <tr>
   1768      * <td align="center">IMPLEMENTATION_DEFINED</td>
   1769      * <td align="center">same as YUV_420_888</td>
   1770      * <td align="center">Any</td>
   1771      * <td align="center"></td>
   1772      * </tr>
   1773      * </tbody>
   1774      * </table>
   1775      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
   1776      * mandatory stream configurations on a per-capability basis.</p>
   1777      * <p>This key is available on all devices.</p>
   1778      *
   1779      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1780      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1781      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   1782      * @hide
   1783      */
   1784     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
   1785             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
   1786 
   1787     /**
   1788      * <p>This lists the minimum frame duration for each
   1789      * format/size combination.</p>
   1790      * <p>This should correspond to the frame duration when only that
   1791      * stream is active, with all processing (typically in android.*.mode)
   1792      * set to either OFF or FAST.</p>
   1793      * <p>When multiple streams are used in a request, the minimum frame
   1794      * duration will be max(individual stream min durations).</p>
   1795      * <p>The minimum frame duration of a stream (of a particular format, size)
   1796      * is the same regardless of whether the stream is input or output.</p>
   1797      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
   1798      * android.scaler.availableStallDurations for more details about
   1799      * calculating the max frame rate.</p>
   1800      * <p>(Keep in sync with
   1801      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration })</p>
   1802      * <p><b>Units</b>: (format, width, height, ns) x n</p>
   1803      * <p>This key is available on all devices.</p>
   1804      *
   1805      * @see CaptureRequest#SENSOR_FRAME_DURATION
   1806      * @hide
   1807      */
   1808     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
   1809             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
   1810 
   1811     /**
   1812      * <p>This lists the maximum stall duration for each
   1813      * output format/size combination.</p>
   1814      * <p>A stall duration is how much extra time would get added
   1815      * to the normal minimum frame duration for a repeating request
   1816      * that has streams with non-zero stall.</p>
   1817      * <p>For example, consider JPEG captures which have the following
   1818      * characteristics:</p>
   1819      * <ul>
   1820      * <li>JPEG streams act like processed YUV streams in requests for which
   1821      * they are not included; in requests in which they are directly
   1822      * referenced, they act as JPEG streams. This is because supporting a
   1823      * JPEG stream requires the underlying YUV data to always be ready for
   1824      * use by a JPEG encoder, but the encoder will only be used (and impact
   1825      * frame duration) on requests that actually reference a JPEG stream.</li>
   1826      * <li>The JPEG processor can run concurrently to the rest of the camera
   1827      * pipeline, but cannot process more than 1 capture at a time.</li>
   1828      * </ul>
   1829      * <p>In other words, using a repeating YUV request would result
   1830      * in a steady frame rate (let's say it's 30 FPS). If a single
   1831      * JPEG request is submitted periodically, the frame rate will stay
   1832      * at 30 FPS (as long as we wait for the previous JPEG to return each
   1833      * time). If we try to submit a repeating YUV + JPEG request, then
   1834      * the frame rate will drop from 30 FPS.</p>
   1835      * <p>In general, submitting a new request with a non-0 stall time
   1836      * stream will <em>not</em> cause a frame rate drop unless there are still
   1837      * outstanding buffers for that stream from previous requests.</p>
   1838      * <p>Submitting a repeating request with streams (call this <code>S</code>)
   1839      * is the same as setting the minimum frame duration from
   1840      * the normal minimum frame duration corresponding to <code>S</code>, added with
   1841      * the maximum stall duration for <code>S</code>.</p>
   1842      * <p>If interleaving requests with and without a stall duration,
   1843      * a request will stall by the maximum of the remaining times
   1844      * for each can-stall stream with outstanding buffers.</p>
   1845      * <p>This means that a stalling request will not have an exposure start
   1846      * until the stall has completed.</p>
   1847      * <p>This should correspond to the stall duration when only that stream is
   1848      * active, with all processing (typically in android.*.mode) set to FAST
   1849      * or OFF. Setting any of the processing modes to HIGH_QUALITY
   1850      * effectively results in an indeterminate stall duration for all
   1851      * streams in a request (the regular stall calculation rules are
   1852      * ignored).</p>
   1853      * <p>The following formats may always have a stall duration:</p>
   1854      * <ul>
   1855      * <li>{@link android.graphics.ImageFormat#JPEG }</li>
   1856      * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
   1857      * </ul>
   1858      * <p>The following formats will never have a stall duration:</p>
   1859      * <ul>
   1860      * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
   1861      * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
   1862      * </ul>
   1863      * <p>All other formats may or may not have an allowed stall duration on
   1864      * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
   1865      * for more details.</p>
   1866      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
   1867      * calculating the max frame rate (absent stalls).</p>
   1868      * <p>(Keep up to date with
   1869      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } )</p>
   1870      * <p><b>Units</b>: (format, width, height, ns) x n</p>
   1871      * <p>This key is available on all devices.</p>
   1872      *
   1873      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1874      * @see CaptureRequest#SENSOR_FRAME_DURATION
   1875      * @hide
   1876      */
   1877     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
   1878             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
   1879 
   1880     /**
   1881      * <p>The available stream configurations that this
   1882      * camera device supports; also includes the minimum frame durations
   1883      * and the stall durations for each format/size combination.</p>
   1884      * <p>All camera devices will support sensor maximum resolution (defined by
   1885      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
   1886      * <p>For a given use case, the actual maximum supported resolution
   1887      * may be lower than what is listed here, depending on the destination
   1888      * Surface for the image data. For example, for recording video,
   1889      * the video encoder chosen may have a maximum size limit (e.g. 1080p)
   1890      * smaller than what the camera (e.g. maximum resolution is 3264x2448)
   1891      * can provide.</p>
   1892      * <p>Please reference the documentation for the image data destination to
   1893      * check if it limits the maximum size for image data.</p>
   1894      * <p>The following table describes the minimum required output stream
   1895      * configurations based on the hardware level
   1896      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
   1897      * <table>
   1898      * <thead>
   1899      * <tr>
   1900      * <th align="center">Format</th>
   1901      * <th align="center">Size</th>
   1902      * <th align="center">Hardware Level</th>
   1903      * <th align="center">Notes</th>
   1904      * </tr>
   1905      * </thead>
   1906      * <tbody>
   1907      * <tr>
   1908      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
   1909      * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} (*1)</td>
   1910      * <td align="center">Any</td>
   1911      * <td align="center"></td>
   1912      * </tr>
   1913      * <tr>
   1914      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
   1915      * <td align="center">1920x1080 (1080p)</td>
   1916      * <td align="center">Any</td>
   1917      * <td align="center">if 1080p &lt;= activeArraySize</td>
   1918      * </tr>
   1919      * <tr>
   1920      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
   1921      * <td align="center">1280x720 (720p)</td>
   1922      * <td align="center">Any</td>
   1923      * <td align="center">if 720p &lt;= activeArraySize</td>
   1924      * </tr>
   1925      * <tr>
   1926      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
   1927      * <td align="center">640x480 (480p)</td>
   1928      * <td align="center">Any</td>
   1929      * <td align="center">if 480p &lt;= activeArraySize</td>
   1930      * </tr>
   1931      * <tr>
   1932      * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
   1933      * <td align="center">320x240 (240p)</td>
   1934      * <td align="center">Any</td>
   1935      * <td align="center">if 240p &lt;= activeArraySize</td>
   1936      * </tr>
   1937      * <tr>
   1938      * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
   1939      * <td align="center">all output sizes available for JPEG</td>
   1940      * <td align="center">FULL</td>
   1941      * <td align="center"></td>
   1942      * </tr>
   1943      * <tr>
   1944      * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
   1945      * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
   1946      * <td align="center">LIMITED</td>
   1947      * <td align="center"></td>
   1948      * </tr>
   1949      * <tr>
   1950      * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
   1951      * <td align="center">same as YUV_420_888</td>
   1952      * <td align="center">Any</td>
   1953      * <td align="center"></td>
   1954      * </tr>
   1955      * </tbody>
   1956      * </table>
   1957      * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
   1958      * stream configurations on a per-capability basis.</p>
   1959      * <p>*1: For JPEG format, the sizes may be restricted by below conditions:</p>
   1960      * <ul>
   1961      * <li>The HAL may choose the aspect ratio of each Jpeg size to be one of well known ones
   1962      * (e.g. 4:3, 16:9, 3:2 etc.). If the sensor maximum resolution
   1963      * (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) has an aspect ratio other than these,
   1964      * it does not have to be included in the supported JPEG sizes.</li>
   1965      * <li>Some hardware JPEG encoders may have pixel boundary alignment requirements, such as
   1966      * the dimensions being a multiple of 16.
   1967      * Therefore, the maximum JPEG size may be smaller than sensor maximum resolution.
   1968      * However, the largest JPEG size will be as close as possible to the sensor maximum
   1969      * resolution given above constraints. It is required that after aspect ratio adjustments,
   1970      * additional size reduction due to other issues must be less than 3% in area. For example,
   1971      * if the sensor maximum resolution is 3280x2464, if the maximum JPEG size has aspect
   1972      * ratio 4:3, and the JPEG encoder alignment requirement is 16, the maximum JPEG size will be
   1973      * 3264x2448.</li>
   1974      * </ul>
   1975      * <p>This key is available on all devices.</p>
   1976      *
   1977      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1978      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1979      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   1980      */
   1981     @PublicKey
   1982     @SyntheticKey
   1983     public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
   1984             new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
   1985 
   1986     /**
   1987      * <p>The crop type that this camera device supports.</p>
   1988      * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
   1989      * device that only supports CENTER_ONLY cropping, the camera device will move the
   1990      * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
   1991      * and keep the crop region width and height unchanged. The camera device will return the
   1992      * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
   1993      * <p>Camera devices that support FREEFORM cropping will support any crop region that
   1994      * is inside of the active array. The camera device will apply the same crop region and
   1995      * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
   1996      * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
   1997      * <p><b>Possible values:</b>
   1998      * <ul>
   1999      *   <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
   2000      *   <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
   2001      * </ul></p>
   2002      * <p>This key is available on all devices.</p>
   2003      *
   2004      * @see CaptureRequest#SCALER_CROP_REGION
   2005      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   2006      * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
   2007      * @see #SCALER_CROPPING_TYPE_FREEFORM
   2008      */
   2009     @PublicKey
   2010     public static final Key<Integer> SCALER_CROPPING_TYPE =
   2011             new Key<Integer>("android.scaler.croppingType", int.class);
   2012 
   2013     /**
   2014      * <p>The area of the image sensor which corresponds to active pixels after any geometric
   2015      * distortion correction has been applied.</p>
   2016      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
   2017      * the region that actually receives light from the scene) after any geometric correction
   2018      * has been applied, and should be treated as the maximum size in pixels of any of the
   2019      * image output formats aside from the raw formats.</p>
   2020      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
   2021      * the full pixel array, and the size of the full pixel array is given by
   2022      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
   2023      * <p>The coordinate system for most other keys that list pixel coordinates, including
   2024      * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
   2025      * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
   2026      * <p>The active array may be smaller than the full pixel array, since the full array may
   2027      * include black calibration pixels or other inactive regions, and geometric correction
   2028      * resulting in scaling or cropping may have been applied.</p>
   2029      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
   2030      * <p>This key is available on all devices.</p>
   2031      *
   2032      * @see CaptureRequest#SCALER_CROP_REGION
   2033      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
   2034      */
   2035     @PublicKey
   2036     public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
   2037             new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
   2038 
   2039     /**
   2040      * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
   2041      * camera device.</p>
   2042      * <p>The values are the standard ISO sensitivity values,
   2043      * as defined in ISO 12232:2006.</p>
   2044      * <p><b>Range of valid values:</b><br>
   2045      * Min &lt;= 100, Max &gt;= 800</p>
   2046      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2047      * <p><b>Full capability</b> -
   2048      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2049      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2050      *
   2051      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2052      * @see CaptureRequest#SENSOR_SENSITIVITY
   2053      */
   2054     @PublicKey
   2055     public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
   2056             new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
   2057 
   2058     /**
   2059      * <p>The arrangement of color filters on sensor;
   2060      * represents the colors in the top-left 2x2 section of
   2061      * the sensor, in reading order.</p>
   2062      * <p><b>Possible values:</b>
   2063      * <ul>
   2064      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
   2065      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
   2066      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
   2067      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
   2068      *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
   2069      * </ul></p>
   2070      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2071      * <p><b>Full capability</b> -
   2072      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2073      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2074      *
   2075      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2076      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
   2077      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
   2078      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
   2079      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
   2080      * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
   2081      */
   2082     @PublicKey
   2083     public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
   2084             new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
   2085 
   2086     /**
   2087      * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
   2088      * by this camera device.</p>
   2089      * <p><b>Units</b>: Nanoseconds</p>
   2090      * <p><b>Range of valid values:</b><br>
   2091      * The minimum exposure time will be less than 100 us. For FULL
   2092      * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
   2093      * the maximum exposure time will be greater than 100ms.</p>
   2094      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2095      * <p><b>Full capability</b> -
   2096      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2097      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2098      *
   2099      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2100      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
   2101      */
   2102     @PublicKey
   2103     public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
   2104             new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
   2105 
   2106     /**
   2107      * <p>The maximum possible frame duration (minimum frame rate) for
   2108      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
   2109      * <p>Attempting to use frame durations beyond the maximum will result in the frame
   2110      * duration being clipped to the maximum. See that control for a full definition of frame
   2111      * durations.</p>
   2112      * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
   2113      * for the minimum frame duration values.</p>
   2114      * <p><b>Units</b>: Nanoseconds</p>
   2115      * <p><b>Range of valid values:</b><br>
   2116      * For FULL capability devices
   2117      * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
   2118      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2119      * <p><b>Full capability</b> -
   2120      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2121      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2122      *
   2123      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2124      * @see CaptureRequest#SENSOR_FRAME_DURATION
   2125      */
   2126     @PublicKey
   2127     public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
   2128             new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
   2129 
   2130     /**
   2131      * <p>The physical dimensions of the full pixel
   2132      * array.</p>
   2133      * <p>This is the physical size of the sensor pixel
   2134      * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
   2135      * <p><b>Units</b>: Millimeters</p>
   2136      * <p>This key is available on all devices.</p>
   2137      *
   2138      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
   2139      */
   2140     @PublicKey
   2141     public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
   2142             new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
   2143 
   2144     /**
   2145      * <p>Dimensions of the full pixel array, possibly
   2146      * including black calibration pixels.</p>
   2147      * <p>The pixel count of the full pixel array of the image sensor, which covers
   2148      * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area.  This represents the full pixel dimensions of
   2149      * the raw buffers produced by this sensor.</p>
   2150      * <p>If a camera device supports raw sensor formats, either this or
   2151      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is the maximum dimensions for the raw
   2152      * output formats listed in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} (this depends on
   2153      * whether or not the image sensor returns buffers containing pixels that are not
   2154      * part of the active array region for blacklevel calibration or other purposes).</p>
   2155      * <p>Some parts of the full pixel array may not receive light from the scene,
   2156      * or be otherwise inactive.  The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
   2157      * defines the rectangle of active pixels that will be included in processed image
   2158      * formats.</p>
   2159      * <p><b>Units</b>: Pixels</p>
   2160      * <p>This key is available on all devices.</p>
   2161      *
   2162      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
   2163      * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
   2164      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
   2165      */
   2166     @PublicKey
   2167     public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
   2168             new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
   2169 
   2170     /**
   2171      * <p>Maximum raw value output by sensor.</p>
   2172      * <p>This specifies the fully-saturated encoding level for the raw
   2173      * sample values from the sensor.  This is typically caused by the
   2174      * sensor becoming highly non-linear or clipping. The minimum for
   2175      * each channel is specified by the offset in the
   2176      * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
   2177      * <p>The white level is typically determined either by sensor bit depth
   2178      * (8-14 bits is expected), or by the point where the sensor response
   2179      * becomes too non-linear to be useful.  The default value for this is
   2180      * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
   2181      * <p><b>Range of valid values:</b><br>
   2182      * &gt; 255 (8-bit output)</p>
   2183      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2184      *
   2185      * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
   2186      */
   2187     @PublicKey
   2188     public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
   2189             new Key<Integer>("android.sensor.info.whiteLevel", int.class);
   2190 
   2191     /**
   2192      * <p>The time base source for sensor capture start timestamps.</p>
   2193      * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
   2194      * may not based on a time source that can be compared to other system time sources.</p>
   2195      * <p>This characteristic defines the source for the timestamps, and therefore whether they
   2196      * can be compared against other system time sources/timestamps.</p>
   2197      * <p><b>Possible values:</b>
   2198      * <ul>
   2199      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
   2200      *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
   2201      * </ul></p>
   2202      * <p>This key is available on all devices.</p>
   2203      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
   2204      * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
   2205      */
   2206     @PublicKey
   2207     public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
   2208             new Key<Integer>("android.sensor.info.timestampSource", int.class);
   2209 
   2210     /**
   2211      * <p>Whether the RAW images output from this camera device are subject to
   2212      * lens shading correction.</p>
   2213      * <p>If TRUE, all images produced by the camera device in the RAW image formats will
   2214      * have lens shading correction already applied to it. If FALSE, the images will
   2215      * not be adjusted for lens shading correction.
   2216      * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
   2217      * <p>This key will be <code>null</code> for all devices do not report this information.
   2218      * Devices with RAW capability will always report this information in this key.</p>
   2219      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2220      *
   2221      * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
   2222      */
   2223     @PublicKey
   2224     public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
   2225             new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
   2226 
   2227     /**
   2228      * <p>The area of the image sensor which corresponds to active pixels prior to the
   2229      * application of any geometric distortion correction.</p>
   2230      * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
   2231      * the region that actually receives light from the scene) before any geometric correction
   2232      * has been applied, and should be treated as the active region rectangle for any of the
   2233      * raw formats.  All metadata associated with raw processing (e.g. the lens shading
   2234      * correction map, and radial distortion fields) treats the top, left of this rectangle as
   2235      * the origin, (0,0).</p>
   2236      * <p>The size of this region determines the maximum field of view and the maximum number of
   2237      * pixels that an image from this sensor can contain, prior to the application of
   2238      * geometric distortion correction. The effective maximum pixel dimensions of a
   2239      * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
   2240      * field, and the effective maximum field of view for a post-distortion-corrected image
   2241      * can be calculated by applying the geometric distortion correction fields to this
   2242      * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
   2243      * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
   2244      * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
   2245      * (x', y'), in the raw pixel array with dimensions give in
   2246      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
   2247      * <ol>
   2248      * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
   2249      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
   2250      * to be outside of the FOV, and will not be shown in the processed output image.</li>
   2251      * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
   2252      * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
   2253      * buffers is defined relative to the top, left of the
   2254      * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
   2255      * <li>If the resulting corrected pixel coordinate is within the region given in
   2256      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
   2257      * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
   2258      * when the top, left coordinate of that buffer is treated as (0, 0).</li>
   2259      * </ol>
   2260      * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
   2261      * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
   2262      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
   2263      * correction doesn't change the pixel coordinate, the resulting pixel selected in
   2264      * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
   2265      * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
   2266      * relative to the top,left of post-processed YUV output buffer with dimensions given in
   2267      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
   2268      * <p>The currently supported fields that correct for geometric distortion are:</p>
   2269      * <ol>
   2270      * <li>{@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}.</li>
   2271      * </ol>
   2272      * <p>If all of the geometric distortion fields are no-ops, this rectangle will be the same
   2273      * as the post-distortion-corrected rectangle given in
   2274      * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
   2275      * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
   2276      * the full pixel array, and the size of the full pixel array is given by
   2277      * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
   2278      * <p>The pre-correction active array may be smaller than the full pixel array, since the
   2279      * full array may include black calibration pixels or other inactive regions.</p>
   2280      * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
   2281      * <p>This key is available on all devices.</p>
   2282      *
   2283      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
   2284      * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
   2285      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
   2286      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
   2287      */
   2288     @PublicKey
   2289     public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
   2290             new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
   2291 
   2292     /**
   2293      * <p>The standard reference illuminant used as the scene light source when
   2294      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
   2295      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
   2296      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
   2297      * <p>The values in this key correspond to the values defined for the
   2298      * EXIF LightSource tag. These illuminants are standard light sources
   2299      * that are often used calibrating camera devices.</p>
   2300      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
   2301      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
   2302      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
   2303      * <p>Some devices may choose to provide a second set of calibration
   2304      * information for improved quality, including
   2305      * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
   2306      * <p><b>Possible values:</b>
   2307      * <ul>
   2308      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
   2309      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
   2310      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
   2311      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
   2312      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
   2313      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
   2314      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
   2315      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
   2316      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
   2317      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
   2318      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
   2319      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
   2320      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
   2321      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
   2322      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
   2323      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
   2324      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
   2325      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
   2326      *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
   2327      * </ul></p>
   2328      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2329      *
   2330      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
   2331      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
   2332      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
   2333      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
   2334      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
   2335      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
   2336      * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
   2337      * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
   2338      * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
   2339      * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
   2340      * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
   2341      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
   2342      * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
   2343      * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
   2344      * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
   2345      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
   2346      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
   2347      * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
   2348      * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
   2349      * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
   2350      * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
   2351      * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
   2352      * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
   2353      */
   2354     @PublicKey
   2355     public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
   2356             new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
   2357 
   2358     /**
   2359      * <p>The standard reference illuminant used as the scene light source when
   2360      * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
   2361      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
   2362      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
   2363      * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
   2364      * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
   2365      * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
   2366      * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
   2367      * <p><b>Range of valid values:</b><br>
   2368      * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
   2369      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2370      *
   2371      * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
   2372      * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
   2373      * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
   2374      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
   2375      */
   2376     @PublicKey
   2377     public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
   2378             new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
   2379 
   2380     /**
   2381      * <p>A per-device calibration transform matrix that maps from the
   2382      * reference sensor colorspace to the actual device sensor colorspace.</p>
   2383      * <p>This matrix is used to correct for per-device variations in the
   2384      * sensor colorspace, and is used for processing raw buffer data.</p>
   2385      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
   2386      * contains a per-device calibration transform that maps colors
   2387      * from reference sensor color space (i.e. the "golden module"
   2388      * colorspace) into this camera device's native sensor color
   2389      * space under the first reference illuminant
   2390      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
   2391      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2392      *
   2393      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
   2394      */
   2395     @PublicKey
   2396     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
   2397             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
   2398 
   2399     /**
   2400      * <p>A per-device calibration transform matrix that maps from the
   2401      * reference sensor colorspace to the actual device sensor colorspace
   2402      * (this is the colorspace of the raw buffer data).</p>
   2403      * <p>This matrix is used to correct for per-device variations in the
   2404      * sensor colorspace, and is used for processing raw buffer data.</p>
   2405      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
   2406      * contains a per-device calibration transform that maps colors
   2407      * from reference sensor color space (i.e. the "golden module"
   2408      * colorspace) into this camera device's native sensor color
   2409      * space under the second reference illuminant
   2410      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
   2411      * <p>This matrix will only be present if the second reference
   2412      * illuminant is present.</p>
   2413      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2414      *
   2415      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
   2416      */
   2417     @PublicKey
   2418     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
   2419             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
   2420 
   2421     /**
   2422      * <p>A matrix that transforms color values from CIE XYZ color space to
   2423      * reference sensor color space.</p>
   2424      * <p>This matrix is used to convert from the standard CIE XYZ color
   2425      * space to the reference sensor colorspace, and is used when processing
   2426      * raw buffer data.</p>
   2427      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
   2428      * contains a color transform matrix that maps colors from the CIE
   2429      * XYZ color space to the reference sensor color space (i.e. the
   2430      * "golden module" colorspace) under the first reference illuminant
   2431      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
   2432      * <p>The white points chosen in both the reference sensor color space
   2433      * and the CIE XYZ colorspace when calculating this transform will
   2434      * match the standard white point for the first reference illuminant
   2435      * (i.e. no chromatic adaptation will be applied by this transform).</p>
   2436      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2437      *
   2438      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
   2439      */
   2440     @PublicKey
   2441     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
   2442             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
   2443 
   2444     /**
   2445      * <p>A matrix that transforms color values from CIE XYZ color space to
   2446      * reference sensor color space.</p>
   2447      * <p>This matrix is used to convert from the standard CIE XYZ color
   2448      * space to the reference sensor colorspace, and is used when processing
   2449      * raw buffer data.</p>
   2450      * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
   2451      * contains a color transform matrix that maps colors from the CIE
   2452      * XYZ color space to the reference sensor color space (i.e. the
   2453      * "golden module" colorspace) under the second reference illuminant
   2454      * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
   2455      * <p>The white points chosen in both the reference sensor color space
   2456      * and the CIE XYZ colorspace when calculating this transform will
   2457      * match the standard white point for the second reference illuminant
   2458      * (i.e. no chromatic adaptation will be applied by this transform).</p>
   2459      * <p>This matrix will only be present if the second reference
   2460      * illuminant is present.</p>
   2461      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2462      *
   2463      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
   2464      */
   2465     @PublicKey
   2466     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
   2467             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
   2468 
   2469     /**
   2470      * <p>A matrix that transforms white balanced camera colors from the reference
   2471      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
   2472      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
   2473      * is used when processing raw buffer data.</p>
   2474      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
   2475      * a color transform matrix that maps white balanced colors from the
   2476      * reference sensor color space to the CIE XYZ color space with a D50 white
   2477      * point.</p>
   2478      * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
   2479      * this matrix is chosen so that the standard white point for this reference
   2480      * illuminant in the reference sensor colorspace is mapped to D50 in the
   2481      * CIE XYZ colorspace.</p>
   2482      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2483      *
   2484      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
   2485      */
   2486     @PublicKey
   2487     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
   2488             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
   2489 
   2490     /**
   2491      * <p>A matrix that transforms white balanced camera colors from the reference
   2492      * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
   2493      * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
   2494      * is used when processing raw buffer data.</p>
   2495      * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
   2496      * a color transform matrix that maps white balanced colors from the
   2497      * reference sensor color space to the CIE XYZ color space with a D50 white
   2498      * point.</p>
   2499      * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
   2500      * this matrix is chosen so that the standard white point for this reference
   2501      * illuminant in the reference sensor colorspace is mapped to D50 in the
   2502      * CIE XYZ colorspace.</p>
   2503      * <p>This matrix will only be present if the second reference
   2504      * illuminant is present.</p>
   2505      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2506      *
   2507      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
   2508      */
   2509     @PublicKey
   2510     public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
   2511             new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
   2512 
   2513     /**
   2514      * <p>A fixed black level offset for each of the color filter arrangement
   2515      * (CFA) mosaic channels.</p>
   2516      * <p>This key specifies the zero light value for each of the CFA mosaic
   2517      * channels in the camera sensor.  The maximal value output by the
   2518      * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.</p>
   2519      * <p>The values are given in the same order as channels listed for the CFA
   2520      * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
   2521      * nth value given corresponds to the black level offset for the nth
   2522      * color channel listed in the CFA.</p>
   2523      * <p><b>Range of valid values:</b><br>
   2524      * &gt;= 0 for each.</p>
   2525      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2526      *
   2527      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
   2528      * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
   2529      */
   2530     @PublicKey
   2531     public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
   2532             new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
   2533 
   2534     /**
   2535      * <p>Maximum sensitivity that is implemented
   2536      * purely through analog gain.</p>
   2537      * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
   2538      * equal to this, all applied gain must be analog. For
   2539      * values above this, the gain applied can be a mix of analog and
   2540      * digital.</p>
   2541      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2542      * <p><b>Full capability</b> -
   2543      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2544      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2545      *
   2546      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2547      * @see CaptureRequest#SENSOR_SENSITIVITY
   2548      */
   2549     @PublicKey
   2550     public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
   2551             new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
   2552 
   2553     /**
   2554      * <p>Clockwise angle through which the output image needs to be rotated to be
   2555      * upright on the device screen in its native orientation.</p>
   2556      * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
   2557      * the sensor's coordinate system.</p>
   2558      * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
   2559      * 90</p>
   2560      * <p><b>Range of valid values:</b><br>
   2561      * 0, 90, 180, 270</p>
   2562      * <p>This key is available on all devices.</p>
   2563      */
   2564     @PublicKey
   2565     public static final Key<Integer> SENSOR_ORIENTATION =
   2566             new Key<Integer>("android.sensor.orientation", int.class);
   2567 
   2568     /**
   2569      * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
   2570      * supported by this camera device.</p>
   2571      * <p>Defaults to OFF, and always includes OFF if defined.</p>
   2572      * <p><b>Range of valid values:</b><br>
   2573      * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
   2574      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2575      *
   2576      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2577      */
   2578     @PublicKey
   2579     public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
   2580             new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
   2581 
   2582     /**
   2583      * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
   2584      * <p>This list contains lens shading modes that can be set for the camera device.
   2585      * Camera devices that support the MANUAL_POST_PROCESSING capability will always
   2586      * list OFF and FAST mode. This includes all FULL level devices.
   2587      * LEGACY devices will always only support FAST mode.</p>
   2588      * <p><b>Range of valid values:</b><br>
   2589      * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
   2590      * <p>This key is available on all devices.</p>
   2591      *
   2592      * @see CaptureRequest#SHADING_MODE
   2593      */
   2594     @PublicKey
   2595     public static final Key<int[]> SHADING_AVAILABLE_MODES =
   2596             new Key<int[]>("android.shading.availableModes", int[].class);
   2597 
   2598     /**
   2599      * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
   2600      * supported by this camera device.</p>
   2601      * <p>OFF is always supported.</p>
   2602      * <p><b>Range of valid values:</b><br>
   2603      * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
   2604      * <p>This key is available on all devices.</p>
   2605      *
   2606      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
   2607      */
   2608     @PublicKey
   2609     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
   2610             new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
   2611 
   2612     /**
   2613      * <p>The maximum number of simultaneously detectable
   2614      * faces.</p>
   2615      * <p><b>Range of valid values:</b><br>
   2616      * 0 for cameras without available face detection; otherwise:
   2617      * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
   2618      * <code>&gt;0</code> for LEGACY devices.</p>
   2619      * <p>This key is available on all devices.</p>
   2620      */
   2621     @PublicKey
   2622     public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
   2623             new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
   2624 
   2625     /**
   2626      * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
   2627      * supported by this camera device.</p>
   2628      * <p>If no hotpixel map output is available for this camera device, this will contain only
   2629      * <code>false</code>.</p>
   2630      * <p>ON is always supported on devices with the RAW capability.</p>
   2631      * <p><b>Range of valid values:</b><br>
   2632      * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
   2633      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2634      *
   2635      * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
   2636      */
   2637     @PublicKey
   2638     public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
   2639             new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
   2640 
   2641     /**
   2642      * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
   2643      * are supported by this camera device.</p>
   2644      * <p>If no lens shading map output is available for this camera device, this key will
   2645      * contain only OFF.</p>
   2646      * <p>ON is always supported on devices with the RAW capability.
   2647      * LEGACY mode devices will always only support OFF.</p>
   2648      * <p><b>Range of valid values:</b><br>
   2649      * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
   2650      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2651      *
   2652      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
   2653      */
   2654     @PublicKey
   2655     public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
   2656             new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
   2657 
   2658     /**
   2659      * <p>Maximum number of supported points in the
   2660      * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
   2661      * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
   2662      * less than this maximum, the camera device will resample the curve to its internal
   2663      * representation, using linear interpolation.</p>
   2664      * <p>The output curves in the result metadata may have a different number
   2665      * of points than the input curves, and will represent the actual
   2666      * hardware curves used as closely as possible when linearly interpolated.</p>
   2667      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2668      * <p><b>Full capability</b> -
   2669      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2670      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2671      *
   2672      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2673      * @see CaptureRequest#TONEMAP_CURVE
   2674      */
   2675     @PublicKey
   2676     public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
   2677             new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
   2678 
   2679     /**
   2680      * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
   2681      * device.</p>
   2682      * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
   2683      * at least one of below mode combinations:</p>
   2684      * <ul>
   2685      * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
   2686      * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
   2687      * </ul>
   2688      * <p>This includes all FULL level devices.</p>
   2689      * <p><b>Range of valid values:</b><br>
   2690      * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
   2691      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2692      * <p><b>Full capability</b> -
   2693      * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
   2694      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2695      *
   2696      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2697      * @see CaptureRequest#TONEMAP_MODE
   2698      */
   2699     @PublicKey
   2700     public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
   2701             new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
   2702 
   2703     /**
   2704      * <p>A list of camera LEDs that are available on this system.</p>
   2705      * <p><b>Possible values:</b>
   2706      * <ul>
   2707      *   <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
   2708      * </ul></p>
   2709      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2710      * @see #LED_AVAILABLE_LEDS_TRANSMIT
   2711      * @hide
   2712      */
   2713     public static final Key<int[]> LED_AVAILABLE_LEDS =
   2714             new Key<int[]>("android.led.availableLeds", int[].class);
   2715 
   2716     /**
   2717      * <p>Generally classifies the overall set of the camera device functionality.</p>
   2718      * <p>Camera devices will come in three flavors: LEGACY, LIMITED and FULL.</p>
   2719      * <p>A FULL device will support below capabilities:</p>
   2720      * <ul>
   2721      * <li>BURST_CAPTURE capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains BURST_CAPTURE)</li>
   2722      * <li>Per frame control ({@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} <code>==</code> PER_FRAME_CONTROL)</li>
   2723      * <li>Manual sensor control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR)</li>
   2724      * <li>Manual post-processing control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
   2725      *   MANUAL_POST_PROCESSING)</li>
   2726      * <li>At least 3 processed (but not stalling) format output streams
   2727      *   ({@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_PROC android.request.maxNumOutputProc} <code>&gt;=</code> 3)</li>
   2728      * <li>The required stream configurations defined in android.scaler.availableStreamConfigurations</li>
   2729      * <li>The required exposure time range defined in {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</li>
   2730      * <li>The required maxFrameDuration defined in {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}</li>
   2731      * </ul>
   2732      * <p>A LIMITED device may have some or none of the above characteristics.
   2733      * To find out more refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
   2734      * <p>Some features are not part of any particular hardware level or capability and must be
   2735      * queried separately. These include:</p>
   2736      * <ul>
   2737      * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
   2738      * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
   2739      * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
   2740      * <li>Optical or electrical image stabilization
   2741      *   ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
   2742      *    {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
   2743      * </ul>
   2744      * <p>A LEGACY device does not support per-frame control, manual sensor control, manual
   2745      * post-processing, arbitrary cropping regions, and has relaxed performance constraints.</p>
   2746      * <p>Each higher level supports everything the lower level supports
   2747      * in this order: FULL <code>&gt;</code> LIMITED <code>&gt;</code> LEGACY.</p>
   2748      * <p>Note:
   2749      * Pre-API level 23, FULL devices also supported arbitrary cropping region
   2750      * ({@link CameraCharacteristics#SCALER_CROPPING_TYPE android.scaler.croppingType} <code>==</code> FREEFORM); this requirement was relaxed in API level 23,
   2751      * and FULL devices may only support CENTERED cropping.</p>
   2752      * <p><b>Possible values:</b>
   2753      * <ul>
   2754      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
   2755      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
   2756      *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
   2757      * </ul></p>
   2758      * <p>This key is available on all devices.</p>
   2759      *
   2760      * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
   2761      * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
   2762      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
   2763      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   2764      * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_PROC
   2765      * @see CameraCharacteristics#SCALER_CROPPING_TYPE
   2766      * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
   2767      * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
   2768      * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
   2769      * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
   2770      * @see CameraCharacteristics#SYNC_MAX_LATENCY
   2771      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
   2772      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
   2773      * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
   2774      */
   2775     @PublicKey
   2776     public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
   2777             new Key<Integer>("android.info.supportedHardwareLevel", int.class);
   2778 
   2779     /**
   2780      * <p>The maximum number of frames that can occur after a request
   2781      * (different than the previous) has been submitted, and before the
   2782      * result's state becomes synchronized.</p>
   2783      * <p>This defines the maximum distance (in number of metadata results),
   2784      * between the frame number of the request that has new controls to apply
   2785      * and the frame number of the result that has all the controls applied.</p>
   2786      * <p>In other words this acts as an upper boundary for how many frames
   2787      * must occur before the camera device knows for a fact that the new
   2788      * submitted camera settings have been applied in outgoing frames.</p>
   2789      * <p><b>Units</b>: Frame counts</p>
   2790      * <p><b>Possible values:</b>
   2791      * <ul>
   2792      *   <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
   2793      *   <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
   2794      * </ul></p>
   2795      * <p><b>Available values for this device:</b><br>
   2796      * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
   2797      * <p>This key is available on all devices.</p>
   2798      * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
   2799      * @see #SYNC_MAX_LATENCY_UNKNOWN
   2800      */
   2801     @PublicKey
   2802     public static final Key<Integer> SYNC_MAX_LATENCY =
   2803             new Key<Integer>("android.sync.maxLatency", int.class);
   2804 
   2805     /**
   2806      * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
   2807      * reprocess capture request.</p>
   2808      * <p>The key describes the maximal interference that one reprocess (input) request
   2809      * can introduce to the camera simultaneous streaming of regular (output) capture
   2810      * requests, including repeating requests.</p>
   2811      * <p>When a reprocessing capture request is submitted while a camera output repeating request
   2812      * (e.g. preview) is being served by the camera device, it may preempt the camera capture
   2813      * pipeline for at least one frame duration so that the camera device is unable to process
   2814      * the following capture request in time for the next sensor start of exposure boundary.
   2815      * When this happens, the application may observe a capture time gap (longer than one frame
   2816      * duration) between adjacent capture output frames, which usually exhibits as preview
   2817      * glitch if the repeating request output targets include a preview surface. This key gives
   2818      * the worst-case number of frame stall introduced by one reprocess request with any kind of
   2819      * formats/sizes combination.</p>
   2820      * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
   2821      * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
   2822      * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
   2823      * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
   2824      * YUV_REPROCESSING).</p>
   2825      * <p><b>Units</b>: Number of frames.</p>
   2826      * <p><b>Range of valid values:</b><br>
   2827      * &lt;= 4</p>
   2828      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2829      * <p><b>Limited capability</b> -
   2830      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
   2831      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2832      *
   2833      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2834      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   2835      */
   2836     @PublicKey
   2837     public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
   2838             new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
   2839 
   2840     /**
   2841      * <p>The available depth dataspace stream
   2842      * configurations that this camera device supports
   2843      * (i.e. format, width, height, output/input stream).</p>
   2844      * <p>These are output stream configurations for use with
   2845      * dataSpace HAL_DATASPACE_DEPTH. The configurations are
   2846      * listed as <code>(format, width, height, input?)</code> tuples.</p>
   2847      * <p>Only devices that support depth output for at least
   2848      * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
   2849      * this entry.</p>
   2850      * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
   2851      * sparse depth point cloud must report a single entry for
   2852      * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
   2853      * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
   2854      * the entries for HAL_PIXEL_FORMAT_Y16.</p>
   2855      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2856      * <p><b>Limited capability</b> -
   2857      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
   2858      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2859      *
   2860      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2861      * @hide
   2862      */
   2863     public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
   2864             new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
   2865 
   2866     /**
   2867      * <p>This lists the minimum frame duration for each
   2868      * format/size combination for depth output formats.</p>
   2869      * <p>This should correspond to the frame duration when only that
   2870      * stream is active, with all processing (typically in android.*.mode)
   2871      * set to either OFF or FAST.</p>
   2872      * <p>When multiple streams are used in a request, the minimum frame
   2873      * duration will be max(individual stream min durations).</p>
   2874      * <p>The minimum frame duration of a stream (of a particular format, size)
   2875      * is the same regardless of whether the stream is input or output.</p>
   2876      * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
   2877      * android.scaler.availableStallDurations for more details about
   2878      * calculating the max frame rate.</p>
   2879      * <p>(Keep in sync with {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration })</p>
   2880      * <p><b>Units</b>: (format, width, height, ns) x n</p>
   2881      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2882      * <p><b>Limited capability</b> -
   2883      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
   2884      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2885      *
   2886      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2887      * @see CaptureRequest#SENSOR_FRAME_DURATION
   2888      * @hide
   2889      */
   2890     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
   2891             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
   2892 
   2893     /**
   2894      * <p>This lists the maximum stall duration for each
   2895      * output format/size combination for depth streams.</p>
   2896      * <p>A stall duration is how much extra time would get added
   2897      * to the normal minimum frame duration for a repeating request
   2898      * that has streams with non-zero stall.</p>
   2899      * <p>This functions similarly to
   2900      * android.scaler.availableStallDurations for depth
   2901      * streams.</p>
   2902      * <p>All depth output stream formats may have a nonzero stall
   2903      * duration.</p>
   2904      * <p><b>Units</b>: (format, width, height, ns) x n</p>
   2905      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2906      * <p><b>Limited capability</b> -
   2907      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
   2908      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2909      *
   2910      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2911      * @hide
   2912      */
   2913     public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
   2914             new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
   2915 
   2916     /**
   2917      * <p>Indicates whether a capture request may target both a
   2918      * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
   2919      * YUV_420_888, JPEG, or RAW) simultaneously.</p>
   2920      * <p>If TRUE, including both depth and color outputs in a single
   2921      * capture request is not supported. An application must interleave color
   2922      * and depth requests.  If FALSE, a single request can target both types
   2923      * of output.</p>
   2924      * <p>Typically, this restriction exists on camera devices that
   2925      * need to emit a specific pattern or wavelength of light to
   2926      * measure depth values, which causes the color image to be
   2927      * corrupted during depth measurement.</p>
   2928      * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
   2929      * <p><b>Limited capability</b> -
   2930      * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
   2931      * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
   2932      *
   2933      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   2934      */
   2935     @PublicKey
   2936     public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
   2937             new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
   2938 
   2939     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
   2940      * End generated code
   2941      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
   2942 
   2943 
   2944 
   2945 }
   2946