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.hardware.camera2.impl.CameraMetadataNative;
     21 import android.hardware.camera2.impl.PublicKey;
     22 import android.hardware.camera2.impl.SyntheticKey;
     23 import android.util.Log;
     24 
     25 import java.lang.reflect.Field;
     26 import java.lang.reflect.Modifier;
     27 import java.util.ArrayList;
     28 import java.util.Arrays;
     29 import java.util.Collections;
     30 import java.util.List;
     31 
     32 /**
     33  * The base class for camera controls and information.
     34  *
     35  * <p>
     36  * This class defines the basic key/value map used for querying for camera
     37  * characteristics or capture results, and for setting camera request
     38  * parameters.
     39  * </p>
     40  *
     41  * <p>
     42  * All instances of CameraMetadata are immutable. The list of keys with {@link #getKeys()}
     43  * never changes, nor do the values returned by any key with {@code #get} throughout
     44  * the lifetime of the object.
     45  * </p>
     46  *
     47  * @see CameraDevice
     48  * @see CameraManager
     49  * @see CameraCharacteristics
     50  **/
     51 public abstract class CameraMetadata<TKey> {
     52 
     53     private static final String TAG = "CameraMetadataAb";
     54     private static final boolean DEBUG = false;
     55     private CameraMetadataNative mNativeInstance = null;
     56 
     57     /**
     58      * Set a camera metadata field to a value. The field definitions can be
     59      * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
     60      * {@link CaptureRequest}.
     61      *
     62      * @param key The metadata field to write.
     63      * @param value The value to set the field to, which must be of a matching
     64      * type to the key.
     65      *
     66      * @hide
     67      */
     68     protected CameraMetadata() {
     69     }
     70 
     71     /**
     72      * Get a camera metadata field value.
     73      *
     74      * <p>The field definitions can be
     75      * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
     76      * {@link CaptureRequest}.</p>
     77      *
     78      * <p>Querying the value for the same key more than once will return a value
     79      * which is equal to the previous queried value.</p>
     80      *
     81      * @throws IllegalArgumentException if the key was not valid
     82      *
     83      * @param key The metadata field to read.
     84      * @return The value of that key, or {@code null} if the field is not set.
     85      *
     86      * @hide
     87      */
     88      protected abstract <T> T getProtected(TKey key);
     89 
     90      /**
     91       * @hide
     92       */
     93      protected void setNativeInstance(CameraMetadataNative nativeInstance) {
     94         mNativeInstance = nativeInstance;
     95      }
     96 
     97      /**
     98       * @hide
     99       */
    100      protected abstract Class<TKey> getKeyClass();
    101 
    102     /**
    103      * Returns a list of the keys contained in this map.
    104      *
    105      * <p>The list returned is not modifiable, so any attempts to modify it will throw
    106      * a {@code UnsupportedOperationException}.</p>
    107      *
    108      * <p>All values retrieved by a key from this list with {@code #get} are guaranteed to be
    109      * non-{@code null}. Each key is only listed once in the list. The order of the keys
    110      * is undefined.</p>
    111      *
    112      * @return List of the keys contained in this map.
    113      */
    114     @SuppressWarnings("unchecked")
    115     @NonNull
    116     public List<TKey> getKeys() {
    117         Class<CameraMetadata<TKey>> thisClass = (Class<CameraMetadata<TKey>>) getClass();
    118         return Collections.unmodifiableList(
    119                 getKeys(thisClass, getKeyClass(), this, /*filterTags*/null));
    120     }
    121 
    122     /**
    123      * Return a list of all the Key<?> that are declared as a field inside of the class
    124      * {@code type}.
    125      *
    126      * <p>
    127      * Optionally, if {@code instance} is not null, then filter out any keys with null values.
    128      * </p>
    129      *
    130      * <p>
    131      * Optionally, if {@code filterTags} is not {@code null}, then filter out any keys
    132      * whose native {@code tag} is not in {@code filterTags}. The {@code filterTags} array will be
    133      * sorted as a side effect.
    134      * </p>
    135      */
    136      /*package*/ @SuppressWarnings("unchecked")
    137     <TKey> ArrayList<TKey> getKeys(
    138              Class<?> type, Class<TKey> keyClass,
    139              CameraMetadata<TKey> instance,
    140              int[] filterTags) {
    141 
    142         if (DEBUG) Log.v(TAG, "getKeysStatic for " + type);
    143 
    144         // TotalCaptureResult does not have any of the keys on it, use CaptureResult instead
    145         if (type.equals(TotalCaptureResult.class)) {
    146             type = CaptureResult.class;
    147         }
    148 
    149         if (filterTags != null) {
    150             Arrays.sort(filterTags);
    151         }
    152 
    153         ArrayList<TKey> keyList = new ArrayList<TKey>();
    154 
    155         Field[] fields = type.getDeclaredFields();
    156         for (Field field : fields) {
    157             // Filter for Keys that are public
    158             if (field.getType().isAssignableFrom(keyClass) &&
    159                     (field.getModifiers() & Modifier.PUBLIC) != 0) {
    160 
    161                 TKey key;
    162                 try {
    163                     key = (TKey) field.get(instance);
    164                 } catch (IllegalAccessException e) {
    165                     throw new AssertionError("Can't get IllegalAccessException", e);
    166                 } catch (IllegalArgumentException e) {
    167                     throw new AssertionError("Can't get IllegalArgumentException", e);
    168                 }
    169 
    170                 if (instance == null || instance.getProtected(key) != null) {
    171                     if (shouldKeyBeAdded(key, field, filterTags)) {
    172                         keyList.add(key);
    173 
    174                         if (DEBUG) {
    175                             Log.v(TAG, "getKeysStatic - key was added - " + key);
    176                         }
    177                     } else if (DEBUG) {
    178                         Log.v(TAG, "getKeysStatic - key was filtered - " + key);
    179                     }
    180                 }
    181             }
    182         }
    183 
    184         if (null == mNativeInstance) {
    185             return keyList;
    186         }
    187 
    188         ArrayList<TKey> vendorKeys = mNativeInstance.getAllVendorKeys(keyClass);
    189 
    190         if (vendorKeys != null) {
    191             for (TKey k : vendorKeys) {
    192                 String keyName;
    193                 long vendorId;
    194                 if (k instanceof CaptureRequest.Key<?>) {
    195                     keyName = ((CaptureRequest.Key<?>) k).getName();
    196                     vendorId = ((CaptureRequest.Key<?>) k).getVendorId();
    197                 } else if (k instanceof CaptureResult.Key<?>) {
    198                     keyName = ((CaptureResult.Key<?>) k).getName();
    199                     vendorId = ((CaptureResult.Key<?>) k).getVendorId();
    200                 } else if (k instanceof CameraCharacteristics.Key<?>) {
    201                     keyName = ((CameraCharacteristics.Key<?>) k).getName();
    202                     vendorId = ((CameraCharacteristics.Key<?>) k).getVendorId();
    203                 } else {
    204                     continue;
    205                 }
    206 
    207                 if (filterTags == null || Arrays.binarySearch(filterTags,
    208                         CameraMetadataNative.getTag(keyName, vendorId)) >= 0) {
    209                     keyList.add(k);
    210                 }
    211             }
    212         }
    213 
    214         return keyList;
    215     }
    216 
    217     @SuppressWarnings("rawtypes")
    218     private static <TKey> boolean shouldKeyBeAdded(TKey key, Field field, int[] filterTags) {
    219         if (key == null) {
    220             throw new NullPointerException("key must not be null");
    221         }
    222 
    223         CameraMetadataNative.Key nativeKey;
    224 
    225         /*
    226          * Get the native key from the public api key
    227          */
    228         if (key instanceof CameraCharacteristics.Key) {
    229             nativeKey = ((CameraCharacteristics.Key)key).getNativeKey();
    230         } else if (key instanceof CaptureResult.Key) {
    231             nativeKey = ((CaptureResult.Key)key).getNativeKey();
    232         } else if (key instanceof CaptureRequest.Key) {
    233             nativeKey = ((CaptureRequest.Key)key).getNativeKey();
    234         } else {
    235             // Reject fields that aren't a key
    236             throw new IllegalArgumentException("key type must be that of a metadata key");
    237         }
    238 
    239         if (field.getAnnotation(PublicKey.class) == null) {
    240             // Never expose @hide keys up to the API user
    241             return false;
    242         }
    243 
    244         // No filtering necessary
    245         if (filterTags == null) {
    246             return true;
    247         }
    248 
    249         if (field.getAnnotation(SyntheticKey.class) != null) {
    250             // This key is synthetic, so calling #getTag will throw IAE
    251 
    252             // TODO: don't just assume all public+synthetic keys are always available
    253             return true;
    254         }
    255 
    256         /*
    257          * Regular key: look up it's native tag and see if it's in filterTags
    258          */
    259 
    260         int keyTag = nativeKey.getTag();
    261 
    262         // non-negative result is returned iff the value is in the array
    263         return Arrays.binarySearch(filterTags, keyTag) >= 0;
    264     }
    265 
    266     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
    267      * The enum values below this point are generated from metadata
    268      * definitions in /system/media/camera/docs. Do not modify by hand or
    269      * modify the comment blocks at the start or end.
    270      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
    271 
    272     //
    273     // Enumeration values for CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
    274     //
    275 
    276     /**
    277      * <p>The lens focus distance is not accurate, and the units used for
    278      * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} do not correspond to any physical units.</p>
    279      * <p>Setting the lens to the same focus distance on separate occasions may
    280      * result in a different real focus distance, depending on factors such
    281      * as the orientation of the device, the age of the focusing mechanism,
    282      * and the device temperature. The focus distance value will still be
    283      * in the range of <code>[0, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>, where 0
    284      * represents the farthest focus.</p>
    285      *
    286      * @see CaptureRequest#LENS_FOCUS_DISTANCE
    287      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
    288      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
    289      */
    290     public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED = 0;
    291 
    292     /**
    293      * <p>The lens focus distance is measured in diopters.</p>
    294      * <p>However, setting the lens to the same focus distance
    295      * on separate occasions may result in a different real
    296      * focus distance, depending on factors such as the
    297      * orientation of the device, the age of the focusing
    298      * mechanism, and the device temperature.</p>
    299      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
    300      */
    301     public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE = 1;
    302 
    303     /**
    304      * <p>The lens focus distance is measured in diopters, and
    305      * is calibrated.</p>
    306      * <p>The lens mechanism is calibrated so that setting the
    307      * same focus distance is repeatable on multiple
    308      * occasions with good accuracy, and the focus distance
    309      * corresponds to the real physical distance to the plane
    310      * of best focus.</p>
    311      * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
    312      */
    313     public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED = 2;
    314 
    315     //
    316     // Enumeration values for CameraCharacteristics#LENS_FACING
    317     //
    318 
    319     /**
    320      * <p>The camera device faces the same direction as the device's screen.</p>
    321      * @see CameraCharacteristics#LENS_FACING
    322      */
    323     public static final int LENS_FACING_FRONT = 0;
    324 
    325     /**
    326      * <p>The camera device faces the opposite direction as the device's screen.</p>
    327      * @see CameraCharacteristics#LENS_FACING
    328      */
    329     public static final int LENS_FACING_BACK = 1;
    330 
    331     /**
    332      * <p>The camera device is an external camera, and has no fixed facing relative to the
    333      * device's screen.</p>
    334      * @see CameraCharacteristics#LENS_FACING
    335      */
    336     public static final int LENS_FACING_EXTERNAL = 2;
    337 
    338     //
    339     // Enumeration values for CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    340     //
    341 
    342     /**
    343      * <p>The minimal set of capabilities that every camera
    344      * device (regardless of {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel})
    345      * supports.</p>
    346      * <p>This capability is listed by all normal devices, and
    347      * indicates that the camera device has a feature set
    348      * that's comparable to the baseline requirements for the
    349      * older android.hardware.Camera API.</p>
    350      * <p>Devices with the DEPTH_OUTPUT capability might not list this
    351      * capability, indicating that they support only depth measurement,
    352      * not standard color output.</p>
    353      *
    354      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    355      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    356      */
    357     public static final int REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0;
    358 
    359     /**
    360      * <p>The camera device can be manually controlled (3A algorithms such
    361      * as auto-exposure, and auto-focus can be bypassed).
    362      * The camera device supports basic manual control of the sensor image
    363      * acquisition related stages. This means the following controls are
    364      * guaranteed to be supported:</p>
    365      * <ul>
    366      * <li>Manual frame duration control<ul>
    367      * <li>{@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}</li>
    368      * <li>{@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}</li>
    369      * </ul>
    370      * </li>
    371      * <li>Manual exposure control<ul>
    372      * <li>{@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</li>
    373      * <li>{@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</li>
    374      * </ul>
    375      * </li>
    376      * <li>Manual sensitivity control<ul>
    377      * <li>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</li>
    378      * <li>{@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</li>
    379      * </ul>
    380      * </li>
    381      * <li>Manual lens control (if the lens is adjustable)<ul>
    382      * <li>android.lens.*</li>
    383      * </ul>
    384      * </li>
    385      * <li>Manual flash control (if a flash unit is present)<ul>
    386      * <li>android.flash.*</li>
    387      * </ul>
    388      * </li>
    389      * <li>Manual black level locking<ul>
    390      * <li>{@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock}</li>
    391      * </ul>
    392      * </li>
    393      * <li>Auto exposure lock<ul>
    394      * <li>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</li>
    395      * </ul>
    396      * </li>
    397      * </ul>
    398      * <p>If any of the above 3A algorithms are enabled, then the camera
    399      * device will accurately report the values applied by 3A in the
    400      * result.</p>
    401      * <p>A given camera device may also support additional manual sensor controls,
    402      * but this capability only covers the above list of controls.</p>
    403      * <p>If this is supported, {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} will
    404      * additionally return a min frame duration that is greater than
    405      * zero for each supported size-format combination.</p>
    406      *
    407      * @see CaptureRequest#BLACK_LEVEL_LOCK
    408      * @see CaptureRequest#CONTROL_AE_LOCK
    409      * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
    410      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
    411      * @see CaptureRequest#SENSOR_FRAME_DURATION
    412      * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
    413      * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
    414      * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
    415      * @see CaptureRequest#SENSOR_SENSITIVITY
    416      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    417      */
    418     public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1;
    419 
    420     /**
    421      * <p>The camera device post-processing stages can be manually controlled.
    422      * The camera device supports basic manual control of the image post-processing
    423      * stages. This means the following controls are guaranteed to be supported:</p>
    424      * <ul>
    425      * <li>
    426      * <p>Manual tonemap control</p>
    427      * <ul>
    428      * <li>{@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}</li>
    429      * <li>{@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</li>
    430      * <li>{@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</li>
    431      * <li>{@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma}</li>
    432      * <li>{@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve}</li>
    433      * </ul>
    434      * </li>
    435      * <li>
    436      * <p>Manual white balance control</p>
    437      * <ul>
    438      * <li>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}</li>
    439      * <li>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}</li>
    440      * </ul>
    441      * </li>
    442      * <li>Manual lens shading map control<ul>
    443      * <li>{@link CaptureRequest#SHADING_MODE android.shading.mode}</li>
    444      * <li>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</li>
    445      * <li>android.statistics.lensShadingMap</li>
    446      * <li>android.lens.info.shadingMapSize</li>
    447      * </ul>
    448      * </li>
    449      * <li>Manual aberration correction control (if aberration correction is supported)<ul>
    450      * <li>{@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</li>
    451      * <li>{@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</li>
    452      * </ul>
    453      * </li>
    454      * <li>Auto white balance lock<ul>
    455      * <li>{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</li>
    456      * </ul>
    457      * </li>
    458      * </ul>
    459      * <p>If auto white balance is enabled, then the camera device
    460      * will accurately report the values applied by AWB in the result.</p>
    461      * <p>A given camera device may also support additional post-processing
    462      * controls, but this capability only covers the above list of controls.</p>
    463      *
    464      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
    465      * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
    466      * @see CaptureRequest#COLOR_CORRECTION_GAINS
    467      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
    468      * @see CaptureRequest#CONTROL_AWB_LOCK
    469      * @see CaptureRequest#SHADING_MODE
    470      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
    471      * @see CaptureRequest#TONEMAP_CURVE
    472      * @see CaptureRequest#TONEMAP_GAMMA
    473      * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
    474      * @see CaptureRequest#TONEMAP_MODE
    475      * @see CaptureRequest#TONEMAP_PRESET_CURVE
    476      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    477      */
    478     public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2;
    479 
    480     /**
    481      * <p>The camera device supports outputting RAW buffers and
    482      * metadata for interpreting them.</p>
    483      * <p>Devices supporting the RAW capability allow both for
    484      * saving DNG files, and for direct application processing of
    485      * raw sensor images.</p>
    486      * <ul>
    487      * <li>RAW_SENSOR is supported as an output format.</li>
    488      * <li>The maximum available resolution for RAW_SENSOR streams
    489      *   will match either the value in
    490      *   {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize} or
    491      *   {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}.</li>
    492      * <li>All DNG-related optional metadata entries are provided
    493      *   by the camera device.</li>
    494      * </ul>
    495      *
    496      * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
    497      * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
    498      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    499      */
    500     public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3;
    501 
    502     /**
    503      * <p>The camera device supports the Zero Shutter Lag reprocessing use case.</p>
    504      * <ul>
    505      * <li>One input stream is supported, that is, <code>{@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} == 1</code>.</li>
    506      * <li>{@link android.graphics.ImageFormat#PRIVATE } is supported as an output/input format,
    507      *   that is, {@link android.graphics.ImageFormat#PRIVATE } is included in the lists of
    508      *   formats returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats } and {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputFormats }.</li>
    509      * <li>{@link android.hardware.camera2.params.StreamConfigurationMap#getValidOutputFormatsForInput }
    510      *   returns non empty int[] for each supported input format returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats }.</li>
    511      * <li>Each size returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputSizes getInputSizes(ImageFormat.PRIVATE)} is also included in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes getOutputSizes(ImageFormat.PRIVATE)}</li>
    512      * <li>Using {@link android.graphics.ImageFormat#PRIVATE } does not cause a frame rate drop
    513      *   relative to the sensor's maximum capture rate (at that resolution).</li>
    514      * <li>{@link android.graphics.ImageFormat#PRIVATE } will be reprocessable into both
    515      *   {@link android.graphics.ImageFormat#YUV_420_888 } and
    516      *   {@link android.graphics.ImageFormat#JPEG } formats.</li>
    517      * <li>The maximum available resolution for PRIVATE streams
    518      *   (both input/output) will match the maximum available
    519      *   resolution of JPEG streams.</li>
    520      * <li>Static metadata {@link CameraCharacteristics#REPROCESS_MAX_CAPTURE_STALL android.reprocess.maxCaptureStall}.</li>
    521      * <li>Only below controls are effective for reprocessing requests and
    522      *   will be present in capture results, other controls in reprocess
    523      *   requests will be ignored by the camera device.<ul>
    524      * <li>android.jpeg.*</li>
    525      * <li>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</li>
    526      * <li>{@link CaptureRequest#EDGE_MODE android.edge.mode}</li>
    527      * </ul>
    528      * </li>
    529      * <li>{@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} and
    530      *   {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes} will both list ZERO_SHUTTER_LAG as a supported mode.</li>
    531      * </ul>
    532      *
    533      * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
    534      * @see CaptureRequest#EDGE_MODE
    535      * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
    536      * @see CaptureRequest#NOISE_REDUCTION_MODE
    537      * @see CameraCharacteristics#REPROCESS_MAX_CAPTURE_STALL
    538      * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
    539      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    540      */
    541     public static final int REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING = 4;
    542 
    543     /**
    544      * <p>The camera device supports accurately reporting the sensor settings for many of
    545      * the sensor controls while the built-in 3A algorithm is running.  This allows
    546      * reporting of sensor settings even when these settings cannot be manually changed.</p>
    547      * <p>The values reported for the following controls are guaranteed to be available
    548      * in the CaptureResult, including when 3A is enabled:</p>
    549      * <ul>
    550      * <li>Exposure control<ul>
    551      * <li>{@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</li>
    552      * </ul>
    553      * </li>
    554      * <li>Sensitivity control<ul>
    555      * <li>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</li>
    556      * </ul>
    557      * </li>
    558      * <li>Lens controls (if the lens is adjustable)<ul>
    559      * <li>{@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}</li>
    560      * <li>{@link CaptureRequest#LENS_APERTURE android.lens.aperture}</li>
    561      * </ul>
    562      * </li>
    563      * </ul>
    564      * <p>This capability is a subset of the MANUAL_SENSOR control capability, and will
    565      * always be included if the MANUAL_SENSOR capability is available.</p>
    566      *
    567      * @see CaptureRequest#LENS_APERTURE
    568      * @see CaptureRequest#LENS_FOCUS_DISTANCE
    569      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
    570      * @see CaptureRequest#SENSOR_SENSITIVITY
    571      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    572      */
    573     public static final int REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5;
    574 
    575     /**
    576      * <p>The camera device supports capturing high-resolution images at &gt;= 20 frames per
    577      * second, in at least the uncompressed YUV format, when post-processing settings are set
    578      * to FAST. Additionally, maximum-resolution images can be captured at &gt;= 10 frames
    579      * per second.  Here, 'high resolution' means at least 8 megapixels, or the maximum
    580      * resolution of the device, whichever is smaller.</p>
    581      * <p>More specifically, this means that a size matching the camera device's active array
    582      * size is listed as a supported size for the {@link android.graphics.ImageFormat#YUV_420_888 } format in either {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes } or {@link android.hardware.camera2.params.StreamConfigurationMap#getHighResolutionOutputSizes },
    583      * with a minimum frame duration for that format and size of either &lt;= 1/20 s, or
    584      * &lt;= 1/10 s, respectively; and the {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges} entry
    585      * lists at least one FPS range where the minimum FPS is &gt;= 1 / minimumFrameDuration
    586      * for the maximum-size YUV_420_888 format.  If that maximum size is listed in {@link android.hardware.camera2.params.StreamConfigurationMap#getHighResolutionOutputSizes },
    587      * then the list of resolutions for YUV_420_888 from {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes } contains at
    588      * least one resolution &gt;= 8 megapixels, with a minimum frame duration of &lt;= 1/20
    589      * s.</p>
    590      * <p>If the device supports the {@link android.graphics.ImageFormat#RAW10 }, {@link android.graphics.ImageFormat#RAW12 }, then those can also be captured at the same rate
    591      * as the maximum-size YUV_420_888 resolution is.</p>
    592      * <p>If the device supports the PRIVATE_REPROCESSING capability, then the same guarantees
    593      * as for the YUV_420_888 format also apply to the {@link android.graphics.ImageFormat#PRIVATE } format.</p>
    594      * <p>In addition, the {@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} field is guaranted to have a value between 0
    595      * and 4, inclusive. {@link CameraCharacteristics#CONTROL_AE_LOCK_AVAILABLE android.control.aeLockAvailable} and {@link CameraCharacteristics#CONTROL_AWB_LOCK_AVAILABLE android.control.awbLockAvailable}
    596      * are also guaranteed to be <code>true</code> so burst capture with these two locks ON yields
    597      * consistent image output.</p>
    598      *
    599      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
    600      * @see CameraCharacteristics#CONTROL_AE_LOCK_AVAILABLE
    601      * @see CameraCharacteristics#CONTROL_AWB_LOCK_AVAILABLE
    602      * @see CameraCharacteristics#SYNC_MAX_LATENCY
    603      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    604      */
    605     public static final int REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6;
    606 
    607     /**
    608      * <p>The camera device supports the YUV_420_888 reprocessing use case, similar as
    609      * PRIVATE_REPROCESSING, This capability requires the camera device to support the
    610      * following:</p>
    611      * <ul>
    612      * <li>One input stream is supported, that is, <code>{@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} == 1</code>.</li>
    613      * <li>{@link android.graphics.ImageFormat#YUV_420_888 } is supported as an output/input format, that is,
    614      *   YUV_420_888 is included in the lists of formats returned by
    615      *   {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats } and
    616      *   {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputFormats }.</li>
    617      * <li>{@link android.hardware.camera2.params.StreamConfigurationMap#getValidOutputFormatsForInput }
    618      *   returns non-empty int[] for each supported input format returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats }.</li>
    619      * <li>Each size returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputSizes getInputSizes(YUV_420_888)} is also included in {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes getOutputSizes(YUV_420_888)}</li>
    620      * <li>Using {@link android.graphics.ImageFormat#YUV_420_888 } does not cause a frame rate drop
    621      *   relative to the sensor's maximum capture rate (at that resolution).</li>
    622      * <li>{@link android.graphics.ImageFormat#YUV_420_888 } will be reprocessable into both
    623      *   {@link android.graphics.ImageFormat#YUV_420_888 } and {@link android.graphics.ImageFormat#JPEG } formats.</li>
    624      * <li>The maximum available resolution for {@link android.graphics.ImageFormat#YUV_420_888 } streams (both input/output) will match the
    625      *   maximum available resolution of {@link android.graphics.ImageFormat#JPEG } streams.</li>
    626      * <li>Static metadata {@link CameraCharacteristics#REPROCESS_MAX_CAPTURE_STALL android.reprocess.maxCaptureStall}.</li>
    627      * <li>Only the below controls are effective for reprocessing requests and will be present
    628      *   in capture results. The reprocess requests are from the original capture results that
    629      *   are associated with the intermediate {@link android.graphics.ImageFormat#YUV_420_888 }
    630      *   output buffers.  All other controls in the reprocess requests will be ignored by the
    631      *   camera device.<ul>
    632      * <li>android.jpeg.*</li>
    633      * <li>{@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</li>
    634      * <li>{@link CaptureRequest#EDGE_MODE android.edge.mode}</li>
    635      * <li>{@link CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR android.reprocess.effectiveExposureFactor}</li>
    636      * </ul>
    637      * </li>
    638      * <li>{@link CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES android.noiseReduction.availableNoiseReductionModes} and
    639      *   {@link CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES android.edge.availableEdgeModes} will both list ZERO_SHUTTER_LAG as a supported mode.</li>
    640      * </ul>
    641      *
    642      * @see CameraCharacteristics#EDGE_AVAILABLE_EDGE_MODES
    643      * @see CaptureRequest#EDGE_MODE
    644      * @see CameraCharacteristics#NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES
    645      * @see CaptureRequest#NOISE_REDUCTION_MODE
    646      * @see CaptureRequest#REPROCESS_EFFECTIVE_EXPOSURE_FACTOR
    647      * @see CameraCharacteristics#REPROCESS_MAX_CAPTURE_STALL
    648      * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
    649      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    650      */
    651     public static final int REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING = 7;
    652 
    653     /**
    654      * <p>The camera device can produce depth measurements from its field of view.</p>
    655      * <p>This capability requires the camera device to support the following:</p>
    656      * <ul>
    657      * <li>{@link android.graphics.ImageFormat#DEPTH16 } is supported as an output format.</li>
    658      * <li>{@link android.graphics.ImageFormat#DEPTH_POINT_CLOUD } is optionally supported as an
    659      *   output format.</li>
    660      * <li>This camera device, and all camera devices with the same {@link CameraCharacteristics#LENS_FACING android.lens.facing},
    661      *   will list the following calibration entries in both
    662      *   {@link android.hardware.camera2.CameraCharacteristics } and
    663      *   {@link android.hardware.camera2.CaptureResult }:<ul>
    664      * <li>{@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}</li>
    665      * <li>{@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}</li>
    666      * <li>{@link CameraCharacteristics#LENS_INTRINSIC_CALIBRATION android.lens.intrinsicCalibration}</li>
    667      * <li>{@link CameraCharacteristics#LENS_RADIAL_DISTORTION android.lens.radialDistortion}</li>
    668      * </ul>
    669      * </li>
    670      * <li>The {@link CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE android.depth.depthIsExclusive} entry is listed by this device.</li>
    671      * <li>A LIMITED camera with only the DEPTH_OUTPUT capability does not have to support
    672      *   normal YUV_420_888, JPEG, and PRIV-format outputs. It only has to support the DEPTH16
    673      *   format.</li>
    674      * </ul>
    675      * <p>Generally, depth output operates at a slower frame rate than standard color capture,
    676      * so the DEPTH16 and DEPTH_POINT_CLOUD formats will commonly have a stall duration that
    677      * should be accounted for (see
    678      * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration }).
    679      * On a device that supports both depth and color-based output, to enable smooth preview,
    680      * using a repeating burst is recommended, where a depth-output target is only included
    681      * once every N frames, where N is the ratio between preview output rate and depth output
    682      * rate, including depth stall time.</p>
    683      *
    684      * @see CameraCharacteristics#DEPTH_DEPTH_IS_EXCLUSIVE
    685      * @see CameraCharacteristics#LENS_FACING
    686      * @see CameraCharacteristics#LENS_INTRINSIC_CALIBRATION
    687      * @see CameraCharacteristics#LENS_POSE_ROTATION
    688      * @see CameraCharacteristics#LENS_POSE_TRANSLATION
    689      * @see CameraCharacteristics#LENS_RADIAL_DISTORTION
    690      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    691      */
    692     public static final int REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT = 8;
    693 
    694     /**
    695      * <p>The device supports constrained high speed video recording (frame rate &gt;=120fps)
    696      * use case. The camera device will support high speed capture session created by
    697      * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }, which
    698      * only accepts high speed request lists created by
    699      * {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }.</p>
    700      * <p>A camera device can still support high speed video streaming by advertising the high speed
    701      * FPS ranges in {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges}. For this case, all normal
    702      * capture request per frame control and synchronization requirements will apply to
    703      * the high speed fps ranges, the same as all other fps ranges. This capability describes
    704      * the capability of a specialized operating mode with many limitations (see below), which
    705      * is only targeted at high speed video recording.</p>
    706      * <p>The supported high speed video sizes and fps ranges are specified in
    707      * {@link android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoFpsRanges }.
    708      * To get desired output frame rates, the application is only allowed to select video size
    709      * and FPS range combinations provided by
    710      * {@link android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoSizes }.
    711      * The fps range can be controlled via {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}.</p>
    712      * <p>In this capability, the camera device will override aeMode, awbMode, and afMode to
    713      * ON, AUTO, and CONTINUOUS_VIDEO, respectively. All post-processing block mode
    714      * controls will be overridden to be FAST. Therefore, no manual control of capture
    715      * and post-processing parameters is possible. All other controls operate the
    716      * same as when {@link CaptureRequest#CONTROL_MODE android.control.mode} == AUTO. This means that all other
    717      * android.control.* fields continue to work, such as</p>
    718      * <ul>
    719      * <li>{@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}</li>
    720      * <li>{@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}</li>
    721      * <li>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</li>
    722      * <li>{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</li>
    723      * <li>{@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</li>
    724      * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li>
    725      * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li>
    726      * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li>
    727      * <li>{@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}</li>
    728      * <li>{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}</li>
    729      * </ul>
    730      * <p>Outside of android.control.*, the following controls will work:</p>
    731      * <ul>
    732      * <li>{@link CaptureRequest#FLASH_MODE android.flash.mode} (TORCH mode only, automatic flash for still capture will not
    733      * work since aeMode is ON)</li>
    734      * <li>{@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} (if it is supported)</li>
    735      * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li>
    736      * <li>{@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} (if it is supported)</li>
    737      * </ul>
    738      * <p>For high speed recording use case, the actual maximum supported frame rate may
    739      * be lower than what camera can output, depending on the destination Surfaces for
    740      * the image data. For example, if the destination surface is from video encoder,
    741      * the application need check if the video encoder is capable of supporting the
    742      * high frame rate for a given video size, or it will end up with lower recording
    743      * frame rate. If the destination surface is from preview window, the actual preview frame
    744      * rate will be bounded by the screen refresh rate.</p>
    745      * <p>The camera device will only support up to 2 high speed simultaneous output surfaces
    746      * (preview and recording surfaces)
    747      * in this mode. Above controls will be effective only if all of below conditions are true:</p>
    748      * <ul>
    749      * <li>The application creates a camera capture session with no more than 2 surfaces via
    750      * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }. The
    751      * targeted surfaces must be preview surface (either from
    752      * {@link android.view.SurfaceView } or {@link android.graphics.SurfaceTexture }) or
    753      * recording surface(either from {@link android.media.MediaRecorder#getSurface } or
    754      * {@link android.media.MediaCodec#createInputSurface }).</li>
    755      * <li>The stream sizes are selected from the sizes reported by
    756      * {@link android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoSizes }.</li>
    757      * <li>The FPS ranges are selected from
    758      * {@link android.hardware.camera2.params.StreamConfigurationMap#getHighSpeedVideoFpsRanges }.</li>
    759      * </ul>
    760      * <p>When above conditions are NOT satistied,
    761      * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }
    762      * will fail.</p>
    763      * <p>Switching to a FPS range that has different maximum FPS may trigger some camera device
    764      * reconfigurations, which may introduce extra latency. It is recommended that
    765      * the application avoids unnecessary maximum target FPS changes as much as possible
    766      * during high speed streaming.</p>
    767      *
    768      * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
    769      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
    770      * @see CaptureRequest#CONTROL_AE_LOCK
    771      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
    772      * @see CaptureRequest#CONTROL_AE_REGIONS
    773      * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
    774      * @see CaptureRequest#CONTROL_AF_REGIONS
    775      * @see CaptureRequest#CONTROL_AF_TRIGGER
    776      * @see CaptureRequest#CONTROL_AWB_LOCK
    777      * @see CaptureRequest#CONTROL_AWB_REGIONS
    778      * @see CaptureRequest#CONTROL_EFFECT_MODE
    779      * @see CaptureRequest#CONTROL_MODE
    780      * @see CaptureRequest#FLASH_MODE
    781      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
    782      * @see CaptureRequest#SCALER_CROP_REGION
    783      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
    784      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
    785      */
    786     public static final int REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO = 9;
    787 
    788     //
    789     // Enumeration values for CameraCharacteristics#SCALER_CROPPING_TYPE
    790     //
    791 
    792     /**
    793      * <p>The camera device only supports centered crop regions.</p>
    794      * @see CameraCharacteristics#SCALER_CROPPING_TYPE
    795      */
    796     public static final int SCALER_CROPPING_TYPE_CENTER_ONLY = 0;
    797 
    798     /**
    799      * <p>The camera device supports arbitrarily chosen crop regions.</p>
    800      * @see CameraCharacteristics#SCALER_CROPPING_TYPE
    801      */
    802     public static final int SCALER_CROPPING_TYPE_FREEFORM = 1;
    803 
    804     //
    805     // Enumeration values for CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
    806     //
    807 
    808     /**
    809      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
    810      */
    811     public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB = 0;
    812 
    813     /**
    814      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
    815      */
    816     public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1;
    817 
    818     /**
    819      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
    820      */
    821     public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG = 2;
    822 
    823     /**
    824      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
    825      */
    826     public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3;
    827 
    828     /**
    829      * <p>Sensor is not Bayer; output has 3 16-bit
    830      * values for each pixel, instead of just 1 16-bit value
    831      * per pixel.</p>
    832      * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
    833      */
    834     public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4;
    835 
    836     //
    837     // Enumeration values for CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
    838     //
    839 
    840     /**
    841      * <p>Timestamps from {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} are in nanoseconds and monotonic,
    842      * but can not be compared to timestamps from other subsystems
    843      * (e.g. accelerometer, gyro etc.), or other instances of the same or different
    844      * camera devices in the same system. Timestamps between streams and results for
    845      * a single camera instance are comparable, and the timestamps for all buffers
    846      * and the result metadata generated by a single capture are identical.</p>
    847      *
    848      * @see CaptureResult#SENSOR_TIMESTAMP
    849      * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
    850      */
    851     public static final int SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN = 0;
    852 
    853     /**
    854      * <p>Timestamps from {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} are in the same timebase as
    855      * {@link android.os.SystemClock#elapsedRealtimeNanos },
    856      * and they can be compared to other timestamps using that base.</p>
    857      *
    858      * @see CaptureResult#SENSOR_TIMESTAMP
    859      * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
    860      */
    861     public static final int SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME = 1;
    862 
    863     //
    864     // Enumeration values for CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    865     //
    866 
    867     /**
    868      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    869      */
    870     public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1;
    871 
    872     /**
    873      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    874      */
    875     public static final int SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2;
    876 
    877     /**
    878      * <p>Incandescent light</p>
    879      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    880      */
    881     public static final int SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3;
    882 
    883     /**
    884      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    885      */
    886     public static final int SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4;
    887 
    888     /**
    889      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    890      */
    891     public static final int SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9;
    892 
    893     /**
    894      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    895      */
    896     public static final int SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10;
    897 
    898     /**
    899      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    900      */
    901     public static final int SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11;
    902 
    903     /**
    904      * <p>D 5700 - 7100K</p>
    905      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    906      */
    907     public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12;
    908 
    909     /**
    910      * <p>N 4600 - 5400K</p>
    911      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    912      */
    913     public static final int SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13;
    914 
    915     /**
    916      * <p>W 3900 - 4500K</p>
    917      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    918      */
    919     public static final int SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14;
    920 
    921     /**
    922      * <p>WW 3200 - 3700K</p>
    923      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    924      */
    925     public static final int SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15;
    926 
    927     /**
    928      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    929      */
    930     public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17;
    931 
    932     /**
    933      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    934      */
    935     public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18;
    936 
    937     /**
    938      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    939      */
    940     public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19;
    941 
    942     /**
    943      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    944      */
    945     public static final int SENSOR_REFERENCE_ILLUMINANT1_D55 = 20;
    946 
    947     /**
    948      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    949      */
    950     public static final int SENSOR_REFERENCE_ILLUMINANT1_D65 = 21;
    951 
    952     /**
    953      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    954      */
    955     public static final int SENSOR_REFERENCE_ILLUMINANT1_D75 = 22;
    956 
    957     /**
    958      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    959      */
    960     public static final int SENSOR_REFERENCE_ILLUMINANT1_D50 = 23;
    961 
    962     /**
    963      * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
    964      */
    965     public static final int SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24;
    966 
    967     //
    968     // Enumeration values for CameraCharacteristics#LED_AVAILABLE_LEDS
    969     //
    970 
    971     /**
    972      * <p>android.led.transmit control is used.</p>
    973      * @see CameraCharacteristics#LED_AVAILABLE_LEDS
    974      * @hide
    975      */
    976     public static final int LED_AVAILABLE_LEDS_TRANSMIT = 0;
    977 
    978     //
    979     // Enumeration values for CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    980     //
    981 
    982     /**
    983      * <p>This camera device does not have enough capabilities to qualify as a <code>FULL</code> device or
    984      * better.</p>
    985      * <p>Only the stream configurations listed in the <code>LEGACY</code> and <code>LIMITED</code> tables in the
    986      * {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession} documentation are guaranteed to be supported.</p>
    987      * <p>All <code>LIMITED</code> devices support the <code>BACKWARDS_COMPATIBLE</code> capability, indicating basic
    988      * support for color image capture. The only exception is that the device may
    989      * alternatively support only the <code>DEPTH_OUTPUT</code> capability, if it can only output depth
    990      * measurements and not color images.</p>
    991      * <p><code>LIMITED</code> devices and above require the use of {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}
    992      * to lock exposure metering (and calculate flash power, for cameras with flash) before
    993      * capturing a high-quality still image.</p>
    994      * <p>A <code>LIMITED</code> device that only lists the <code>BACKWARDS_COMPATIBLE</code> capability is only
    995      * required to support full-automatic operation and post-processing (<code>OFF</code> is not
    996      * supported for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}, {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}, or
    997      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode})</p>
    998      * <p>Additional capabilities may optionally be supported by a <code>LIMITED</code>-level device, and
    999      * can be checked for in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
   1000      *
   1001      * @see CaptureRequest#CONTROL_AE_MODE
   1002      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1003      * @see CaptureRequest#CONTROL_AF_MODE
   1004      * @see CaptureRequest#CONTROL_AWB_MODE
   1005      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1006      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1007      */
   1008     public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0;
   1009 
   1010     /**
   1011      * <p>This camera device is capable of supporting advanced imaging applications.</p>
   1012      * <p>The stream configurations listed in the <code>FULL</code>, <code>LEGACY</code> and <code>LIMITED</code> tables in the
   1013      * {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession} documentation are guaranteed to be supported.</p>
   1014      * <p>A <code>FULL</code> device will support below capabilities:</p>
   1015      * <ul>
   1016      * <li><code>BURST_CAPTURE</code> capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
   1017      *   <code>BURST_CAPTURE</code>)</li>
   1018      * <li>Per frame control ({@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} <code>==</code> PER_FRAME_CONTROL)</li>
   1019      * <li>Manual sensor control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains <code>MANUAL_SENSOR</code>)</li>
   1020      * <li>Manual post-processing control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
   1021      *   <code>MANUAL_POST_PROCESSING</code>)</li>
   1022      * <li>The required exposure time range defined in {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</li>
   1023      * <li>The required maxFrameDuration defined in {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}</li>
   1024      * </ul>
   1025      * <p>Note:
   1026      * Pre-API level 23, FULL devices also supported arbitrary cropping region
   1027      * ({@link CameraCharacteristics#SCALER_CROPPING_TYPE android.scaler.croppingType} <code>== FREEFORM</code>); this requirement was relaxed in API level
   1028      * 23, and <code>FULL</code> devices may only support <code>CENTERED</code> cropping.</p>
   1029      *
   1030      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1031      * @see CameraCharacteristics#SCALER_CROPPING_TYPE
   1032      * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
   1033      * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
   1034      * @see CameraCharacteristics#SYNC_MAX_LATENCY
   1035      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1036      */
   1037     public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1;
   1038 
   1039     /**
   1040      * <p>This camera device is running in backward compatibility mode.</p>
   1041      * <p>Only the stream configurations listed in the <code>LEGACY</code> table in the {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession}
   1042      * documentation are supported.</p>
   1043      * <p>A <code>LEGACY</code> device does not support per-frame control, manual sensor control, manual
   1044      * post-processing, arbitrary cropping regions, and has relaxed performance constraints.
   1045      * No additional capabilities beyond <code>BACKWARD_COMPATIBLE</code> will ever be listed by a
   1046      * <code>LEGACY</code> device in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
   1047      * <p>In addition, the {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} is not functional on <code>LEGACY</code>
   1048      * devices. Instead, every request that includes a JPEG-format output target is treated
   1049      * as triggering a still capture, internally executing a precapture trigger.  This may
   1050      * fire the flash for flash power metering during precapture, and then fire the flash
   1051      * for the final capture, if a flash is available on the device and the AE mode is set to
   1052      * enable the flash.</p>
   1053      *
   1054      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1055      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1056      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1057      */
   1058     public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY = 2;
   1059 
   1060     /**
   1061      * <p>This camera device is capable of YUV reprocessing and RAW data capture, in addition to
   1062      * FULL-level capabilities.</p>
   1063      * <p>The stream configurations listed in the <code>LEVEL_3</code>, <code>RAW</code>, <code>FULL</code>, <code>LEGACY</code> and
   1064      * <code>LIMITED</code> tables in the {@link android.hardware.camera2.CameraDevice#createCaptureSession createCaptureSession}
   1065      * documentation are guaranteed to be supported.</p>
   1066      * <p>The following additional capabilities are guaranteed to be supported:</p>
   1067      * <ul>
   1068      * <li><code>YUV_REPROCESSING</code> capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
   1069      *   <code>YUV_REPROCESSING</code>)</li>
   1070      * <li><code>RAW</code> capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
   1071      *   <code>RAW</code>)</li>
   1072      * </ul>
   1073      *
   1074      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   1075      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
   1076      */
   1077     public static final int INFO_SUPPORTED_HARDWARE_LEVEL_3 = 3;
   1078 
   1079     //
   1080     // Enumeration values for CameraCharacteristics#SYNC_MAX_LATENCY
   1081     //
   1082 
   1083     /**
   1084      * <p>Every frame has the requests immediately applied.</p>
   1085      * <p>Changing controls over multiple requests one after another will
   1086      * produce results that have those controls applied atomically
   1087      * each frame.</p>
   1088      * <p>All FULL capability devices will have this as their maxLatency.</p>
   1089      * @see CameraCharacteristics#SYNC_MAX_LATENCY
   1090      */
   1091     public static final int SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0;
   1092 
   1093     /**
   1094      * <p>Each new frame has some subset (potentially the entire set)
   1095      * of the past requests applied to the camera settings.</p>
   1096      * <p>By submitting a series of identical requests, the camera device
   1097      * will eventually have the camera settings applied, but it is
   1098      * unknown when that exact point will be.</p>
   1099      * <p>All LEGACY capability devices will have this as their maxLatency.</p>
   1100      * @see CameraCharacteristics#SYNC_MAX_LATENCY
   1101      */
   1102     public static final int SYNC_MAX_LATENCY_UNKNOWN = -1;
   1103 
   1104     //
   1105     // Enumeration values for CaptureRequest#COLOR_CORRECTION_MODE
   1106     //
   1107 
   1108     /**
   1109      * <p>Use the {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} matrix
   1110      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} to do color conversion.</p>
   1111      * <p>All advanced white balance adjustments (not specified
   1112      * by our white balance pipeline) must be disabled.</p>
   1113      * <p>If AWB is enabled with <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != OFF</code>, then
   1114      * TRANSFORM_MATRIX is ignored. The camera device will override
   1115      * this value to either FAST or HIGH_QUALITY.</p>
   1116      *
   1117      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1118      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1119      * @see CaptureRequest#CONTROL_AWB_MODE
   1120      * @see CaptureRequest#COLOR_CORRECTION_MODE
   1121      */
   1122     public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0;
   1123 
   1124     /**
   1125      * <p>Color correction processing must not slow down
   1126      * capture rate relative to sensor raw output.</p>
   1127      * <p>Advanced white balance adjustments above and beyond
   1128      * the specified white balance pipeline may be applied.</p>
   1129      * <p>If AWB is enabled with <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != OFF</code>, then
   1130      * the camera device uses the last frame's AWB values
   1131      * (or defaults if AWB has never been run).</p>
   1132      *
   1133      * @see CaptureRequest#CONTROL_AWB_MODE
   1134      * @see CaptureRequest#COLOR_CORRECTION_MODE
   1135      */
   1136     public static final int COLOR_CORRECTION_MODE_FAST = 1;
   1137 
   1138     /**
   1139      * <p>Color correction processing operates at improved
   1140      * quality but the capture rate might be reduced (relative to sensor
   1141      * raw output rate)</p>
   1142      * <p>Advanced white balance adjustments above and beyond
   1143      * the specified white balance pipeline may be applied.</p>
   1144      * <p>If AWB is enabled with <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != OFF</code>, then
   1145      * the camera device uses the last frame's AWB values
   1146      * (or defaults if AWB has never been run).</p>
   1147      *
   1148      * @see CaptureRequest#CONTROL_AWB_MODE
   1149      * @see CaptureRequest#COLOR_CORRECTION_MODE
   1150      */
   1151     public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2;
   1152 
   1153     //
   1154     // Enumeration values for CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
   1155     //
   1156 
   1157     /**
   1158      * <p>No aberration correction is applied.</p>
   1159      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
   1160      */
   1161     public static final int COLOR_CORRECTION_ABERRATION_MODE_OFF = 0;
   1162 
   1163     /**
   1164      * <p>Aberration correction will not slow down capture rate
   1165      * relative to sensor raw output.</p>
   1166      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
   1167      */
   1168     public static final int COLOR_CORRECTION_ABERRATION_MODE_FAST = 1;
   1169 
   1170     /**
   1171      * <p>Aberration correction operates at improved quality but the capture rate might be
   1172      * reduced (relative to sensor raw output rate)</p>
   1173      * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
   1174      */
   1175     public static final int COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY = 2;
   1176 
   1177     //
   1178     // Enumeration values for CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
   1179     //
   1180 
   1181     /**
   1182      * <p>The camera device will not adjust exposure duration to
   1183      * avoid banding problems.</p>
   1184      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
   1185      */
   1186     public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0;
   1187 
   1188     /**
   1189      * <p>The camera device will adjust exposure duration to
   1190      * avoid banding problems with 50Hz illumination sources.</p>
   1191      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
   1192      */
   1193     public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1;
   1194 
   1195     /**
   1196      * <p>The camera device will adjust exposure duration to
   1197      * avoid banding problems with 60Hz illumination
   1198      * sources.</p>
   1199      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
   1200      */
   1201     public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2;
   1202 
   1203     /**
   1204      * <p>The camera device will automatically adapt its
   1205      * antibanding routine to the current illumination
   1206      * condition. This is the default mode if AUTO is
   1207      * available on given camera device.</p>
   1208      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
   1209      */
   1210     public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3;
   1211 
   1212     //
   1213     // Enumeration values for CaptureRequest#CONTROL_AE_MODE
   1214     //
   1215 
   1216     /**
   1217      * <p>The camera device's autoexposure routine is disabled.</p>
   1218      * <p>The application-selected {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
   1219      * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} and
   1220      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} are used by the camera
   1221      * device, along with android.flash.* fields, if there's
   1222      * a flash unit for this camera device.</p>
   1223      * <p>Note that auto-white balance (AWB) and auto-focus (AF)
   1224      * behavior is device dependent when AE is in OFF mode.
   1225      * To have consistent behavior across different devices,
   1226      * it is recommended to either set AWB and AF to OFF mode
   1227      * or lock AWB and AF before setting AE to OFF.
   1228      * See {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode},
   1229      * {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}, and {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
   1230      * for more details.</p>
   1231      * <p>LEGACY devices do not support the OFF mode and will
   1232      * override attempts to use this value to ON.</p>
   1233      *
   1234      * @see CaptureRequest#CONTROL_AF_MODE
   1235      * @see CaptureRequest#CONTROL_AF_TRIGGER
   1236      * @see CaptureRequest#CONTROL_AWB_LOCK
   1237      * @see CaptureRequest#CONTROL_AWB_MODE
   1238      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
   1239      * @see CaptureRequest#SENSOR_FRAME_DURATION
   1240      * @see CaptureRequest#SENSOR_SENSITIVITY
   1241      * @see CaptureRequest#CONTROL_AE_MODE
   1242      */
   1243     public static final int CONTROL_AE_MODE_OFF = 0;
   1244 
   1245     /**
   1246      * <p>The camera device's autoexposure routine is active,
   1247      * with no flash control.</p>
   1248      * <p>The application's values for
   1249      * {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
   1250      * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
   1251      * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} are ignored. The
   1252      * application has control over the various
   1253      * android.flash.* fields.</p>
   1254      *
   1255      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
   1256      * @see CaptureRequest#SENSOR_FRAME_DURATION
   1257      * @see CaptureRequest#SENSOR_SENSITIVITY
   1258      * @see CaptureRequest#CONTROL_AE_MODE
   1259      */
   1260     public static final int CONTROL_AE_MODE_ON = 1;
   1261 
   1262     /**
   1263      * <p>Like ON, except that the camera device also controls
   1264      * the camera's flash unit, firing it in low-light
   1265      * conditions.</p>
   1266      * <p>The flash may be fired during a precapture sequence
   1267      * (triggered by {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) and
   1268      * may be fired for captures for which the
   1269      * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} field is set to
   1270      * STILL_CAPTURE</p>
   1271      *
   1272      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1273      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1274      * @see CaptureRequest#CONTROL_AE_MODE
   1275      */
   1276     public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2;
   1277 
   1278     /**
   1279      * <p>Like ON, except that the camera device also controls
   1280      * the camera's flash unit, always firing it for still
   1281      * captures.</p>
   1282      * <p>The flash may be fired during a precapture sequence
   1283      * (triggered by {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) and
   1284      * will always be fired for captures for which the
   1285      * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} field is set to
   1286      * STILL_CAPTURE</p>
   1287      *
   1288      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1289      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1290      * @see CaptureRequest#CONTROL_AE_MODE
   1291      */
   1292     public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3;
   1293 
   1294     /**
   1295      * <p>Like ON_AUTO_FLASH, but with automatic red eye
   1296      * reduction.</p>
   1297      * <p>If deemed necessary by the camera device, a red eye
   1298      * reduction flash will fire during the precapture
   1299      * sequence.</p>
   1300      * @see CaptureRequest#CONTROL_AE_MODE
   1301      */
   1302     public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4;
   1303 
   1304     //
   1305     // Enumeration values for CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1306     //
   1307 
   1308     /**
   1309      * <p>The trigger is idle.</p>
   1310      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1311      */
   1312     public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0;
   1313 
   1314     /**
   1315      * <p>The precapture metering sequence will be started
   1316      * by the camera device.</p>
   1317      * <p>The exact effect of the precapture trigger depends on
   1318      * the current AE mode and state.</p>
   1319      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1320      */
   1321     public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1;
   1322 
   1323     /**
   1324      * <p>The camera device will cancel any currently active or completed
   1325      * precapture metering sequence, the auto-exposure routine will return to its
   1326      * initial state.</p>
   1327      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1328      */
   1329     public static final int CONTROL_AE_PRECAPTURE_TRIGGER_CANCEL = 2;
   1330 
   1331     //
   1332     // Enumeration values for CaptureRequest#CONTROL_AF_MODE
   1333     //
   1334 
   1335     /**
   1336      * <p>The auto-focus routine does not control the lens;
   1337      * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} is controlled by the
   1338      * application.</p>
   1339      *
   1340      * @see CaptureRequest#LENS_FOCUS_DISTANCE
   1341      * @see CaptureRequest#CONTROL_AF_MODE
   1342      */
   1343     public static final int CONTROL_AF_MODE_OFF = 0;
   1344 
   1345     /**
   1346      * <p>Basic automatic focus mode.</p>
   1347      * <p>In this mode, the lens does not move unless
   1348      * the autofocus trigger action is called. When that trigger
   1349      * is activated, AF will transition to ACTIVE_SCAN, then to
   1350      * the outcome of the scan (FOCUSED or NOT_FOCUSED).</p>
   1351      * <p>Always supported if lens is not fixed focus.</p>
   1352      * <p>Use {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} to determine if lens
   1353      * is fixed-focus.</p>
   1354      * <p>Triggering AF_CANCEL resets the lens position to default,
   1355      * and sets the AF state to INACTIVE.</p>
   1356      *
   1357      * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
   1358      * @see CaptureRequest#CONTROL_AF_MODE
   1359      */
   1360     public static final int CONTROL_AF_MODE_AUTO = 1;
   1361 
   1362     /**
   1363      * <p>Close-up focusing mode.</p>
   1364      * <p>In this mode, the lens does not move unless the
   1365      * autofocus trigger action is called. When that trigger is
   1366      * activated, AF will transition to ACTIVE_SCAN, then to
   1367      * the outcome of the scan (FOCUSED or NOT_FOCUSED). This
   1368      * mode is optimized for focusing on objects very close to
   1369      * the camera.</p>
   1370      * <p>When that trigger is activated, AF will transition to
   1371      * ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or
   1372      * NOT_FOCUSED). Triggering cancel AF resets the lens
   1373      * position to default, and sets the AF state to
   1374      * INACTIVE.</p>
   1375      * @see CaptureRequest#CONTROL_AF_MODE
   1376      */
   1377     public static final int CONTROL_AF_MODE_MACRO = 2;
   1378 
   1379     /**
   1380      * <p>In this mode, the AF algorithm modifies the lens
   1381      * position continually to attempt to provide a
   1382      * constantly-in-focus image stream.</p>
   1383      * <p>The focusing behavior should be suitable for good quality
   1384      * video recording; typically this means slower focus
   1385      * movement and no overshoots. When the AF trigger is not
   1386      * involved, the AF algorithm should start in INACTIVE state,
   1387      * and then transition into PASSIVE_SCAN and PASSIVE_FOCUSED
   1388      * states as appropriate. When the AF trigger is activated,
   1389      * the algorithm should immediately transition into
   1390      * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
   1391      * lens position until a cancel AF trigger is received.</p>
   1392      * <p>Once cancel is received, the algorithm should transition
   1393      * back to INACTIVE and resume passive scan. Note that this
   1394      * behavior is not identical to CONTINUOUS_PICTURE, since an
   1395      * ongoing PASSIVE_SCAN must immediately be
   1396      * canceled.</p>
   1397      * @see CaptureRequest#CONTROL_AF_MODE
   1398      */
   1399     public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3;
   1400 
   1401     /**
   1402      * <p>In this mode, the AF algorithm modifies the lens
   1403      * position continually to attempt to provide a
   1404      * constantly-in-focus image stream.</p>
   1405      * <p>The focusing behavior should be suitable for still image
   1406      * capture; typically this means focusing as fast as
   1407      * possible. When the AF trigger is not involved, the AF
   1408      * algorithm should start in INACTIVE state, and then
   1409      * transition into PASSIVE_SCAN and PASSIVE_FOCUSED states as
   1410      * appropriate as it attempts to maintain focus. When the AF
   1411      * trigger is activated, the algorithm should finish its
   1412      * PASSIVE_SCAN if active, and then transition into
   1413      * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
   1414      * lens position until a cancel AF trigger is received.</p>
   1415      * <p>When the AF cancel trigger is activated, the algorithm
   1416      * should transition back to INACTIVE and then act as if it
   1417      * has just been started.</p>
   1418      * @see CaptureRequest#CONTROL_AF_MODE
   1419      */
   1420     public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4;
   1421 
   1422     /**
   1423      * <p>Extended depth of field (digital focus) mode.</p>
   1424      * <p>The camera device will produce images with an extended
   1425      * depth of field automatically; no special focusing
   1426      * operations need to be done before taking a picture.</p>
   1427      * <p>AF triggers are ignored, and the AF state will always be
   1428      * INACTIVE.</p>
   1429      * @see CaptureRequest#CONTROL_AF_MODE
   1430      */
   1431     public static final int CONTROL_AF_MODE_EDOF = 5;
   1432 
   1433     //
   1434     // Enumeration values for CaptureRequest#CONTROL_AF_TRIGGER
   1435     //
   1436 
   1437     /**
   1438      * <p>The trigger is idle.</p>
   1439      * @see CaptureRequest#CONTROL_AF_TRIGGER
   1440      */
   1441     public static final int CONTROL_AF_TRIGGER_IDLE = 0;
   1442 
   1443     /**
   1444      * <p>Autofocus will trigger now.</p>
   1445      * @see CaptureRequest#CONTROL_AF_TRIGGER
   1446      */
   1447     public static final int CONTROL_AF_TRIGGER_START = 1;
   1448 
   1449     /**
   1450      * <p>Autofocus will return to its initial
   1451      * state, and cancel any currently active trigger.</p>
   1452      * @see CaptureRequest#CONTROL_AF_TRIGGER
   1453      */
   1454     public static final int CONTROL_AF_TRIGGER_CANCEL = 2;
   1455 
   1456     //
   1457     // Enumeration values for CaptureRequest#CONTROL_AWB_MODE
   1458     //
   1459 
   1460     /**
   1461      * <p>The camera device's auto-white balance routine is disabled.</p>
   1462      * <p>The application-selected color transform matrix
   1463      * ({@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}) and gains
   1464      * ({@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}) are used by the camera
   1465      * device for manual white balance control.</p>
   1466      *
   1467      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1468      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1469      * @see CaptureRequest#CONTROL_AWB_MODE
   1470      */
   1471     public static final int CONTROL_AWB_MODE_OFF = 0;
   1472 
   1473     /**
   1474      * <p>The camera device's auto-white balance routine is active.</p>
   1475      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1476      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1477      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1478      * values used by the camera device for the transform and gains
   1479      * will be available in the capture result for this request.</p>
   1480      *
   1481      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1482      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1483      * @see CaptureRequest#CONTROL_AWB_MODE
   1484      */
   1485     public static final int CONTROL_AWB_MODE_AUTO = 1;
   1486 
   1487     /**
   1488      * <p>The camera device's auto-white balance routine is disabled;
   1489      * the camera device uses incandescent light as the assumed scene
   1490      * illumination for white balance.</p>
   1491      * <p>While the exact white balance transforms are up to the
   1492      * camera device, they will approximately match the CIE
   1493      * standard illuminant A.</p>
   1494      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1495      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1496      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1497      * values used by the camera device for the transform and gains
   1498      * will be available in the capture result for this request.</p>
   1499      *
   1500      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1501      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1502      * @see CaptureRequest#CONTROL_AWB_MODE
   1503      */
   1504     public static final int CONTROL_AWB_MODE_INCANDESCENT = 2;
   1505 
   1506     /**
   1507      * <p>The camera device's auto-white balance routine is disabled;
   1508      * the camera device uses fluorescent light as the assumed scene
   1509      * illumination for white balance.</p>
   1510      * <p>While the exact white balance transforms are up to the
   1511      * camera device, they will approximately match the CIE
   1512      * standard illuminant F2.</p>
   1513      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1514      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1515      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1516      * values used by the camera device for the transform and gains
   1517      * will be available in the capture result for this request.</p>
   1518      *
   1519      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1520      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1521      * @see CaptureRequest#CONTROL_AWB_MODE
   1522      */
   1523     public static final int CONTROL_AWB_MODE_FLUORESCENT = 3;
   1524 
   1525     /**
   1526      * <p>The camera device's auto-white balance routine is disabled;
   1527      * the camera device uses warm fluorescent light as the assumed scene
   1528      * illumination for white balance.</p>
   1529      * <p>While the exact white balance transforms are up to the
   1530      * camera device, they will approximately match the CIE
   1531      * standard illuminant F4.</p>
   1532      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1533      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1534      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1535      * values used by the camera device for the transform and gains
   1536      * will be available in the capture result for this request.</p>
   1537      *
   1538      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1539      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1540      * @see CaptureRequest#CONTROL_AWB_MODE
   1541      */
   1542     public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4;
   1543 
   1544     /**
   1545      * <p>The camera device's auto-white balance routine is disabled;
   1546      * the camera device uses daylight light as the assumed scene
   1547      * illumination for white balance.</p>
   1548      * <p>While the exact white balance transforms are up to the
   1549      * camera device, they will approximately match the CIE
   1550      * standard illuminant D65.</p>
   1551      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1552      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1553      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1554      * values used by the camera device for the transform and gains
   1555      * will be available in the capture result for this request.</p>
   1556      *
   1557      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1558      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1559      * @see CaptureRequest#CONTROL_AWB_MODE
   1560      */
   1561     public static final int CONTROL_AWB_MODE_DAYLIGHT = 5;
   1562 
   1563     /**
   1564      * <p>The camera device's auto-white balance routine is disabled;
   1565      * the camera device uses cloudy daylight light as the assumed scene
   1566      * illumination for white balance.</p>
   1567      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1568      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1569      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1570      * values used by the camera device for the transform and gains
   1571      * will be available in the capture result for this request.</p>
   1572      *
   1573      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1574      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1575      * @see CaptureRequest#CONTROL_AWB_MODE
   1576      */
   1577     public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6;
   1578 
   1579     /**
   1580      * <p>The camera device's auto-white balance routine is disabled;
   1581      * the camera device uses twilight light as the assumed scene
   1582      * illumination for white balance.</p>
   1583      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1584      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1585      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1586      * values used by the camera device for the transform and gains
   1587      * will be available in the capture result for this request.</p>
   1588      *
   1589      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1590      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1591      * @see CaptureRequest#CONTROL_AWB_MODE
   1592      */
   1593     public static final int CONTROL_AWB_MODE_TWILIGHT = 7;
   1594 
   1595     /**
   1596      * <p>The camera device's auto-white balance routine is disabled;
   1597      * the camera device uses shade light as the assumed scene
   1598      * illumination for white balance.</p>
   1599      * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
   1600      * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
   1601      * For devices that support the MANUAL_POST_PROCESSING capability, the
   1602      * values used by the camera device for the transform and gains
   1603      * will be available in the capture result for this request.</p>
   1604      *
   1605      * @see CaptureRequest#COLOR_CORRECTION_GAINS
   1606      * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
   1607      * @see CaptureRequest#CONTROL_AWB_MODE
   1608      */
   1609     public static final int CONTROL_AWB_MODE_SHADE = 8;
   1610 
   1611     //
   1612     // Enumeration values for CaptureRequest#CONTROL_CAPTURE_INTENT
   1613     //
   1614 
   1615     /**
   1616      * <p>The goal of this request doesn't fall into the other
   1617      * categories. The camera device will default to preview-like
   1618      * behavior.</p>
   1619      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1620      */
   1621     public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0;
   1622 
   1623     /**
   1624      * <p>This request is for a preview-like use case.</p>
   1625      * <p>The precapture trigger may be used to start off a metering
   1626      * w/flash sequence.</p>
   1627      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1628      */
   1629     public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1;
   1630 
   1631     /**
   1632      * <p>This request is for a still capture-type
   1633      * use case.</p>
   1634      * <p>If the flash unit is under automatic control, it may fire as needed.</p>
   1635      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1636      */
   1637     public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2;
   1638 
   1639     /**
   1640      * <p>This request is for a video recording
   1641      * use case.</p>
   1642      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1643      */
   1644     public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3;
   1645 
   1646     /**
   1647      * <p>This request is for a video snapshot (still
   1648      * image while recording video) use case.</p>
   1649      * <p>The camera device should take the highest-quality image
   1650      * possible (given the other settings) without disrupting the
   1651      * frame rate of video recording.  </p>
   1652      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1653      */
   1654     public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4;
   1655 
   1656     /**
   1657      * <p>This request is for a ZSL usecase; the
   1658      * application will stream full-resolution images and
   1659      * reprocess one or several later for a final
   1660      * capture.</p>
   1661      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1662      */
   1663     public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5;
   1664 
   1665     /**
   1666      * <p>This request is for manual capture use case where
   1667      * the applications want to directly control the capture parameters.</p>
   1668      * <p>For example, the application may wish to manually control
   1669      * {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, etc.</p>
   1670      *
   1671      * @see CaptureRequest#SENSOR_EXPOSURE_TIME
   1672      * @see CaptureRequest#SENSOR_SENSITIVITY
   1673      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1674      */
   1675     public static final int CONTROL_CAPTURE_INTENT_MANUAL = 6;
   1676 
   1677     //
   1678     // Enumeration values for CaptureRequest#CONTROL_EFFECT_MODE
   1679     //
   1680 
   1681     /**
   1682      * <p>No color effect will be applied.</p>
   1683      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1684      */
   1685     public static final int CONTROL_EFFECT_MODE_OFF = 0;
   1686 
   1687     /**
   1688      * <p>A "monocolor" effect where the image is mapped into
   1689      * a single color.</p>
   1690      * <p>This will typically be grayscale.</p>
   1691      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1692      */
   1693     public static final int CONTROL_EFFECT_MODE_MONO = 1;
   1694 
   1695     /**
   1696      * <p>A "photo-negative" effect where the image's colors
   1697      * are inverted.</p>
   1698      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1699      */
   1700     public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2;
   1701 
   1702     /**
   1703      * <p>A "solarisation" effect (Sabattier effect) where the
   1704      * image is wholly or partially reversed in
   1705      * tone.</p>
   1706      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1707      */
   1708     public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3;
   1709 
   1710     /**
   1711      * <p>A "sepia" effect where the image is mapped into warm
   1712      * gray, red, and brown tones.</p>
   1713      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1714      */
   1715     public static final int CONTROL_EFFECT_MODE_SEPIA = 4;
   1716 
   1717     /**
   1718      * <p>A "posterization" effect where the image uses
   1719      * discrete regions of tone rather than a continuous
   1720      * gradient of tones.</p>
   1721      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1722      */
   1723     public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5;
   1724 
   1725     /**
   1726      * <p>A "whiteboard" effect where the image is typically displayed
   1727      * as regions of white, with black or grey details.</p>
   1728      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1729      */
   1730     public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6;
   1731 
   1732     /**
   1733      * <p>A "blackboard" effect where the image is typically displayed
   1734      * as regions of black, with white or grey details.</p>
   1735      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1736      */
   1737     public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7;
   1738 
   1739     /**
   1740      * <p>An "aqua" effect where a blue hue is added to the image.</p>
   1741      * @see CaptureRequest#CONTROL_EFFECT_MODE
   1742      */
   1743     public static final int CONTROL_EFFECT_MODE_AQUA = 8;
   1744 
   1745     //
   1746     // Enumeration values for CaptureRequest#CONTROL_MODE
   1747     //
   1748 
   1749     /**
   1750      * <p>Full application control of pipeline.</p>
   1751      * <p>All control by the device's metering and focusing (3A)
   1752      * routines is disabled, and no other settings in
   1753      * android.control.* have any effect, except that
   1754      * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} may be used by the camera
   1755      * device to select post-processing values for processing
   1756      * blocks that do not allow for manual control, or are not
   1757      * exposed by the camera API.</p>
   1758      * <p>However, the camera device's 3A routines may continue to
   1759      * collect statistics and update their internal state so that
   1760      * when control is switched to AUTO mode, good control values
   1761      * can be immediately applied.</p>
   1762      *
   1763      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   1764      * @see CaptureRequest#CONTROL_MODE
   1765      */
   1766     public static final int CONTROL_MODE_OFF = 0;
   1767 
   1768     /**
   1769      * <p>Use settings for each individual 3A routine.</p>
   1770      * <p>Manual control of capture parameters is disabled. All
   1771      * controls in android.control.* besides sceneMode take
   1772      * effect.</p>
   1773      * @see CaptureRequest#CONTROL_MODE
   1774      */
   1775     public static final int CONTROL_MODE_AUTO = 1;
   1776 
   1777     /**
   1778      * <p>Use a specific scene mode.</p>
   1779      * <p>Enabling this disables control.aeMode, control.awbMode and
   1780      * control.afMode controls; the camera device will ignore
   1781      * those settings while USE_SCENE_MODE is active (except for
   1782      * FACE_PRIORITY scene mode). Other control entries are still active.
   1783      * This setting can only be used if scene mode is supported (i.e.
   1784      * {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}
   1785      * contain some modes other than DISABLED).</p>
   1786      *
   1787      * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
   1788      * @see CaptureRequest#CONTROL_MODE
   1789      */
   1790     public static final int CONTROL_MODE_USE_SCENE_MODE = 2;
   1791 
   1792     /**
   1793      * <p>Same as OFF mode, except that this capture will not be
   1794      * used by camera device background auto-exposure, auto-white balance and
   1795      * auto-focus algorithms (3A) to update their statistics.</p>
   1796      * <p>Specifically, the 3A routines are locked to the last
   1797      * values set from a request with AUTO, OFF, or
   1798      * USE_SCENE_MODE, and any statistics or state updates
   1799      * collected from manual captures with OFF_KEEP_STATE will be
   1800      * discarded by the camera device.</p>
   1801      * @see CaptureRequest#CONTROL_MODE
   1802      */
   1803     public static final int CONTROL_MODE_OFF_KEEP_STATE = 3;
   1804 
   1805     //
   1806     // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE
   1807     //
   1808 
   1809     /**
   1810      * <p>Indicates that no scene modes are set for a given capture request.</p>
   1811      * @see CaptureRequest#CONTROL_SCENE_MODE
   1812      */
   1813     public static final int CONTROL_SCENE_MODE_DISABLED = 0;
   1814 
   1815     /**
   1816      * <p>If face detection support exists, use face
   1817      * detection data for auto-focus, auto-white balance, and
   1818      * auto-exposure routines.</p>
   1819      * <p>If face detection statistics are disabled
   1820      * (i.e. {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} is set to OFF),
   1821      * this should still operate correctly (but will not return
   1822      * face detection statistics to the framework).</p>
   1823      * <p>Unlike the other scene modes, {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
   1824      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
   1825      * remain active when FACE_PRIORITY is set.</p>
   1826      *
   1827      * @see CaptureRequest#CONTROL_AE_MODE
   1828      * @see CaptureRequest#CONTROL_AF_MODE
   1829      * @see CaptureRequest#CONTROL_AWB_MODE
   1830      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
   1831      * @see CaptureRequest#CONTROL_SCENE_MODE
   1832      */
   1833     public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1;
   1834 
   1835     /**
   1836      * <p>Optimized for photos of quickly moving objects.</p>
   1837      * <p>Similar to SPORTS.</p>
   1838      * @see CaptureRequest#CONTROL_SCENE_MODE
   1839      */
   1840     public static final int CONTROL_SCENE_MODE_ACTION = 2;
   1841 
   1842     /**
   1843      * <p>Optimized for still photos of people.</p>
   1844      * @see CaptureRequest#CONTROL_SCENE_MODE
   1845      */
   1846     public static final int CONTROL_SCENE_MODE_PORTRAIT = 3;
   1847 
   1848     /**
   1849      * <p>Optimized for photos of distant macroscopic objects.</p>
   1850      * @see CaptureRequest#CONTROL_SCENE_MODE
   1851      */
   1852     public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4;
   1853 
   1854     /**
   1855      * <p>Optimized for low-light settings.</p>
   1856      * @see CaptureRequest#CONTROL_SCENE_MODE
   1857      */
   1858     public static final int CONTROL_SCENE_MODE_NIGHT = 5;
   1859 
   1860     /**
   1861      * <p>Optimized for still photos of people in low-light
   1862      * settings.</p>
   1863      * @see CaptureRequest#CONTROL_SCENE_MODE
   1864      */
   1865     public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6;
   1866 
   1867     /**
   1868      * <p>Optimized for dim, indoor settings where flash must
   1869      * remain off.</p>
   1870      * @see CaptureRequest#CONTROL_SCENE_MODE
   1871      */
   1872     public static final int CONTROL_SCENE_MODE_THEATRE = 7;
   1873 
   1874     /**
   1875      * <p>Optimized for bright, outdoor beach settings.</p>
   1876      * @see CaptureRequest#CONTROL_SCENE_MODE
   1877      */
   1878     public static final int CONTROL_SCENE_MODE_BEACH = 8;
   1879 
   1880     /**
   1881      * <p>Optimized for bright, outdoor settings containing snow.</p>
   1882      * @see CaptureRequest#CONTROL_SCENE_MODE
   1883      */
   1884     public static final int CONTROL_SCENE_MODE_SNOW = 9;
   1885 
   1886     /**
   1887      * <p>Optimized for scenes of the setting sun.</p>
   1888      * @see CaptureRequest#CONTROL_SCENE_MODE
   1889      */
   1890     public static final int CONTROL_SCENE_MODE_SUNSET = 10;
   1891 
   1892     /**
   1893      * <p>Optimized to avoid blurry photos due to small amounts of
   1894      * device motion (for example: due to hand shake).</p>
   1895      * @see CaptureRequest#CONTROL_SCENE_MODE
   1896      */
   1897     public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11;
   1898 
   1899     /**
   1900      * <p>Optimized for nighttime photos of fireworks.</p>
   1901      * @see CaptureRequest#CONTROL_SCENE_MODE
   1902      */
   1903     public static final int CONTROL_SCENE_MODE_FIREWORKS = 12;
   1904 
   1905     /**
   1906      * <p>Optimized for photos of quickly moving people.</p>
   1907      * <p>Similar to ACTION.</p>
   1908      * @see CaptureRequest#CONTROL_SCENE_MODE
   1909      */
   1910     public static final int CONTROL_SCENE_MODE_SPORTS = 13;
   1911 
   1912     /**
   1913      * <p>Optimized for dim, indoor settings with multiple moving
   1914      * people.</p>
   1915      * @see CaptureRequest#CONTROL_SCENE_MODE
   1916      */
   1917     public static final int CONTROL_SCENE_MODE_PARTY = 14;
   1918 
   1919     /**
   1920      * <p>Optimized for dim settings where the main light source
   1921      * is a flame.</p>
   1922      * @see CaptureRequest#CONTROL_SCENE_MODE
   1923      */
   1924     public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15;
   1925 
   1926     /**
   1927      * <p>Optimized for accurately capturing a photo of barcode
   1928      * for use by camera applications that wish to read the
   1929      * barcode value.</p>
   1930      * @see CaptureRequest#CONTROL_SCENE_MODE
   1931      */
   1932     public static final int CONTROL_SCENE_MODE_BARCODE = 16;
   1933 
   1934     /**
   1935      * <p>This is deprecated, please use {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }
   1936      * and {@link android.hardware.camera2.CameraConstrainedHighSpeedCaptureSession#createHighSpeedRequestList }
   1937      * for high speed video recording.</p>
   1938      * <p>Optimized for high speed video recording (frame rate &gt;=60fps) use case.</p>
   1939      * <p>The supported high speed video sizes and fps ranges are specified in
   1940      * android.control.availableHighSpeedVideoConfigurations. To get desired
   1941      * output frame rates, the application is only allowed to select video size
   1942      * and fps range combinations listed in this static metadata. The fps range
   1943      * can be control via {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}.</p>
   1944      * <p>In this mode, the camera device will override aeMode, awbMode, and afMode to
   1945      * ON, ON, and CONTINUOUS_VIDEO, respectively. All post-processing block mode
   1946      * controls will be overridden to be FAST. Therefore, no manual control of capture
   1947      * and post-processing parameters is possible. All other controls operate the
   1948      * same as when {@link CaptureRequest#CONTROL_MODE android.control.mode} == AUTO. This means that all other
   1949      * android.control.* fields continue to work, such as</p>
   1950      * <ul>
   1951      * <li>{@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}</li>
   1952      * <li>{@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}</li>
   1953      * <li>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</li>
   1954      * <li>{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</li>
   1955      * <li>{@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</li>
   1956      * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li>
   1957      * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li>
   1958      * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li>
   1959      * <li>{@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}</li>
   1960      * <li>{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}</li>
   1961      * </ul>
   1962      * <p>Outside of android.control.*, the following controls will work:</p>
   1963      * <ul>
   1964      * <li>{@link CaptureRequest#FLASH_MODE android.flash.mode} (automatic flash for still capture will not work since aeMode is ON)</li>
   1965      * <li>{@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} (if it is supported)</li>
   1966      * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li>
   1967      * <li>{@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</li>
   1968      * </ul>
   1969      * <p>For high speed recording use case, the actual maximum supported frame rate may
   1970      * be lower than what camera can output, depending on the destination Surfaces for
   1971      * the image data. For example, if the destination surface is from video encoder,
   1972      * the application need check if the video encoder is capable of supporting the
   1973      * high frame rate for a given video size, or it will end up with lower recording
   1974      * frame rate. If the destination surface is from preview window, the preview frame
   1975      * rate will be bounded by the screen refresh rate.</p>
   1976      * <p>The camera device will only support up to 2 output high speed streams
   1977      * (processed non-stalling format defined in android.request.maxNumOutputStreams)
   1978      * in this mode. This control will be effective only if all of below conditions are true:</p>
   1979      * <ul>
   1980      * <li>The application created no more than maxNumHighSpeedStreams processed non-stalling
   1981      * format output streams, where maxNumHighSpeedStreams is calculated as
   1982      * min(2, android.request.maxNumOutputStreams[Processed (but not-stalling)]).</li>
   1983      * <li>The stream sizes are selected from the sizes reported by
   1984      * android.control.availableHighSpeedVideoConfigurations.</li>
   1985      * <li>No processed non-stalling or raw streams are configured.</li>
   1986      * </ul>
   1987      * <p>When above conditions are NOT satistied, the controls of this mode and
   1988      * {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} will be ignored by the camera device,
   1989      * the camera device will fall back to {@link CaptureRequest#CONTROL_MODE android.control.mode} <code>==</code> AUTO,
   1990      * and the returned capture result metadata will give the fps range choosen
   1991      * by the camera device.</p>
   1992      * <p>Switching into or out of this mode may trigger some camera ISP/sensor
   1993      * reconfigurations, which may introduce extra latency. It is recommended that
   1994      * the application avoids unnecessary scene mode switch as much as possible.</p>
   1995      *
   1996      * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
   1997      * @see CaptureRequest#CONTROL_AE_LOCK
   1998      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   1999      * @see CaptureRequest#CONTROL_AE_REGIONS
   2000      * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
   2001      * @see CaptureRequest#CONTROL_AF_REGIONS
   2002      * @see CaptureRequest#CONTROL_AF_TRIGGER
   2003      * @see CaptureRequest#CONTROL_AWB_LOCK
   2004      * @see CaptureRequest#CONTROL_AWB_REGIONS
   2005      * @see CaptureRequest#CONTROL_EFFECT_MODE
   2006      * @see CaptureRequest#CONTROL_MODE
   2007      * @see CaptureRequest#FLASH_MODE
   2008      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
   2009      * @see CaptureRequest#SCALER_CROP_REGION
   2010      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
   2011      * @see CaptureRequest#CONTROL_SCENE_MODE
   2012      * @deprecated Please refer to this API documentation to find the alternatives
   2013      */
   2014     @Deprecated
   2015     public static final int CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO = 17;
   2016 
   2017     /**
   2018      * <p>Turn on a device-specific high dynamic range (HDR) mode.</p>
   2019      * <p>In this scene mode, the camera device captures images
   2020      * that keep a larger range of scene illumination levels
   2021      * visible in the final image. For example, when taking a
   2022      * picture of a object in front of a bright window, both
   2023      * the object and the scene through the window may be
   2024      * visible when using HDR mode, while in normal AUTO mode,
   2025      * one or the other may be poorly exposed. As a tradeoff,
   2026      * HDR mode generally takes much longer to capture a single
   2027      * image, has no user control, and may have other artifacts
   2028      * depending on the HDR method used.</p>
   2029      * <p>Therefore, HDR captures operate at a much slower rate
   2030      * than regular captures.</p>
   2031      * <p>In this mode, on LIMITED or FULL devices, when a request
   2032      * is made with a {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} of
   2033      * STILL_CAPTURE, the camera device will capture an image
   2034      * using a high dynamic range capture technique.  On LEGACY
   2035      * devices, captures that target a JPEG-format output will
   2036      * be captured with HDR, and the capture intent is not
   2037      * relevant.</p>
   2038      * <p>The HDR capture may involve the device capturing a burst
   2039      * of images internally and combining them into one, or it
   2040      * may involve the device using specialized high dynamic
   2041      * range capture hardware. In all cases, a single image is
   2042      * produced in response to a capture request submitted
   2043      * while in HDR mode.</p>
   2044      * <p>Since substantial post-processing is generally needed to
   2045      * produce an HDR image, only YUV, PRIVATE, and JPEG
   2046      * outputs are supported for LIMITED/FULL device HDR
   2047      * captures, and only JPEG outputs are supported for LEGACY
   2048      * HDR captures. Using a RAW output for HDR capture is not
   2049      * supported.</p>
   2050      * <p>Some devices may also support always-on HDR, which
   2051      * applies HDR processing at full frame rate.  For these
   2052      * devices, intents other than STILL_CAPTURE will also
   2053      * produce an HDR output with no frame rate impact compared
   2054      * to normal operation, though the quality may be lower
   2055      * than for STILL_CAPTURE intents.</p>
   2056      * <p>If SCENE_MODE_HDR is used with unsupported output types
   2057      * or capture intents, the images captured will be as if
   2058      * the SCENE_MODE was not enabled at all.</p>
   2059      *
   2060      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
   2061      * @see CaptureRequest#CONTROL_SCENE_MODE
   2062      */
   2063     public static final int CONTROL_SCENE_MODE_HDR = 18;
   2064 
   2065     /**
   2066      * <p>Same as FACE_PRIORITY scene mode, except that the camera
   2067      * device will choose higher sensitivity values ({@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity})
   2068      * under low light conditions.</p>
   2069      * <p>The camera device may be tuned to expose the images in a reduced
   2070      * sensitivity range to produce the best quality images. For example,
   2071      * if the {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange} gives range of [100, 1600],
   2072      * the camera device auto-exposure routine tuning process may limit the actual
   2073      * exposure sensitivity range to [100, 1200] to ensure that the noise level isn't
   2074      * exessive in order to preserve the image quality. Under this situation, the image under
   2075      * low light may be under-exposed when the sensor max exposure time (bounded by the
   2076      * {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} when {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} is one of the
   2077      * ON_* modes) and effective max sensitivity are reached. This scene mode allows the
   2078      * camera device auto-exposure routine to increase the sensitivity up to the max
   2079      * sensitivity specified by {@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange} when the scene is too
   2080      * dark and the max exposure time is reached. The captured images may be noisier
   2081      * compared with the images captured in normal FACE_PRIORITY mode; therefore, it is
   2082      * recommended that the application only use this scene mode when it is capable of
   2083      * reducing the noise level of the captured images.</p>
   2084      * <p>Unlike the other scene modes, {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
   2085      * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
   2086      * remain active when FACE_PRIORITY_LOW_LIGHT is set.</p>
   2087      *
   2088      * @see CaptureRequest#CONTROL_AE_MODE
   2089      * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
   2090      * @see CaptureRequest#CONTROL_AF_MODE
   2091      * @see CaptureRequest#CONTROL_AWB_MODE
   2092      * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
   2093      * @see CaptureRequest#SENSOR_SENSITIVITY
   2094      * @see CaptureRequest#CONTROL_SCENE_MODE
   2095      * @hide
   2096      */
   2097     public static final int CONTROL_SCENE_MODE_FACE_PRIORITY_LOW_LIGHT = 19;
   2098 
   2099     /**
   2100      * <p>Scene mode values within the range of
   2101      * <code>[DEVICE_CUSTOM_START, DEVICE_CUSTOM_END]</code> are reserved for device specific
   2102      * customized scene modes.</p>
   2103      * @see CaptureRequest#CONTROL_SCENE_MODE
   2104      * @hide
   2105      */
   2106     public static final int CONTROL_SCENE_MODE_DEVICE_CUSTOM_START = 100;
   2107 
   2108     /**
   2109      * <p>Scene mode values within the range of
   2110      * <code>[DEVICE_CUSTOM_START, DEVICE_CUSTOM_END]</code> are reserved for device specific
   2111      * customized scene modes.</p>
   2112      * @see CaptureRequest#CONTROL_SCENE_MODE
   2113      * @hide
   2114      */
   2115     public static final int CONTROL_SCENE_MODE_DEVICE_CUSTOM_END = 127;
   2116 
   2117     //
   2118     // Enumeration values for CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
   2119     //
   2120 
   2121     /**
   2122      * <p>Video stabilization is disabled.</p>
   2123      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
   2124      */
   2125     public static final int CONTROL_VIDEO_STABILIZATION_MODE_OFF = 0;
   2126 
   2127     /**
   2128      * <p>Video stabilization is enabled.</p>
   2129      * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
   2130      */
   2131     public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1;
   2132 
   2133     //
   2134     // Enumeration values for CaptureRequest#EDGE_MODE
   2135     //
   2136 
   2137     /**
   2138      * <p>No edge enhancement is applied.</p>
   2139      * @see CaptureRequest#EDGE_MODE
   2140      */
   2141     public static final int EDGE_MODE_OFF = 0;
   2142 
   2143     /**
   2144      * <p>Apply edge enhancement at a quality level that does not slow down frame rate
   2145      * relative to sensor output. It may be the same as OFF if edge enhancement will
   2146      * slow down frame rate relative to sensor.</p>
   2147      * @see CaptureRequest#EDGE_MODE
   2148      */
   2149     public static final int EDGE_MODE_FAST = 1;
   2150 
   2151     /**
   2152      * <p>Apply high-quality edge enhancement, at a cost of possibly reduced output frame rate.</p>
   2153      * @see CaptureRequest#EDGE_MODE
   2154      */
   2155     public static final int EDGE_MODE_HIGH_QUALITY = 2;
   2156 
   2157     /**
   2158      * <p>Edge enhancement is applied at different levels for different output streams,
   2159      * based on resolution. Streams at maximum recording resolution (see {@link android.hardware.camera2.CameraDevice#createCaptureSession }) or below have
   2160      * edge enhancement applied, while higher-resolution streams have no edge enhancement
   2161      * applied. The level of edge enhancement for low-resolution streams is tuned so that
   2162      * frame rate is not impacted, and the quality is equal to or better than FAST (since it
   2163      * is only applied to lower-resolution outputs, quality may improve from FAST).</p>
   2164      * <p>This mode is intended to be used by applications operating in a zero-shutter-lag mode
   2165      * with YUV or PRIVATE reprocessing, where the application continuously captures
   2166      * high-resolution intermediate buffers into a circular buffer, from which a final image is
   2167      * produced via reprocessing when a user takes a picture.  For such a use case, the
   2168      * high-resolution buffers must not have edge enhancement applied to maximize efficiency of
   2169      * preview and to avoid double-applying enhancement when reprocessed, while low-resolution
   2170      * buffers (used for recording or preview, generally) need edge enhancement applied for
   2171      * reasonable preview quality.</p>
   2172      * <p>This mode is guaranteed to be supported by devices that support either the
   2173      * YUV_REPROCESSING or PRIVATE_REPROCESSING capabilities
   2174      * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} lists either of those capabilities) and it will
   2175      * be the default mode for CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
   2176      *
   2177      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   2178      * @see CaptureRequest#EDGE_MODE
   2179      */
   2180     public static final int EDGE_MODE_ZERO_SHUTTER_LAG = 3;
   2181 
   2182     //
   2183     // Enumeration values for CaptureRequest#FLASH_MODE
   2184     //
   2185 
   2186     /**
   2187      * <p>Do not fire the flash for this capture.</p>
   2188      * @see CaptureRequest#FLASH_MODE
   2189      */
   2190     public static final int FLASH_MODE_OFF = 0;
   2191 
   2192     /**
   2193      * <p>If the flash is available and charged, fire flash
   2194      * for this capture.</p>
   2195      * @see CaptureRequest#FLASH_MODE
   2196      */
   2197     public static final int FLASH_MODE_SINGLE = 1;
   2198 
   2199     /**
   2200      * <p>Transition flash to continuously on.</p>
   2201      * @see CaptureRequest#FLASH_MODE
   2202      */
   2203     public static final int FLASH_MODE_TORCH = 2;
   2204 
   2205     //
   2206     // Enumeration values for CaptureRequest#HOT_PIXEL_MODE
   2207     //
   2208 
   2209     /**
   2210      * <p>No hot pixel correction is applied.</p>
   2211      * <p>The frame rate must not be reduced relative to sensor raw output
   2212      * for this option.</p>
   2213      * <p>The hotpixel map may be returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.</p>
   2214      *
   2215      * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
   2216      * @see CaptureRequest#HOT_PIXEL_MODE
   2217      */
   2218     public static final int HOT_PIXEL_MODE_OFF = 0;
   2219 
   2220     /**
   2221      * <p>Hot pixel correction is applied, without reducing frame
   2222      * rate relative to sensor raw output.</p>
   2223      * <p>The hotpixel map may be returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.</p>
   2224      *
   2225      * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
   2226      * @see CaptureRequest#HOT_PIXEL_MODE
   2227      */
   2228     public static final int HOT_PIXEL_MODE_FAST = 1;
   2229 
   2230     /**
   2231      * <p>High-quality hot pixel correction is applied, at a cost
   2232      * of possibly reduced frame rate relative to sensor raw output.</p>
   2233      * <p>The hotpixel map may be returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.</p>
   2234      *
   2235      * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
   2236      * @see CaptureRequest#HOT_PIXEL_MODE
   2237      */
   2238     public static final int HOT_PIXEL_MODE_HIGH_QUALITY = 2;
   2239 
   2240     //
   2241     // Enumeration values for CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
   2242     //
   2243 
   2244     /**
   2245      * <p>Optical stabilization is unavailable.</p>
   2246      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
   2247      */
   2248     public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0;
   2249 
   2250     /**
   2251      * <p>Optical stabilization is enabled.</p>
   2252      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
   2253      */
   2254     public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1;
   2255 
   2256     //
   2257     // Enumeration values for CaptureRequest#NOISE_REDUCTION_MODE
   2258     //
   2259 
   2260     /**
   2261      * <p>No noise reduction is applied.</p>
   2262      * @see CaptureRequest#NOISE_REDUCTION_MODE
   2263      */
   2264     public static final int NOISE_REDUCTION_MODE_OFF = 0;
   2265 
   2266     /**
   2267      * <p>Noise reduction is applied without reducing frame rate relative to sensor
   2268      * output. It may be the same as OFF if noise reduction will reduce frame rate
   2269      * relative to sensor.</p>
   2270      * @see CaptureRequest#NOISE_REDUCTION_MODE
   2271      */
   2272     public static final int NOISE_REDUCTION_MODE_FAST = 1;
   2273 
   2274     /**
   2275      * <p>High-quality noise reduction is applied, at the cost of possibly reduced frame
   2276      * rate relative to sensor output.</p>
   2277      * @see CaptureRequest#NOISE_REDUCTION_MODE
   2278      */
   2279     public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2;
   2280 
   2281     /**
   2282      * <p>MINIMAL noise reduction is applied without reducing frame rate relative to
   2283      * sensor output. </p>
   2284      * @see CaptureRequest#NOISE_REDUCTION_MODE
   2285      */
   2286     public static final int NOISE_REDUCTION_MODE_MINIMAL = 3;
   2287 
   2288     /**
   2289      * <p>Noise reduction is applied at different levels for different output streams,
   2290      * based on resolution. Streams at maximum recording resolution (see {@link android.hardware.camera2.CameraDevice#createCaptureSession }) or below have noise
   2291      * reduction applied, while higher-resolution streams have MINIMAL (if supported) or no
   2292      * noise reduction applied (if MINIMAL is not supported.) The degree of noise reduction
   2293      * for low-resolution streams is tuned so that frame rate is not impacted, and the quality
   2294      * is equal to or better than FAST (since it is only applied to lower-resolution outputs,
   2295      * quality may improve from FAST).</p>
   2296      * <p>This mode is intended to be used by applications operating in a zero-shutter-lag mode
   2297      * with YUV or PRIVATE reprocessing, where the application continuously captures
   2298      * high-resolution intermediate buffers into a circular buffer, from which a final image is
   2299      * produced via reprocessing when a user takes a picture.  For such a use case, the
   2300      * high-resolution buffers must not have noise reduction applied to maximize efficiency of
   2301      * preview and to avoid over-applying noise filtering when reprocessing, while
   2302      * low-resolution buffers (used for recording or preview, generally) need noise reduction
   2303      * applied for reasonable preview quality.</p>
   2304      * <p>This mode is guaranteed to be supported by devices that support either the
   2305      * YUV_REPROCESSING or PRIVATE_REPROCESSING capabilities
   2306      * ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} lists either of those capabilities) and it will
   2307      * be the default mode for CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG template.</p>
   2308      *
   2309      * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
   2310      * @see CaptureRequest#NOISE_REDUCTION_MODE
   2311      */
   2312     public static final int NOISE_REDUCTION_MODE_ZERO_SHUTTER_LAG = 4;
   2313 
   2314     //
   2315     // Enumeration values for CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2316     //
   2317 
   2318     /**
   2319      * <p>No test pattern mode is used, and the camera
   2320      * device returns captures from the image sensor.</p>
   2321      * <p>This is the default if the key is not set.</p>
   2322      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2323      */
   2324     public static final int SENSOR_TEST_PATTERN_MODE_OFF = 0;
   2325 
   2326     /**
   2327      * <p>Each pixel in <code>[R, G_even, G_odd, B]</code> is replaced by its
   2328      * respective color channel provided in
   2329      * {@link CaptureRequest#SENSOR_TEST_PATTERN_DATA android.sensor.testPatternData}.</p>
   2330      * <p>For example:</p>
   2331      * <pre><code>android.testPatternData = [0, 0xFFFFFFFF, 0xFFFFFFFF, 0]
   2332      * </code></pre>
   2333      * <p>All green pixels are 100% green. All red/blue pixels are black.</p>
   2334      * <pre><code>android.testPatternData = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0]
   2335      * </code></pre>
   2336      * <p>All red pixels are 100% red. Only the odd green pixels
   2337      * are 100% green. All blue pixels are 100% black.</p>
   2338      *
   2339      * @see CaptureRequest#SENSOR_TEST_PATTERN_DATA
   2340      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2341      */
   2342     public static final int SENSOR_TEST_PATTERN_MODE_SOLID_COLOR = 1;
   2343 
   2344     /**
   2345      * <p>All pixel data is replaced with an 8-bar color pattern.</p>
   2346      * <p>The vertical bars (left-to-right) are as follows:</p>
   2347      * <ul>
   2348      * <li>100% white</li>
   2349      * <li>yellow</li>
   2350      * <li>cyan</li>
   2351      * <li>green</li>
   2352      * <li>magenta</li>
   2353      * <li>red</li>
   2354      * <li>blue</li>
   2355      * <li>black</li>
   2356      * </ul>
   2357      * <p>In general the image would look like the following:</p>
   2358      * <pre><code>W Y C G M R B K
   2359      * W Y C G M R B K
   2360      * W Y C G M R B K
   2361      * W Y C G M R B K
   2362      * W Y C G M R B K
   2363      * . . . . . . . .
   2364      * . . . . . . . .
   2365      * . . . . . . . .
   2366      *
   2367      * (B = Blue, K = Black)
   2368      * </code></pre>
   2369      * <p>Each bar should take up 1/8 of the sensor pixel array width.
   2370      * When this is not possible, the bar size should be rounded
   2371      * down to the nearest integer and the pattern can repeat
   2372      * on the right side.</p>
   2373      * <p>Each bar's height must always take up the full sensor
   2374      * pixel array height.</p>
   2375      * <p>Each pixel in this test pattern must be set to either
   2376      * 0% intensity or 100% intensity.</p>
   2377      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2378      */
   2379     public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2;
   2380 
   2381     /**
   2382      * <p>The test pattern is similar to COLOR_BARS, except that
   2383      * each bar should start at its specified color at the top,
   2384      * and fade to gray at the bottom.</p>
   2385      * <p>Furthermore each bar is further subdivided into a left and
   2386      * right half. The left half should have a smooth gradient,
   2387      * and the right half should have a quantized gradient.</p>
   2388      * <p>In particular, the right half's should consist of blocks of the
   2389      * same color for 1/16th active sensor pixel array width.</p>
   2390      * <p>The least significant bits in the quantized gradient should
   2391      * be copied from the most significant bits of the smooth gradient.</p>
   2392      * <p>The height of each bar should always be a multiple of 128.
   2393      * When this is not the case, the pattern should repeat at the bottom
   2394      * of the image.</p>
   2395      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2396      */
   2397     public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3;
   2398 
   2399     /**
   2400      * <p>All pixel data is replaced by a pseudo-random sequence
   2401      * generated from a PN9 512-bit sequence (typically implemented
   2402      * in hardware with a linear feedback shift register).</p>
   2403      * <p>The generator should be reset at the beginning of each frame,
   2404      * and thus each subsequent raw frame with this test pattern should
   2405      * be exactly the same as the last.</p>
   2406      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2407      */
   2408     public static final int SENSOR_TEST_PATTERN_MODE_PN9 = 4;
   2409 
   2410     /**
   2411      * <p>The first custom test pattern. All custom patterns that are
   2412      * available only on this camera device are at least this numeric
   2413      * value.</p>
   2414      * <p>All of the custom test patterns will be static
   2415      * (that is the raw image must not vary from frame to frame).</p>
   2416      * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
   2417      */
   2418     public static final int SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256;
   2419 
   2420     //
   2421     // Enumeration values for CaptureRequest#SHADING_MODE
   2422     //
   2423 
   2424     /**
   2425      * <p>No lens shading correction is applied.</p>
   2426      * @see CaptureRequest#SHADING_MODE
   2427      */
   2428     public static final int SHADING_MODE_OFF = 0;
   2429 
   2430     /**
   2431      * <p>Apply lens shading corrections, without slowing
   2432      * frame rate relative to sensor raw output</p>
   2433      * @see CaptureRequest#SHADING_MODE
   2434      */
   2435     public static final int SHADING_MODE_FAST = 1;
   2436 
   2437     /**
   2438      * <p>Apply high-quality lens shading correction, at the
   2439      * cost of possibly reduced frame rate.</p>
   2440      * @see CaptureRequest#SHADING_MODE
   2441      */
   2442     public static final int SHADING_MODE_HIGH_QUALITY = 2;
   2443 
   2444     //
   2445     // Enumeration values for CaptureRequest#STATISTICS_FACE_DETECT_MODE
   2446     //
   2447 
   2448     /**
   2449      * <p>Do not include face detection statistics in capture
   2450      * results.</p>
   2451      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
   2452      */
   2453     public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0;
   2454 
   2455     /**
   2456      * <p>Return face rectangle and confidence values only.</p>
   2457      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
   2458      */
   2459     public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1;
   2460 
   2461     /**
   2462      * <p>Return all face
   2463      * metadata.</p>
   2464      * <p>In this mode, face rectangles, scores, landmarks, and face IDs are all valid.</p>
   2465      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
   2466      */
   2467     public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2;
   2468 
   2469     //
   2470     // Enumeration values for CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
   2471     //
   2472 
   2473     /**
   2474      * <p>Do not include a lens shading map in the capture result.</p>
   2475      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
   2476      */
   2477     public static final int STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0;
   2478 
   2479     /**
   2480      * <p>Include a lens shading map in the capture result.</p>
   2481      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
   2482      */
   2483     public static final int STATISTICS_LENS_SHADING_MAP_MODE_ON = 1;
   2484 
   2485     //
   2486     // Enumeration values for CaptureRequest#TONEMAP_MODE
   2487     //
   2488 
   2489     /**
   2490      * <p>Use the tone mapping curve specified in
   2491      * the {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}* entries.</p>
   2492      * <p>All color enhancement and tonemapping must be disabled, except
   2493      * for applying the tonemapping curve specified by
   2494      * {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
   2495      * <p>Must not slow down frame rate relative to raw
   2496      * sensor output.</p>
   2497      *
   2498      * @see CaptureRequest#TONEMAP_CURVE
   2499      * @see CaptureRequest#TONEMAP_MODE
   2500      */
   2501     public static final int TONEMAP_MODE_CONTRAST_CURVE = 0;
   2502 
   2503     /**
   2504      * <p>Advanced gamma mapping and color enhancement may be applied, without
   2505      * reducing frame rate compared to raw sensor output.</p>
   2506      * @see CaptureRequest#TONEMAP_MODE
   2507      */
   2508     public static final int TONEMAP_MODE_FAST = 1;
   2509 
   2510     /**
   2511      * <p>High-quality gamma mapping and color enhancement will be applied, at
   2512      * the cost of possibly reduced frame rate compared to raw sensor output.</p>
   2513      * @see CaptureRequest#TONEMAP_MODE
   2514      */
   2515     public static final int TONEMAP_MODE_HIGH_QUALITY = 2;
   2516 
   2517     /**
   2518      * <p>Use the gamma value specified in {@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma} to peform
   2519      * tonemapping.</p>
   2520      * <p>All color enhancement and tonemapping must be disabled, except
   2521      * for applying the tonemapping curve specified by {@link CaptureRequest#TONEMAP_GAMMA android.tonemap.gamma}.</p>
   2522      * <p>Must not slow down frame rate relative to raw sensor output.</p>
   2523      *
   2524      * @see CaptureRequest#TONEMAP_GAMMA
   2525      * @see CaptureRequest#TONEMAP_MODE
   2526      */
   2527     public static final int TONEMAP_MODE_GAMMA_VALUE = 3;
   2528 
   2529     /**
   2530      * <p>Use the preset tonemapping curve specified in
   2531      * {@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve} to peform tonemapping.</p>
   2532      * <p>All color enhancement and tonemapping must be disabled, except
   2533      * for applying the tonemapping curve specified by
   2534      * {@link CaptureRequest#TONEMAP_PRESET_CURVE android.tonemap.presetCurve}.</p>
   2535      * <p>Must not slow down frame rate relative to raw sensor output.</p>
   2536      *
   2537      * @see CaptureRequest#TONEMAP_PRESET_CURVE
   2538      * @see CaptureRequest#TONEMAP_MODE
   2539      */
   2540     public static final int TONEMAP_MODE_PRESET_CURVE = 4;
   2541 
   2542     //
   2543     // Enumeration values for CaptureRequest#TONEMAP_PRESET_CURVE
   2544     //
   2545 
   2546     /**
   2547      * <p>Tonemapping curve is defined by sRGB</p>
   2548      * @see CaptureRequest#TONEMAP_PRESET_CURVE
   2549      */
   2550     public static final int TONEMAP_PRESET_CURVE_SRGB = 0;
   2551 
   2552     /**
   2553      * <p>Tonemapping curve is defined by ITU-R BT.709</p>
   2554      * @see CaptureRequest#TONEMAP_PRESET_CURVE
   2555      */
   2556     public static final int TONEMAP_PRESET_CURVE_REC709 = 1;
   2557 
   2558     //
   2559     // Enumeration values for CaptureResult#CONTROL_AE_STATE
   2560     //
   2561 
   2562     /**
   2563      * <p>AE is off or recently reset.</p>
   2564      * <p>When a camera device is opened, it starts in
   2565      * this state. This is a transient state, the camera device may skip reporting
   2566      * this state in capture result.</p>
   2567      * @see CaptureResult#CONTROL_AE_STATE
   2568      */
   2569     public static final int CONTROL_AE_STATE_INACTIVE = 0;
   2570 
   2571     /**
   2572      * <p>AE doesn't yet have a good set of control values
   2573      * for the current scene.</p>
   2574      * <p>This is a transient state, the camera device may skip
   2575      * reporting this state in capture result.</p>
   2576      * @see CaptureResult#CONTROL_AE_STATE
   2577      */
   2578     public static final int CONTROL_AE_STATE_SEARCHING = 1;
   2579 
   2580     /**
   2581      * <p>AE has a good set of control values for the
   2582      * current scene.</p>
   2583      * @see CaptureResult#CONTROL_AE_STATE
   2584      */
   2585     public static final int CONTROL_AE_STATE_CONVERGED = 2;
   2586 
   2587     /**
   2588      * <p>AE has been locked.</p>
   2589      * @see CaptureResult#CONTROL_AE_STATE
   2590      */
   2591     public static final int CONTROL_AE_STATE_LOCKED = 3;
   2592 
   2593     /**
   2594      * <p>AE has a good set of control values, but flash
   2595      * needs to be fired for good quality still
   2596      * capture.</p>
   2597      * @see CaptureResult#CONTROL_AE_STATE
   2598      */
   2599     public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4;
   2600 
   2601     /**
   2602      * <p>AE has been asked to do a precapture sequence
   2603      * and is currently executing it.</p>
   2604      * <p>Precapture can be triggered through setting
   2605      * {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} to START. Currently
   2606      * active and completed (if it causes camera device internal AE lock) precapture
   2607      * metering sequence can be canceled through setting
   2608      * {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} to CANCEL.</p>
   2609      * <p>Once PRECAPTURE completes, AE will transition to CONVERGED
   2610      * or FLASH_REQUIRED as appropriate. This is a transient
   2611      * state, the camera device may skip reporting this state in
   2612      * capture result.</p>
   2613      *
   2614      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
   2615      * @see CaptureResult#CONTROL_AE_STATE
   2616      */
   2617     public static final int CONTROL_AE_STATE_PRECAPTURE = 5;
   2618 
   2619     //
   2620     // Enumeration values for CaptureResult#CONTROL_AF_STATE
   2621     //
   2622 
   2623     /**
   2624      * <p>AF is off or has not yet tried to scan/been asked
   2625      * to scan.</p>
   2626      * <p>When a camera device is opened, it starts in this
   2627      * state. This is a transient state, the camera device may
   2628      * skip reporting this state in capture
   2629      * result.</p>
   2630      * @see CaptureResult#CONTROL_AF_STATE
   2631      */
   2632     public static final int CONTROL_AF_STATE_INACTIVE = 0;
   2633 
   2634     /**
   2635      * <p>AF is currently performing an AF scan initiated the
   2636      * camera device in a continuous autofocus mode.</p>
   2637      * <p>Only used by CONTINUOUS_* AF modes. This is a transient
   2638      * state, the camera device may skip reporting this state in
   2639      * capture result.</p>
   2640      * @see CaptureResult#CONTROL_AF_STATE
   2641      */
   2642     public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1;
   2643 
   2644     /**
   2645      * <p>AF currently believes it is in focus, but may
   2646      * restart scanning at any time.</p>
   2647      * <p>Only used by CONTINUOUS_* AF modes. This is a transient
   2648      * state, the camera device may skip reporting this state in
   2649      * capture result.</p>
   2650      * @see CaptureResult#CONTROL_AF_STATE
   2651      */
   2652     public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2;
   2653 
   2654     /**
   2655      * <p>AF is performing an AF scan because it was
   2656      * triggered by AF trigger.</p>
   2657      * <p>Only used by AUTO or MACRO AF modes. This is a transient
   2658      * state, the camera device may skip reporting this state in
   2659      * capture result.</p>
   2660      * @see CaptureResult#CONTROL_AF_STATE
   2661      */
   2662     public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3;
   2663 
   2664     /**
   2665      * <p>AF believes it is focused correctly and has locked
   2666      * focus.</p>
   2667      * <p>This state is reached only after an explicit START AF trigger has been
   2668      * sent ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}), when good focus has been obtained.</p>
   2669      * <p>The lens will remain stationary until the AF mode ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) is changed or
   2670      * a new AF trigger is sent to the camera device ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}).</p>
   2671      *
   2672      * @see CaptureRequest#CONTROL_AF_MODE
   2673      * @see CaptureRequest#CONTROL_AF_TRIGGER
   2674      * @see CaptureResult#CONTROL_AF_STATE
   2675      */
   2676     public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4;
   2677 
   2678     /**
   2679      * <p>AF has failed to focus successfully and has locked
   2680      * focus.</p>
   2681      * <p>This state is reached only after an explicit START AF trigger has been
   2682      * sent ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}), when good focus cannot be obtained.</p>
   2683      * <p>The lens will remain stationary until the AF mode ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) is changed or
   2684      * a new AF trigger is sent to the camera device ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}).</p>
   2685      *
   2686      * @see CaptureRequest#CONTROL_AF_MODE
   2687      * @see CaptureRequest#CONTROL_AF_TRIGGER
   2688      * @see CaptureResult#CONTROL_AF_STATE
   2689      */
   2690     public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5;
   2691 
   2692     /**
   2693      * <p>AF finished a passive scan without finding focus,
   2694      * and may restart scanning at any time.</p>
   2695      * <p>Only used by CONTINUOUS_* AF modes. This is a transient state, the camera
   2696      * device may skip reporting this state in capture result.</p>
   2697      * <p>LEGACY camera devices do not support this state. When a passive
   2698      * scan has finished, it will always go to PASSIVE_FOCUSED.</p>
   2699      * @see CaptureResult#CONTROL_AF_STATE
   2700      */
   2701     public static final int CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6;
   2702 
   2703     //
   2704     // Enumeration values for CaptureResult#CONTROL_AWB_STATE
   2705     //
   2706 
   2707     /**
   2708      * <p>AWB is not in auto mode, or has not yet started metering.</p>
   2709      * <p>When a camera device is opened, it starts in this
   2710      * state. This is a transient state, the camera device may
   2711      * skip reporting this state in capture
   2712      * result.</p>
   2713      * @see CaptureResult#CONTROL_AWB_STATE
   2714      */
   2715     public static final int CONTROL_AWB_STATE_INACTIVE = 0;
   2716 
   2717     /**
   2718      * <p>AWB doesn't yet have a good set of control
   2719      * values for the current scene.</p>
   2720      * <p>This is a transient state, the camera device
   2721      * may skip reporting this state in capture result.</p>
   2722      * @see CaptureResult#CONTROL_AWB_STATE
   2723      */
   2724     public static final int CONTROL_AWB_STATE_SEARCHING = 1;
   2725 
   2726     /**
   2727      * <p>AWB has a good set of control values for the
   2728      * current scene.</p>
   2729      * @see CaptureResult#CONTROL_AWB_STATE
   2730      */
   2731     public static final int CONTROL_AWB_STATE_CONVERGED = 2;
   2732 
   2733     /**
   2734      * <p>AWB has been locked.</p>
   2735      * @see CaptureResult#CONTROL_AWB_STATE
   2736      */
   2737     public static final int CONTROL_AWB_STATE_LOCKED = 3;
   2738 
   2739     //
   2740     // Enumeration values for CaptureResult#FLASH_STATE
   2741     //
   2742 
   2743     /**
   2744      * <p>No flash on camera.</p>
   2745      * @see CaptureResult#FLASH_STATE
   2746      */
   2747     public static final int FLASH_STATE_UNAVAILABLE = 0;
   2748 
   2749     /**
   2750      * <p>Flash is charging and cannot be fired.</p>
   2751      * @see CaptureResult#FLASH_STATE
   2752      */
   2753     public static final int FLASH_STATE_CHARGING = 1;
   2754 
   2755     /**
   2756      * <p>Flash is ready to fire.</p>
   2757      * @see CaptureResult#FLASH_STATE
   2758      */
   2759     public static final int FLASH_STATE_READY = 2;
   2760 
   2761     /**
   2762      * <p>Flash fired for this capture.</p>
   2763      * @see CaptureResult#FLASH_STATE
   2764      */
   2765     public static final int FLASH_STATE_FIRED = 3;
   2766 
   2767     /**
   2768      * <p>Flash partially illuminated this frame.</p>
   2769      * <p>This is usually due to the next or previous frame having
   2770      * the flash fire, and the flash spilling into this capture
   2771      * due to hardware limitations.</p>
   2772      * @see CaptureResult#FLASH_STATE
   2773      */
   2774     public static final int FLASH_STATE_PARTIAL = 4;
   2775 
   2776     //
   2777     // Enumeration values for CaptureResult#LENS_STATE
   2778     //
   2779 
   2780     /**
   2781      * <p>The lens parameters ({@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
   2782      * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}) are not changing.</p>
   2783      *
   2784      * @see CaptureRequest#LENS_APERTURE
   2785      * @see CaptureRequest#LENS_FILTER_DENSITY
   2786      * @see CaptureRequest#LENS_FOCAL_LENGTH
   2787      * @see CaptureRequest#LENS_FOCUS_DISTANCE
   2788      * @see CaptureResult#LENS_STATE
   2789      */
   2790     public static final int LENS_STATE_STATIONARY = 0;
   2791 
   2792     /**
   2793      * <p>One or several of the lens parameters
   2794      * ({@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
   2795      * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} or {@link CaptureRequest#LENS_APERTURE android.lens.aperture}) is
   2796      * currently changing.</p>
   2797      *
   2798      * @see CaptureRequest#LENS_APERTURE
   2799      * @see CaptureRequest#LENS_FILTER_DENSITY
   2800      * @see CaptureRequest#LENS_FOCAL_LENGTH
   2801      * @see CaptureRequest#LENS_FOCUS_DISTANCE
   2802      * @see CaptureResult#LENS_STATE
   2803      */
   2804     public static final int LENS_STATE_MOVING = 1;
   2805 
   2806     //
   2807     // Enumeration values for CaptureResult#STATISTICS_SCENE_FLICKER
   2808     //
   2809 
   2810     /**
   2811      * <p>The camera device does not detect any flickering illumination
   2812      * in the current scene.</p>
   2813      * @see CaptureResult#STATISTICS_SCENE_FLICKER
   2814      */
   2815     public static final int STATISTICS_SCENE_FLICKER_NONE = 0;
   2816 
   2817     /**
   2818      * <p>The camera device detects illumination flickering at 50Hz
   2819      * in the current scene.</p>
   2820      * @see CaptureResult#STATISTICS_SCENE_FLICKER
   2821      */
   2822     public static final int STATISTICS_SCENE_FLICKER_50HZ = 1;
   2823 
   2824     /**
   2825      * <p>The camera device detects illumination flickering at 60Hz
   2826      * in the current scene.</p>
   2827      * @see CaptureResult#STATISTICS_SCENE_FLICKER
   2828      */
   2829     public static final int STATISTICS_SCENE_FLICKER_60HZ = 2;
   2830 
   2831     //
   2832     // Enumeration values for CaptureResult#SYNC_FRAME_NUMBER
   2833     //
   2834 
   2835     /**
   2836      * <p>The current result is not yet fully synchronized to any request.</p>
   2837      * <p>Synchronization is in progress, and reading metadata from this
   2838      * result may include a mix of data that have taken effect since the
   2839      * last synchronization time.</p>
   2840      * <p>In some future result, within {@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} frames,
   2841      * this value will update to the actual frame number frame number
   2842      * the result is guaranteed to be synchronized to (as long as the
   2843      * request settings remain constant).</p>
   2844      *
   2845      * @see CameraCharacteristics#SYNC_MAX_LATENCY
   2846      * @see CaptureResult#SYNC_FRAME_NUMBER
   2847      * @hide
   2848      */
   2849     public static final int SYNC_FRAME_NUMBER_CONVERGING = -1;
   2850 
   2851     /**
   2852      * <p>The current result's synchronization status is unknown.</p>
   2853      * <p>The result may have already converged, or it may be in
   2854      * progress.  Reading from this result may include some mix
   2855      * of settings from past requests.</p>
   2856      * <p>After a settings change, the new settings will eventually all
   2857      * take effect for the output buffers and results. However, this
   2858      * value will not change when that happens. Altering settings
   2859      * rapidly may provide outcomes using mixes of settings from recent
   2860      * requests.</p>
   2861      * <p>This value is intended primarily for backwards compatibility with
   2862      * the older camera implementations (for android.hardware.Camera).</p>
   2863      * @see CaptureResult#SYNC_FRAME_NUMBER
   2864      * @hide
   2865      */
   2866     public static final int SYNC_FRAME_NUMBER_UNKNOWN = -2;
   2867 
   2868     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
   2869      * End generated code
   2870      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
   2871 
   2872 }
   2873