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.hardware.camera2.impl.CameraMetadataNative;
     20 
     21 import java.lang.reflect.Field;
     22 import java.lang.reflect.Modifier;
     23 import java.util.ArrayList;
     24 import java.util.Collections;
     25 import java.util.List;
     26 
     27 /**
     28  * The base class for camera controls and information.
     29  *
     30  * <p>
     31  * This class defines the basic key/value map used for querying for camera
     32  * characteristics or capture results, and for setting camera request
     33  * parameters.
     34  * </p>
     35  *
     36  * <p>
     37  * All instances of CameraMetadata are immutable. The list of keys with {@link #getKeys()}
     38  * never changes, nor do the values returned by any key with {@link #get} throughout
     39  * the lifetime of the object.
     40  * </p>
     41  *
     42  * @see CameraDevice
     43  * @see CameraManager
     44  * @see CameraCharacteristics
     45  **/
     46 public abstract class CameraMetadata {
     47 
     48     /**
     49      * Set a camera metadata field to a value. The field definitions can be
     50      * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
     51      * {@link CaptureRequest}.
     52      *
     53      * @param key The metadata field to write.
     54      * @param value The value to set the field to, which must be of a matching
     55      * type to the key.
     56      *
     57      * @hide
     58      */
     59     protected CameraMetadata() {
     60     }
     61 
     62     /**
     63      * Get a camera metadata field value.
     64      *
     65      * <p>The field definitions can be
     66      * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
     67      * {@link CaptureRequest}.</p>
     68      *
     69      * <p>Querying the value for the same key more than once will return a value
     70      * which is equal to the previous queried value.</p>
     71      *
     72      * @throws IllegalArgumentException if the key was not valid
     73      *
     74      * @param key The metadata field to read.
     75      * @return The value of that key, or {@code null} if the field is not set.
     76      */
     77     public abstract <T> T get(Key<T> key);
     78 
     79     /**
     80      * Returns a list of the keys contained in this map.
     81      *
     82      * <p>The list returned is not modifiable, so any attempts to modify it will throw
     83      * a {@code UnsupportedOperationException}.</p>
     84      *
     85      * <p>All values retrieved by a key from this list with {@link #get} are guaranteed to be
     86      * non-{@code null}. Each key is only listed once in the list. The order of the keys
     87      * is undefined.</p>
     88      *
     89      * @return List of the keys contained in this map.
     90      */
     91     public List<Key<?>> getKeys() {
     92         return Collections.unmodifiableList(getKeysStatic(this.getClass(), this));
     93     }
     94 
     95     /**
     96      * Return a list of all the Key<?> that are declared as a field inside of the class
     97      * {@code type}.
     98      *
     99      * <p>
    100      * Optionally, if {@code instance} is not null, then filter out any keys with null values.
    101      * </p>
    102      */
    103     /*package*/ static ArrayList<Key<?>> getKeysStatic(Class<? extends CameraMetadata> type,
    104             CameraMetadata instance) {
    105         ArrayList<Key<?>> keyList = new ArrayList<Key<?>>();
    106 
    107         Field[] fields = type.getDeclaredFields();
    108         for (Field field : fields) {
    109             // Filter for Keys that are public
    110             if (field.getType().isAssignableFrom(Key.class) &&
    111                     (field.getModifiers() & Modifier.PUBLIC) != 0) {
    112                 Key<?> key;
    113                 try {
    114                     key = (Key<?>) field.get(instance);
    115                 } catch (IllegalAccessException e) {
    116                     throw new AssertionError("Can't get IllegalAccessException", e);
    117                 } catch (IllegalArgumentException e) {
    118                     throw new AssertionError("Can't get IllegalArgumentException", e);
    119                 }
    120                 if (instance == null || instance.get(key) != null) {
    121                     keyList.add(key);
    122                 }
    123             }
    124         }
    125 
    126         return keyList;
    127     }
    128 
    129     public static class Key<T> {
    130 
    131         private boolean mHasTag;
    132         private int mTag;
    133         private final Class<T> mType;
    134         private final String mName;
    135 
    136         /**
    137          * @hide
    138          */
    139         public Key(String name, Class<T> type) {
    140             if (name == null) {
    141                 throw new NullPointerException("Key needs a valid name");
    142             } else if (type == null) {
    143                 throw new NullPointerException("Type needs to be non-null");
    144             }
    145             mName = name;
    146             mType = type;
    147         }
    148 
    149         public final String getName() {
    150             return mName;
    151         }
    152 
    153         @Override
    154         public final int hashCode() {
    155             return mName.hashCode();
    156         }
    157 
    158         @Override
    159         @SuppressWarnings("unchecked")
    160         public final boolean equals(Object o) {
    161             if (this == o) {
    162                 return true;
    163             }
    164 
    165             if (!(o instanceof Key)) {
    166                 return false;
    167             }
    168 
    169             Key lhs = (Key) o;
    170 
    171             return mName.equals(lhs.mName);
    172         }
    173 
    174         /**
    175          * <p>
    176          * Get the tag corresponding to this key. This enables insertion into the
    177          * native metadata.
    178          * </p>
    179          *
    180          * <p>This value is looked up the first time, and cached subsequently.</p>
    181          *
    182          * @return The tag numeric value corresponding to the string
    183          *
    184          * @hide
    185          */
    186         public final int getTag() {
    187             if (!mHasTag) {
    188                 mTag = CameraMetadataNative.getTag(mName);
    189                 mHasTag = true;
    190             }
    191             return mTag;
    192         }
    193 
    194         /**
    195          * @hide
    196          */
    197         public final Class<T> getType() {
    198             return mType;
    199         }
    200     }
    201 
    202     /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
    203      * The enum values below this point are generated from metadata
    204      * definitions in /system/media/camera/docs. Do not modify by hand or
    205      * modify the comment blocks at the start or end.
    206      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
    207 
    208     //
    209     // Enumeration values for CameraCharacteristics#LENS_FACING
    210     //
    211 
    212     /**
    213      * @see CameraCharacteristics#LENS_FACING
    214      */
    215     public static final int LENS_FACING_FRONT = 0;
    216 
    217     /**
    218      * @see CameraCharacteristics#LENS_FACING
    219      */
    220     public static final int LENS_FACING_BACK = 1;
    221 
    222     //
    223     // Enumeration values for CameraCharacteristics#LED_AVAILABLE_LEDS
    224     //
    225 
    226     /**
    227      * <p>
    228      * android.led.transmit control is used
    229      * </p>
    230      * @see CameraCharacteristics#LED_AVAILABLE_LEDS
    231      * @hide
    232      */
    233     public static final int LED_AVAILABLE_LEDS_TRANSMIT = 0;
    234 
    235     //
    236     // Enumeration values for CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    237     //
    238 
    239     /**
    240      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    241      */
    242     public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0;
    243 
    244     /**
    245      * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
    246      */
    247     public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1;
    248 
    249     //
    250     // Enumeration values for CaptureRequest#COLOR_CORRECTION_MODE
    251     //
    252 
    253     /**
    254      * <p>
    255      * Use the android.colorCorrection.transform matrix
    256      * and android.colorCorrection.gains to do color conversion
    257      * </p>
    258      * @see CaptureRequest#COLOR_CORRECTION_MODE
    259      */
    260     public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0;
    261 
    262     /**
    263      * <p>
    264      * Must not slow down frame rate relative to raw
    265      * bayer output
    266      * </p>
    267      * @see CaptureRequest#COLOR_CORRECTION_MODE
    268      */
    269     public static final int COLOR_CORRECTION_MODE_FAST = 1;
    270 
    271     /**
    272      * <p>
    273      * Frame rate may be reduced by high
    274      * quality
    275      * </p>
    276      * @see CaptureRequest#COLOR_CORRECTION_MODE
    277      */
    278     public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2;
    279 
    280     //
    281     // Enumeration values for CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
    282     //
    283 
    284     /**
    285      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
    286      */
    287     public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0;
    288 
    289     /**
    290      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
    291      */
    292     public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1;
    293 
    294     /**
    295      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
    296      */
    297     public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2;
    298 
    299     /**
    300      * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
    301      */
    302     public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3;
    303 
    304     //
    305     // Enumeration values for CaptureRequest#CONTROL_AE_MODE
    306     //
    307 
    308     /**
    309      * <p>
    310      * Autoexposure is disabled; sensor.exposureTime,
    311      * sensor.sensitivity and sensor.frameDuration are used
    312      * </p>
    313      * @see CaptureRequest#CONTROL_AE_MODE
    314      */
    315     public static final int CONTROL_AE_MODE_OFF = 0;
    316 
    317     /**
    318      * <p>
    319      * Autoexposure is active, no flash
    320      * control
    321      * </p>
    322      * @see CaptureRequest#CONTROL_AE_MODE
    323      */
    324     public static final int CONTROL_AE_MODE_ON = 1;
    325 
    326     /**
    327      * <p>
    328      * if flash exists Autoexposure is active, auto
    329      * flash control; flash may be fired when precapture
    330      * trigger is activated, and for captures for which
    331      * captureIntent = STILL_CAPTURE
    332      * </p>
    333      * @see CaptureRequest#CONTROL_AE_MODE
    334      */
    335     public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2;
    336 
    337     /**
    338      * <p>
    339      * if flash exists Autoexposure is active, auto
    340      * flash control for precapture trigger and always flash
    341      * when captureIntent = STILL_CAPTURE
    342      * </p>
    343      * @see CaptureRequest#CONTROL_AE_MODE
    344      */
    345     public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3;
    346 
    347     /**
    348      * <p>
    349      * optional Automatic red eye reduction with flash.
    350      * If deemed necessary, red eye reduction sequence should
    351      * fire when precapture trigger is activated, and final
    352      * flash should fire when captureIntent =
    353      * STILL_CAPTURE
    354      * </p>
    355      * @see CaptureRequest#CONTROL_AE_MODE
    356      */
    357     public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4;
    358 
    359     //
    360     // Enumeration values for CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
    361     //
    362 
    363     /**
    364      * <p>
    365      * The trigger is idle.
    366      * </p>
    367      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
    368      */
    369     public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0;
    370 
    371     /**
    372      * <p>
    373      * The precapture metering sequence
    374      * must be started. The exact effect of the precapture
    375      * trigger depends on the current AE mode and
    376      * state.
    377      * </p>
    378      * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
    379      */
    380     public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1;
    381 
    382     //
    383     // Enumeration values for CaptureRequest#CONTROL_AF_MODE
    384     //
    385 
    386     /**
    387      * <p>
    388      * The 3A routines do not control the lens;
    389      * android.lens.focusDistance is controlled by the
    390      * application
    391      * </p>
    392      * @see CaptureRequest#CONTROL_AF_MODE
    393      */
    394     public static final int CONTROL_AF_MODE_OFF = 0;
    395 
    396     /**
    397      * <p>
    398      * if lens is not fixed focus.
    399      * </p><p>
    400      * Use android.lens.minimumFocusDistance to determine if lens
    401      * is fixed focus In this mode, the lens does not move unless
    402      * the autofocus trigger action is called. When that trigger
    403      * is activated, AF must transition to ACTIVE_SCAN, then to
    404      * the outcome of the scan (FOCUSED or
    405      * NOT_FOCUSED).
    406      * </p><p>
    407      * Triggering cancel AF resets the lens position to default,
    408      * and sets the AF state to INACTIVE.
    409      * </p>
    410      * @see CaptureRequest#CONTROL_AF_MODE
    411      */
    412     public static final int CONTROL_AF_MODE_AUTO = 1;
    413 
    414     /**
    415      * <p>
    416      * In this mode, the lens does not move unless the
    417      * autofocus trigger action is called.
    418      * </p><p>
    419      * When that trigger is activated, AF must transition to
    420      * ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or
    421      * NOT_FOCUSED).  Triggering cancel AF resets the lens
    422      * position to default, and sets the AF state to
    423      * INACTIVE.
    424      * </p>
    425      * @see CaptureRequest#CONTROL_AF_MODE
    426      */
    427     public static final int CONTROL_AF_MODE_MACRO = 2;
    428 
    429     /**
    430      * <p>
    431      * In this mode, the AF algorithm modifies the lens
    432      * position continually to attempt to provide a
    433      * constantly-in-focus image stream.
    434      * </p><p>
    435      * The focusing behavior should be suitable for good quality
    436      * video recording; typically this means slower focus
    437      * movement and no overshoots. When the AF trigger is not
    438      * involved, the AF algorithm should start in INACTIVE state,
    439      * and then transition into PASSIVE_SCAN and PASSIVE_FOCUSED
    440      * states as appropriate. When the AF trigger is activated,
    441      * the algorithm should immediately transition into
    442      * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
    443      * lens position until a cancel AF trigger is received.
    444      * </p><p>
    445      * Once cancel is received, the algorithm should transition
    446      * back to INACTIVE and resume passive scan. Note that this
    447      * behavior is not identical to CONTINUOUS_PICTURE, since an
    448      * ongoing PASSIVE_SCAN must immediately be
    449      * canceled.
    450      * </p>
    451      * @see CaptureRequest#CONTROL_AF_MODE
    452      */
    453     public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3;
    454 
    455     /**
    456      * <p>
    457      * In this mode, the AF algorithm modifies the lens
    458      * position continually to attempt to provide a
    459      * constantly-in-focus image stream.
    460      * </p><p>
    461      * The focusing behavior should be suitable for still image
    462      * capture; typically this means focusing as fast as
    463      * possible. When the AF trigger is not involved, the AF
    464      * algorithm should start in INACTIVE state, and then
    465      * transition into PASSIVE_SCAN and PASSIVE_FOCUSED states as
    466      * appropriate as it attempts to maintain focus. When the AF
    467      * trigger is activated, the algorithm should finish its
    468      * PASSIVE_SCAN if active, and then transition into
    469      * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
    470      * lens position until a cancel AF trigger is received.
    471      * </p><p>
    472      * When the AF cancel trigger is activated, the algorithm
    473      * should transition back to INACTIVE and then act as if it
    474      * has just been started.
    475      * </p>
    476      * @see CaptureRequest#CONTROL_AF_MODE
    477      */
    478     public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4;
    479 
    480     /**
    481      * <p>
    482      * Extended depth of field (digital focus). AF
    483      * trigger is ignored, AF state should always be
    484      * INACTIVE.
    485      * </p>
    486      * @see CaptureRequest#CONTROL_AF_MODE
    487      */
    488     public static final int CONTROL_AF_MODE_EDOF = 5;
    489 
    490     //
    491     // Enumeration values for CaptureRequest#CONTROL_AF_TRIGGER
    492     //
    493 
    494     /**
    495      * <p>
    496      * The trigger is idle.
    497      * </p>
    498      * @see CaptureRequest#CONTROL_AF_TRIGGER
    499      */
    500     public static final int CONTROL_AF_TRIGGER_IDLE = 0;
    501 
    502     /**
    503      * <p>
    504      * Autofocus must trigger now.
    505      * </p>
    506      * @see CaptureRequest#CONTROL_AF_TRIGGER
    507      */
    508     public static final int CONTROL_AF_TRIGGER_START = 1;
    509 
    510     /**
    511      * <p>
    512      * Autofocus must return to initial
    513      * state, and cancel any active trigger.
    514      * </p>
    515      * @see CaptureRequest#CONTROL_AF_TRIGGER
    516      */
    517     public static final int CONTROL_AF_TRIGGER_CANCEL = 2;
    518 
    519     //
    520     // Enumeration values for CaptureRequest#CONTROL_AWB_MODE
    521     //
    522 
    523     /**
    524      * @see CaptureRequest#CONTROL_AWB_MODE
    525      */
    526     public static final int CONTROL_AWB_MODE_OFF = 0;
    527 
    528     /**
    529      * @see CaptureRequest#CONTROL_AWB_MODE
    530      */
    531     public static final int CONTROL_AWB_MODE_AUTO = 1;
    532 
    533     /**
    534      * @see CaptureRequest#CONTROL_AWB_MODE
    535      */
    536     public static final int CONTROL_AWB_MODE_INCANDESCENT = 2;
    537 
    538     /**
    539      * @see CaptureRequest#CONTROL_AWB_MODE
    540      */
    541     public static final int CONTROL_AWB_MODE_FLUORESCENT = 3;
    542 
    543     /**
    544      * @see CaptureRequest#CONTROL_AWB_MODE
    545      */
    546     public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4;
    547 
    548     /**
    549      * @see CaptureRequest#CONTROL_AWB_MODE
    550      */
    551     public static final int CONTROL_AWB_MODE_DAYLIGHT = 5;
    552 
    553     /**
    554      * @see CaptureRequest#CONTROL_AWB_MODE
    555      */
    556     public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6;
    557 
    558     /**
    559      * @see CaptureRequest#CONTROL_AWB_MODE
    560      */
    561     public static final int CONTROL_AWB_MODE_TWILIGHT = 7;
    562 
    563     /**
    564      * @see CaptureRequest#CONTROL_AWB_MODE
    565      */
    566     public static final int CONTROL_AWB_MODE_SHADE = 8;
    567 
    568     //
    569     // Enumeration values for CaptureRequest#CONTROL_CAPTURE_INTENT
    570     //
    571 
    572     /**
    573      * <p>
    574      * This request doesn't fall into the other
    575      * categories. Default to preview-like
    576      * behavior.
    577      * </p>
    578      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
    579      */
    580     public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0;
    581 
    582     /**
    583      * <p>
    584      * This request is for a preview-like usecase. The
    585      * precapture trigger may be used to start off a metering
    586      * w/flash sequence
    587      * </p>
    588      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
    589      */
    590     public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1;
    591 
    592     /**
    593      * <p>
    594      * This request is for a still capture-type
    595      * usecase.
    596      * </p>
    597      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
    598      */
    599     public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2;
    600 
    601     /**
    602      * <p>
    603      * This request is for a video recording
    604      * usecase.
    605      * </p>
    606      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
    607      */
    608     public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3;
    609 
    610     /**
    611      * <p>
    612      * This request is for a video snapshot (still
    613      * image while recording video) usecase
    614      * </p>
    615      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
    616      */
    617     public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4;
    618 
    619     /**
    620      * <p>
    621      * This request is for a ZSL usecase; the
    622      * application will stream full-resolution images and
    623      * reprocess one or several later for a final
    624      * capture
    625      * </p>
    626      * @see CaptureRequest#CONTROL_CAPTURE_INTENT
    627      */
    628     public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5;
    629 
    630     //
    631     // Enumeration values for CaptureRequest#CONTROL_EFFECT_MODE
    632     //
    633 
    634     /**
    635      * @see CaptureRequest#CONTROL_EFFECT_MODE
    636      */
    637     public static final int CONTROL_EFFECT_MODE_OFF = 0;
    638 
    639     /**
    640      * @see CaptureRequest#CONTROL_EFFECT_MODE
    641      */
    642     public static final int CONTROL_EFFECT_MODE_MONO = 1;
    643 
    644     /**
    645      * @see CaptureRequest#CONTROL_EFFECT_MODE
    646      */
    647     public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2;
    648 
    649     /**
    650      * @see CaptureRequest#CONTROL_EFFECT_MODE
    651      */
    652     public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3;
    653 
    654     /**
    655      * @see CaptureRequest#CONTROL_EFFECT_MODE
    656      */
    657     public static final int CONTROL_EFFECT_MODE_SEPIA = 4;
    658 
    659     /**
    660      * @see CaptureRequest#CONTROL_EFFECT_MODE
    661      */
    662     public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5;
    663 
    664     /**
    665      * @see CaptureRequest#CONTROL_EFFECT_MODE
    666      */
    667     public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6;
    668 
    669     /**
    670      * @see CaptureRequest#CONTROL_EFFECT_MODE
    671      */
    672     public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7;
    673 
    674     /**
    675      * @see CaptureRequest#CONTROL_EFFECT_MODE
    676      */
    677     public static final int CONTROL_EFFECT_MODE_AQUA = 8;
    678 
    679     //
    680     // Enumeration values for CaptureRequest#CONTROL_MODE
    681     //
    682 
    683     /**
    684      * <p>
    685      * Full application control of pipeline. All 3A
    686      * routines are disabled, no other settings in
    687      * android.control.* have any effect
    688      * </p>
    689      * @see CaptureRequest#CONTROL_MODE
    690      */
    691     public static final int CONTROL_MODE_OFF = 0;
    692 
    693     /**
    694      * <p>
    695      * Use settings for each individual 3A routine.
    696      * Manual control of capture parameters is disabled. All
    697      * controls in android.control.* besides sceneMode take
    698      * effect
    699      * </p>
    700      * @see CaptureRequest#CONTROL_MODE
    701      */
    702     public static final int CONTROL_MODE_AUTO = 1;
    703 
    704     /**
    705      * <p>
    706      * Use specific scene mode. Enabling this disables
    707      * control.aeMode, control.awbMode and control.afMode
    708      * controls; the HAL must ignore those settings while
    709      * USE_SCENE_MODE is active (except for FACE_PRIORITY
    710      * scene mode). Other control entries are still active.
    711      * This setting can only be used if availableSceneModes !=
    712      * UNSUPPORTED
    713      * </p>
    714      * @see CaptureRequest#CONTROL_MODE
    715      */
    716     public static final int CONTROL_MODE_USE_SCENE_MODE = 2;
    717 
    718     //
    719     // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE
    720     //
    721 
    722     /**
    723      * @see CaptureRequest#CONTROL_SCENE_MODE
    724      */
    725     public static final int CONTROL_SCENE_MODE_UNSUPPORTED = 0;
    726 
    727     /**
    728      * <p>
    729      * if face detection support exists Use face
    730      * detection data to drive 3A routines. If face detection
    731      * statistics are disabled, should still operate correctly
    732      * (but not return face detection statistics to the
    733      * framework).
    734      * </p><p>
    735      * Unlike the other scene modes, aeMode, awbMode, and afMode
    736      * remain active when FACE_PRIORITY is set. This is due to
    737      * compatibility concerns with the old camera
    738      * API
    739      * </p>
    740      * @see CaptureRequest#CONTROL_SCENE_MODE
    741      */
    742     public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1;
    743 
    744     /**
    745      * @see CaptureRequest#CONTROL_SCENE_MODE
    746      */
    747     public static final int CONTROL_SCENE_MODE_ACTION = 2;
    748 
    749     /**
    750      * @see CaptureRequest#CONTROL_SCENE_MODE
    751      */
    752     public static final int CONTROL_SCENE_MODE_PORTRAIT = 3;
    753 
    754     /**
    755      * @see CaptureRequest#CONTROL_SCENE_MODE
    756      */
    757     public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4;
    758 
    759     /**
    760      * @see CaptureRequest#CONTROL_SCENE_MODE
    761      */
    762     public static final int CONTROL_SCENE_MODE_NIGHT = 5;
    763 
    764     /**
    765      * @see CaptureRequest#CONTROL_SCENE_MODE
    766      */
    767     public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6;
    768 
    769     /**
    770      * @see CaptureRequest#CONTROL_SCENE_MODE
    771      */
    772     public static final int CONTROL_SCENE_MODE_THEATRE = 7;
    773 
    774     /**
    775      * @see CaptureRequest#CONTROL_SCENE_MODE
    776      */
    777     public static final int CONTROL_SCENE_MODE_BEACH = 8;
    778 
    779     /**
    780      * @see CaptureRequest#CONTROL_SCENE_MODE
    781      */
    782     public static final int CONTROL_SCENE_MODE_SNOW = 9;
    783 
    784     /**
    785      * @see CaptureRequest#CONTROL_SCENE_MODE
    786      */
    787     public static final int CONTROL_SCENE_MODE_SUNSET = 10;
    788 
    789     /**
    790      * @see CaptureRequest#CONTROL_SCENE_MODE
    791      */
    792     public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11;
    793 
    794     /**
    795      * @see CaptureRequest#CONTROL_SCENE_MODE
    796      */
    797     public static final int CONTROL_SCENE_MODE_FIREWORKS = 12;
    798 
    799     /**
    800      * @see CaptureRequest#CONTROL_SCENE_MODE
    801      */
    802     public static final int CONTROL_SCENE_MODE_SPORTS = 13;
    803 
    804     /**
    805      * @see CaptureRequest#CONTROL_SCENE_MODE
    806      */
    807     public static final int CONTROL_SCENE_MODE_PARTY = 14;
    808 
    809     /**
    810      * @see CaptureRequest#CONTROL_SCENE_MODE
    811      */
    812     public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15;
    813 
    814     /**
    815      * @see CaptureRequest#CONTROL_SCENE_MODE
    816      */
    817     public static final int CONTROL_SCENE_MODE_BARCODE = 16;
    818 
    819     //
    820     // Enumeration values for CaptureRequest#EDGE_MODE
    821     //
    822 
    823     /**
    824      * <p>
    825      * No edge enhancement is applied
    826      * </p>
    827      * @see CaptureRequest#EDGE_MODE
    828      */
    829     public static final int EDGE_MODE_OFF = 0;
    830 
    831     /**
    832      * <p>
    833      * Must not slow down frame rate relative to raw
    834      * bayer output
    835      * </p>
    836      * @see CaptureRequest#EDGE_MODE
    837      */
    838     public static final int EDGE_MODE_FAST = 1;
    839 
    840     /**
    841      * <p>
    842      * Frame rate may be reduced by high
    843      * quality
    844      * </p>
    845      * @see CaptureRequest#EDGE_MODE
    846      */
    847     public static final int EDGE_MODE_HIGH_QUALITY = 2;
    848 
    849     //
    850     // Enumeration values for CaptureRequest#FLASH_MODE
    851     //
    852 
    853     /**
    854      * <p>
    855      * Do not fire the flash for this
    856      * capture
    857      * </p>
    858      * @see CaptureRequest#FLASH_MODE
    859      */
    860     public static final int FLASH_MODE_OFF = 0;
    861 
    862     /**
    863      * <p>
    864      * if android.flash.available is true Fire flash
    865      * for this capture based on firingPower,
    866      * firingTime.
    867      * </p>
    868      * @see CaptureRequest#FLASH_MODE
    869      */
    870     public static final int FLASH_MODE_SINGLE = 1;
    871 
    872     /**
    873      * <p>
    874      * if android.flash.available is true Flash
    875      * continuously on, power set by
    876      * firingPower
    877      * </p>
    878      * @see CaptureRequest#FLASH_MODE
    879      */
    880     public static final int FLASH_MODE_TORCH = 2;
    881 
    882     //
    883     // Enumeration values for CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
    884     //
    885 
    886     /**
    887      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
    888      */
    889     public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0;
    890 
    891     /**
    892      * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
    893      */
    894     public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1;
    895 
    896     //
    897     // Enumeration values for CaptureRequest#NOISE_REDUCTION_MODE
    898     //
    899 
    900     /**
    901      * <p>
    902      * No noise reduction is applied
    903      * </p>
    904      * @see CaptureRequest#NOISE_REDUCTION_MODE
    905      */
    906     public static final int NOISE_REDUCTION_MODE_OFF = 0;
    907 
    908     /**
    909      * <p>
    910      * Must not slow down frame rate relative to raw
    911      * bayer output
    912      * </p>
    913      * @see CaptureRequest#NOISE_REDUCTION_MODE
    914      */
    915     public static final int NOISE_REDUCTION_MODE_FAST = 1;
    916 
    917     /**
    918      * <p>
    919      * May slow down frame rate to provide highest
    920      * quality
    921      * </p>
    922      * @see CaptureRequest#NOISE_REDUCTION_MODE
    923      */
    924     public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2;
    925 
    926     //
    927     // Enumeration values for CaptureRequest#STATISTICS_FACE_DETECT_MODE
    928     //
    929 
    930     /**
    931      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
    932      */
    933     public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0;
    934 
    935     /**
    936      * <p>
    937      * Optional Return rectangle and confidence
    938      * only
    939      * </p>
    940      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
    941      */
    942     public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1;
    943 
    944     /**
    945      * <p>
    946      * Optional Return all face
    947      * metadata
    948      * </p>
    949      * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
    950      */
    951     public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2;
    952 
    953     //
    954     // Enumeration values for CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
    955     //
    956 
    957     /**
    958      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
    959      */
    960     public static final int STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0;
    961 
    962     /**
    963      * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
    964      */
    965     public static final int STATISTICS_LENS_SHADING_MAP_MODE_ON = 1;
    966 
    967     //
    968     // Enumeration values for CaptureRequest#TONEMAP_MODE
    969     //
    970 
    971     /**
    972      * <p>
    973      * Use the tone mapping curve specified in
    974      * android.tonemap.curve
    975      * </p>
    976      * @see CaptureRequest#TONEMAP_MODE
    977      */
    978     public static final int TONEMAP_MODE_CONTRAST_CURVE = 0;
    979 
    980     /**
    981      * <p>
    982      * Must not slow down frame rate relative to raw
    983      * bayer output
    984      * </p>
    985      * @see CaptureRequest#TONEMAP_MODE
    986      */
    987     public static final int TONEMAP_MODE_FAST = 1;
    988 
    989     /**
    990      * <p>
    991      * Frame rate may be reduced by high
    992      * quality
    993      * </p>
    994      * @see CaptureRequest#TONEMAP_MODE
    995      */
    996     public static final int TONEMAP_MODE_HIGH_QUALITY = 2;
    997 
    998     //
    999     // Enumeration values for CaptureResult#CONTROL_AE_STATE
   1000     //
   1001 
   1002     /**
   1003      * <p>
   1004      * AE is off.  When a camera device is opened, it starts in
   1005      * this state.
   1006      * </p>
   1007      * @see CaptureResult#CONTROL_AE_STATE
   1008      */
   1009     public static final int CONTROL_AE_STATE_INACTIVE = 0;
   1010 
   1011     /**
   1012      * <p>
   1013      * AE doesn't yet have a good set of control values
   1014      * for the current scene
   1015      * </p>
   1016      * @see CaptureResult#CONTROL_AE_STATE
   1017      */
   1018     public static final int CONTROL_AE_STATE_SEARCHING = 1;
   1019 
   1020     /**
   1021      * <p>
   1022      * AE has a good set of control values for the
   1023      * current scene
   1024      * </p>
   1025      * @see CaptureResult#CONTROL_AE_STATE
   1026      */
   1027     public static final int CONTROL_AE_STATE_CONVERGED = 2;
   1028 
   1029     /**
   1030      * <p>
   1031      * AE has been locked (aeMode =
   1032      * LOCKED)
   1033      * </p>
   1034      * @see CaptureResult#CONTROL_AE_STATE
   1035      */
   1036     public static final int CONTROL_AE_STATE_LOCKED = 3;
   1037 
   1038     /**
   1039      * <p>
   1040      * AE has a good set of control values, but flash
   1041      * needs to be fired for good quality still
   1042      * capture
   1043      * </p>
   1044      * @see CaptureResult#CONTROL_AE_STATE
   1045      */
   1046     public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4;
   1047 
   1048     /**
   1049      * <p>
   1050      * AE has been asked to do a precapture sequence
   1051      * (through the
   1052      * trigger_action(CAMERA2_TRIGGER_PRECAPTURE_METERING)
   1053      * call), and is currently executing it. Once PRECAPTURE
   1054      * completes, AE will transition to CONVERGED or
   1055      * FLASH_REQUIRED as appropriate
   1056      * </p>
   1057      * @see CaptureResult#CONTROL_AE_STATE
   1058      */
   1059     public static final int CONTROL_AE_STATE_PRECAPTURE = 5;
   1060 
   1061     //
   1062     // Enumeration values for CaptureResult#CONTROL_AF_STATE
   1063     //
   1064 
   1065     /**
   1066      * <p>
   1067      * AF off or has not yet tried to scan/been asked
   1068      * to scan.  When a camera device is opened, it starts in
   1069      * this state.
   1070      * </p>
   1071      * @see CaptureResult#CONTROL_AF_STATE
   1072      */
   1073     public static final int CONTROL_AF_STATE_INACTIVE = 0;
   1074 
   1075     /**
   1076      * <p>
   1077      * if CONTINUOUS_* modes are supported. AF is
   1078      * currently doing an AF scan initiated by a continuous
   1079      * autofocus mode
   1080      * </p>
   1081      * @see CaptureResult#CONTROL_AF_STATE
   1082      */
   1083     public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1;
   1084 
   1085     /**
   1086      * <p>
   1087      * if CONTINUOUS_* modes are supported. AF currently
   1088      * believes it is in focus, but may restart scanning at
   1089      * any time.
   1090      * </p>
   1091      * @see CaptureResult#CONTROL_AF_STATE
   1092      */
   1093     public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2;
   1094 
   1095     /**
   1096      * <p>
   1097      * if AUTO or MACRO modes are supported. AF is doing
   1098      * an AF scan because it was triggered by AF
   1099      * trigger
   1100      * </p>
   1101      * @see CaptureResult#CONTROL_AF_STATE
   1102      */
   1103     public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3;
   1104 
   1105     /**
   1106      * <p>
   1107      * if any AF mode besides OFF is supported. AF
   1108      * believes it is focused correctly and is
   1109      * locked
   1110      * </p>
   1111      * @see CaptureResult#CONTROL_AF_STATE
   1112      */
   1113     public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4;
   1114 
   1115     /**
   1116      * <p>
   1117      * if any AF mode besides OFF is supported. AF has
   1118      * failed to focus successfully and is
   1119      * locked
   1120      * </p>
   1121      * @see CaptureResult#CONTROL_AF_STATE
   1122      */
   1123     public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5;
   1124 
   1125     /**
   1126      * <p>
   1127      * if CONTINUOUS_* modes are supported. AF finished a
   1128      * passive scan without finding focus, and may restart
   1129      * scanning at any time.
   1130      * </p>
   1131      * @see CaptureResult#CONTROL_AF_STATE
   1132      */
   1133     public static final int CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6;
   1134 
   1135     //
   1136     // Enumeration values for CaptureResult#CONTROL_AWB_STATE
   1137     //
   1138 
   1139     /**
   1140      * <p>
   1141      * AWB is not in auto mode.  When a camera device is opened, it
   1142      * starts in this state.
   1143      * </p>
   1144      * @see CaptureResult#CONTROL_AWB_STATE
   1145      */
   1146     public static final int CONTROL_AWB_STATE_INACTIVE = 0;
   1147 
   1148     /**
   1149      * <p>
   1150      * AWB doesn't yet have a good set of control
   1151      * values for the current scene
   1152      * </p>
   1153      * @see CaptureResult#CONTROL_AWB_STATE
   1154      */
   1155     public static final int CONTROL_AWB_STATE_SEARCHING = 1;
   1156 
   1157     /**
   1158      * <p>
   1159      * AWB has a good set of control values for the
   1160      * current scene
   1161      * </p>
   1162      * @see CaptureResult#CONTROL_AWB_STATE
   1163      */
   1164     public static final int CONTROL_AWB_STATE_CONVERGED = 2;
   1165 
   1166     /**
   1167      * <p>
   1168      * AE has been locked (aeMode =
   1169      * LOCKED)
   1170      * </p>
   1171      * @see CaptureResult#CONTROL_AWB_STATE
   1172      */
   1173     public static final int CONTROL_AWB_STATE_LOCKED = 3;
   1174 
   1175     //
   1176     // Enumeration values for CaptureResult#FLASH_STATE
   1177     //
   1178 
   1179     /**
   1180      * <p>
   1181      * No flash on camera
   1182      * </p>
   1183      * @see CaptureResult#FLASH_STATE
   1184      */
   1185     public static final int FLASH_STATE_UNAVAILABLE = 0;
   1186 
   1187     /**
   1188      * <p>
   1189      * if android.flash.available is true Flash is
   1190      * charging and cannot be fired
   1191      * </p>
   1192      * @see CaptureResult#FLASH_STATE
   1193      */
   1194     public static final int FLASH_STATE_CHARGING = 1;
   1195 
   1196     /**
   1197      * <p>
   1198      * if android.flash.available is true Flash is
   1199      * ready to fire
   1200      * </p>
   1201      * @see CaptureResult#FLASH_STATE
   1202      */
   1203     public static final int FLASH_STATE_READY = 2;
   1204 
   1205     /**
   1206      * <p>
   1207      * if android.flash.available is true Flash fired
   1208      * for this capture
   1209      * </p>
   1210      * @see CaptureResult#FLASH_STATE
   1211      */
   1212     public static final int FLASH_STATE_FIRED = 3;
   1213 
   1214     //
   1215     // Enumeration values for CaptureResult#LENS_STATE
   1216     //
   1217 
   1218     /**
   1219      * @see CaptureResult#LENS_STATE
   1220      */
   1221     public static final int LENS_STATE_STATIONARY = 0;
   1222 
   1223     /**
   1224      * @see CaptureResult#LENS_STATE
   1225      */
   1226     public static final int LENS_STATE_MOVING = 1;
   1227 
   1228     //
   1229     // Enumeration values for CaptureResult#STATISTICS_SCENE_FLICKER
   1230     //
   1231 
   1232     /**
   1233      * @see CaptureResult#STATISTICS_SCENE_FLICKER
   1234      */
   1235     public static final int STATISTICS_SCENE_FLICKER_NONE = 0;
   1236 
   1237     /**
   1238      * @see CaptureResult#STATISTICS_SCENE_FLICKER
   1239      */
   1240     public static final int STATISTICS_SCENE_FLICKER_50HZ = 1;
   1241 
   1242     /**
   1243      * @see CaptureResult#STATISTICS_SCENE_FLICKER
   1244      */
   1245     public static final int STATISTICS_SCENE_FLICKER_60HZ = 2;
   1246 
   1247     /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
   1248      * End generated code
   1249      *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
   1250 
   1251 }
   1252