CameraMetadata.java revision 8d709f3d5381795cdad942f64b9441d54e48d774
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/*
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Copyright (C) 2013 The Android Open Source Project
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Licensed under the Apache License, Version 2.0 (the "License");
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * you may not use this file except in compliance with the License.
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * You may obtain a copy of the License at
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
8868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) *      http://www.apache.org/licenses/LICENSE-2.0
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Unless required by applicable law or agreed to in writing, software
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * distributed under the License is distributed on an "AS IS" BASIS,
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * See the License for the specific language governing permissions and
14c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) * limitations under the License.
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)package android.hardware.camera2;
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import android.hardware.camera2.impl.CameraMetadataNative;
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import android.hardware.camera2.impl.PublicKey;
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import android.hardware.camera2.impl.SyntheticKey;
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import android.util.Log;
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import java.lang.reflect.Field;
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import java.lang.reflect.Modifier;
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import java.util.ArrayList;
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import java.util.Arrays;
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import java.util.Collections;
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)import java.util.List;
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)/**
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * The base class for camera controls and information.
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <p>
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * This class defines the basic key/value map used for querying for camera
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * characteristics or capture results, and for setting camera request
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * parameters.
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * </p>
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * <p>
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * All instances of CameraMetadata are immutable. The list of keys with {@link #getKeys()}
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * never changes, nor do the values returned by any key with {@code #get} throughout
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * the lifetime of the object.
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * </p>
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) *
46a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles) * @see CameraDevice
47c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) * @see CameraManager
482a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) * @see CameraCharacteristics
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) **/
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)public abstract class CameraMetadata<TKey> {
515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    private static final String TAG = "CameraMetadataAb";
535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    private static final boolean VERBOSE = Log.isLoggable(TAG, Log.VERBOSE);
545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * Set a camera metadata field to a value. The field definitions can be
575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * {@link CaptureRequest}.
592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     *
602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @param key The metadata field to write.
61c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @param value The value to set the field to, which must be of a matching
62c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * type to the key.
63c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
64c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @hide
65c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
66c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    protected CameraMetadata() {
67c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    }
68c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
69c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
70c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * Get a camera metadata field value.
71c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
72c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * <p>The field definitions can be
73c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * found in {@link CameraCharacteristics}, {@link CaptureResult}, and
74c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * {@link CaptureRequest}.</p>
75c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
76c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * <p>Querying the value for the same key more than once will return a value
77c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * which is equal to the previous queried value.</p>
78c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
79c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @throws IllegalArgumentException if the key was not valid
80c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
81c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @param key The metadata field to read.
82c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @return The value of that key, or {@code null} if the field is not set.
83c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
84c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @hide
85c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
86c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     protected abstract <T> T getProtected(TKey key);
87c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
88c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     /**
89c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      * @hide
90c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)      */
912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     protected abstract Class<TKey> getKeyClass();
922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * Returns a list of the keys contained in this map.
955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The list returned is not modifiable, so any attempts to modify it will throw
975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * a {@code UnsupportedOperationException}.</p>
985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
992a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <p>All values retrieved by a key from this list with {@code #get} are guaranteed to be
1002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * non-{@code null}. Each key is only listed once in the list. The order of the keys
1012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * is undefined.</p>
1022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     *
1032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @return List of the keys contained in this map.
1042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     */
1052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    @SuppressWarnings("unchecked")
1062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    public List<TKey> getKeys() {
1072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)        Class<CameraMetadata<TKey>> thisClass = (Class<CameraMetadata<TKey>>) getClass();
1082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)        return Collections.unmodifiableList(
1092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                getKeysStatic(thisClass, getKeyClass(), this, /*filterTags*/null));
1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    }
1112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * Return a list of all the Key<?> that are declared as a field inside of the class
1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * {@code type}.
1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>
1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * Optionally, if {@code instance} is not null, then filter out any keys with null values.
1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </p>
1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>
12190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * Optionally, if {@code filterTags} is not {@code null}, then filter out any keys
1225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * whose native {@code tag} is not in {@code filterTags}. The {@code filterTags} array will be
1235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * sorted as a side effect.
1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </p>
1255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
1265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     /*package*/ @SuppressWarnings("unchecked")
1275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    static <TKey> ArrayList<TKey> getKeysStatic(
1285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)             Class<?> type, Class<TKey> keyClass,
1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)             CameraMetadata<TKey> instance,
1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)             int[] filterTags) {
1315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (VERBOSE) Log.v(TAG, "getKeysStatic for " + type);
1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        // TotalCaptureResult does not have any of the keys on it, use CaptureResult instead
1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (type.equals(TotalCaptureResult.class)) {
1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            type = CaptureResult.class;
1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (filterTags != null) {
1405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            Arrays.sort(filterTags);
1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
1425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        ArrayList<TKey> keyList = new ArrayList<TKey>();
1445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        Field[] fields = type.getDeclaredFields();
1465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        for (Field field : fields) {
1475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            // Filter for Keys that are public
1485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            if (field.getType().isAssignableFrom(keyClass) &&
1495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    (field.getModifiers() & Modifier.PUBLIC) != 0) {
1502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1512a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                TKey key;
1522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                try {
1532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    key = (TKey) field.get(instance);
1542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                } catch (IllegalAccessException e) {
1552a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    throw new AssertionError("Can't get IllegalAccessException", e);
1562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                } catch (IllegalArgumentException e) {
1572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    throw new AssertionError("Can't get IllegalArgumentException", e);
1582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                }
1592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                if (instance == null || instance.getProtected(key) != null) {
1612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                    if (shouldKeyBeAdded(key, field, filterTags)) {
1622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                        keyList.add(key);
1632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                        if (VERBOSE) {
1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                            Log.v(TAG, "getKeysStatic - key was added - " + key);
1662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                        }
1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    } else if (VERBOSE) {
1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                        Log.v(TAG, "getKeysStatic - key was filtered - " + key);
1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                    }
1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)                }
1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            }
1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
1732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
1745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        return keyList;
1755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    }
1765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    @SuppressWarnings("rawtypes")
1785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    private static <TKey> boolean shouldKeyBeAdded(TKey key, Field field, int[] filterTags) {
1795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (key == null) {
1805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            throw new NullPointerException("key must not be null");
1815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        CameraMetadataNative.Key nativeKey;
1845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        /*
1865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)         * Get the native key from the public api key
1875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)         */
1885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (key instanceof CameraCharacteristics.Key) {
1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            nativeKey = ((CameraCharacteristics.Key)key).getNativeKey();
1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        } else if (key instanceof CaptureResult.Key) {
1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            nativeKey = ((CaptureResult.Key)key).getNativeKey();
1925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        } else if (key instanceof CaptureRequest.Key) {
19390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)            nativeKey = ((CaptureRequest.Key)key).getNativeKey();
19490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)        } else {
1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            // Reject fields that aren't a key
1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            throw new IllegalArgumentException("key type must be that of a metadata key");
1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
1995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (field.getAnnotation(PublicKey.class) == null) {
2005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            // Never expose @hide keys up to the API user
2015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            return false;
2025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
2035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        // No filtering necessary
2055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (filterTags == null) {
2065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            return true;
2075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
2085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        if (field.getAnnotation(SyntheticKey.class) != null) {
2105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            // This key is synthetic, so calling #getTag will throw IAE
2115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            // TODO: don't just assume all public+synthetic keys are always available
2135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)            return true;
2145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        }
2155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        /*
2175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)         * Regular key: look up it's native tag and see if it's in filterTags
2185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)         */
2195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        int keyTag = nativeKey.getTag();
2215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        // non-negative result is returned iff the value is in the array
2235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)        return Arrays.binarySearch(filterTags, keyTag) >= 0;
2245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    }
2255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * The enum values below this point are generated from metadata
2285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * definitions in /system/media/camera/docs. Do not modify by hand or
2295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * modify the comment blocks at the start or end.
2305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
2312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
232c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    //
2332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    // Enumeration values for CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
23490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)    //
235c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
23690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)    /**
2372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <p>The lens focus distance is not accurate, and the units used for
2382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} do not correspond to any physical units.</p>
2392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <p>Setting the lens to the same focus distance on separate occasions may
2405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * result in a different real focus distance, depending on factors such
2415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * as the orientation of the device, the age of the focusing mechanism,
2425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * and the device temperature. The focus distance value will still be
2435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * in the range of <code>[0, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code>, where 0
2445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * represents the farthest focus.</p>
2455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
2465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#LENS_FOCUS_DISTANCE
2475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
2485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
2495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
2505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED = 0;
2515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The lens focus distance is measured in diopters.</p>
2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>However, setting the lens to the same focus distance
2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * on separate occasions may result in a different real
2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * focus distance, depending on factors such as the
2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * orientation of the device, the age of the focusing
2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * mechanism, and the device temperature.</p>
2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE = 1;
2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The lens focus distance is measured in diopters, and
2655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * is calibrated.</p>
2665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The lens mechanism is calibrated so that setting the
2675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * same focus distance is repeatable on multiple
2685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * occasions with good accuracy, and the focus distance
2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * corresponds to the real physical distance to the plane
2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * of best focus.</p>
2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED = 2;
2745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    //
2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Enumeration values for CameraCharacteristics#LENS_FACING
2775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    //
2785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
2805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device faces the same direction as the device's screen.</p>
2815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#LENS_FACING
2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int LENS_FACING_FRONT = 0;
2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
2865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device faces the opposite direction as the device's screen.</p>
2875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#LENS_FACING
2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int LENS_FACING_BACK = 1;
2905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    //
2925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Enumeration values for CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    //
2945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The minimal set of capabilities that every camera
2975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * device (regardless of {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel})
2985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * supports.</p>
299a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)     * <p>This capability is listed by all devices, and
3002a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * indicates that the camera device has a feature set
3012a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * that's comparable to the baseline requirements for the
3022a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * older android.hardware.Camera API.</p>
3032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     *
3042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
3052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
3062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     */
3072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    public static final int REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE = 0;
3085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
3095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
3105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device can be manually controlled (3A algorithms such
3115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * as auto-exposure, and auto-focus can be bypassed).
3125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * The camera device supports basic manual control of the sensor image
3135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * acquisition related stages. This means the following controls are
3145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * guaranteed to be supported:</p>
3155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <ul>
3165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Manual frame duration control<ul>
3175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}</li>
3185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}</li>
3195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
3215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Manual exposure control<ul>
3222a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>{@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</li>
3235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</li>
3245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
3262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>Manual sensitivity control<ul>
327a93a17c8d99d686bd4a1511e5504e5e6cc9fcadfTorne (Richard Coles)     * <li>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</li>
3282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>{@link CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE android.sensor.info.sensitivityRange}</li>
3292a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </ul>
3302a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </li>
3312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>Manual lens control (if the lens is adjustable)<ul>
3322a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>android.lens.*</li>
3332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </ul>
3342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </li>
3352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>Manual flash control (if a flash unit is present)<ul>
3365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>android.flash.*</li>
3372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </ul>
3382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </li>
3395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Manual black level locking<ul>
3405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#BLACK_LEVEL_LOCK android.blackLevel.lock}</li>
3415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
3435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>If any of the above 3A algorithms are enabled, then the camera
3455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * device will accurately report the values applied by 3A in the
3465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * result.</p>
3475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>A given camera device may also support additional manual sensor controls,
3485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * but this capability only covers the above list of controls.</p>
3492a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <p>If this is supported, {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} will
3502a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * additionally return a min frame duration that is greater than
3515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * zero for each supported size-format combination.</p>
3525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
3535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#BLACK_LEVEL_LOCK
3542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
355c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
3562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CaptureRequest#SENSOR_FRAME_DURATION
3572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
3582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
3592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_SENSITIVITY_RANGE
3602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CaptureRequest#SENSOR_SENSITIVITY
3612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
362c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
363c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR = 1;
364c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
365c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
366c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * <p>The camera device post-processing stages can be manually controlled.
367c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * The camera device supports basic manual control of the image post-processing
36890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * stages. This means the following controls are guaranteed to be supported:</p>
36990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * <ul>
3705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Manual tonemap control<ul>
3715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}</li>
3725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</li>
3735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS android.tonemap.maxCurvePoints}</li>
3745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
3765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Manual white balance control<ul>
3775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}</li>
3785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}</li>
3795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
3815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Manual lens shading map control<ul>
3825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#SHADING_MODE android.shading.mode}</li>
3835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</li>
3845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>android.statistics.lensShadingMap</li>
3855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>android.lens.info.shadingMapSize</li>
3865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
3885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Manual aberration correction control (if aberration correction is supported)<ul>
3895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</li>
3905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES android.colorCorrection.availableAberrationModes}</li>
3915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
3935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
3945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>If auto white balance is enabled, then the camera device
3955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * will accurately report the values applied by AWB in the result.</p>
3965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>A given camera device may also support additional post-processing
3975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * controls, but this capability only covers the above list of controls.</p>
3985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
3995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
4005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES
4015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#COLOR_CORRECTION_GAINS
4025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
4035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#SHADING_MODE
4045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
4055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#TONEMAP_CURVE
4065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS
4075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#TONEMAP_MODE
4085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
4105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING = 2;
4115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
4135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device supports outputting RAW buffers and
4145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * metadata for interpreting them.</p>
4155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>Devices supporting the RAW capability allow both for
4165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * saving DNG files, and for direct application processing of
4175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * raw sensor images.</p>
4185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <ul>
4195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>RAW_SENSOR is supported as an output format.</li>
4205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>The maximum available resolution for RAW_SENSOR streams
4215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   will match either the value in
4225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize} or
4235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</li>
4245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>All DNG-related optional metadata entries are provided
4255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   by the camera device.</li>
4265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
4275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
4285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
4295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
4305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
4325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int REQUEST_AVAILABLE_CAPABILITIES_RAW = 3;
4335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
4355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device supports the Zero Shutter Lag use case.</p>
4365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <ul>
4375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>At least one input stream can be used.</li>
4385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>RAW_OPAQUE is supported as an output/input format</li>
4395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Using RAW_OPAQUE does not cause a frame rate drop
4405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   relative to the sensor's maximum capture rate (at that
4415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   resolution).</li>
4425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>RAW_OPAQUE will be reprocessable into both YUV_420_888
4435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   and JPEG formats.</li>
4445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>The maximum available resolution for RAW_OPAQUE streams
4455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   (both input/output) will match the maximum available
4465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *   resolution of JPEG streams.</li>
4475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
4485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @hide
4505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
4515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int REQUEST_AVAILABLE_CAPABILITIES_ZSL = 4;
4525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
4545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device supports accurately reporting the sensor settings for many of
4555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * the sensor controls while the built-in 3A algorithm is running.  This allows
4562a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * reporting of sensor settings even when these settings cannot be manually changed.</p>
4572a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <p>The values reported for the following controls are guaranteed to be available
4582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * in the CaptureResult, including when 3A is enabled:</p>
4595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <ul>
4605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Exposure control<ul>
4612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>{@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}</li>
4622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </ul>
4632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * </li>
4645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Sensitivity control<ul>
4655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}</li>
4665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
467c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * </li>
4685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>Lens controls (if the lens is adjustable)<ul>
4695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <li>{@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}</li>
4702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <li>{@link CaptureRequest#LENS_APERTURE android.lens.aperture}</li>
4715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
4725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </li>
4735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * </ul>
4745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>This capability is a subset of the MANUAL_SENSOR control capability, and will
4755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * always be included if the MANUAL_SENSOR capability is available.</p>
4765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
4775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#LENS_APERTURE
4785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#LENS_FOCUS_DISTANCE
4795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
4805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CaptureRequest#SENSOR_SENSITIVITY
4815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
4825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
4835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS = 5;
4845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
4855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
4865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device supports capturing maximum-resolution
4875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * images at &gt;= 20 frames per second, in at least the
4885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * uncompressed YUV format, when post-processing settings
4895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * are set to FAST.</p>
4905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>More specifically, this means that a size matching the
4915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * camera device's active array size is listed as a
4925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * supported size for the YUV_420_888 format in
4935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}, the minimum frame
4945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * duration for that format and size is &lt;= 1/20 s, and
4955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * the {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges} entry
4965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * lists at least one FPS range where the minimum FPS
4975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * is &gt;= 1 / minimumFrameDuration for the maximum-size
4985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * YUV_420_888 format.</p>
4995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>In addition, the {@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} field is
5005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * guaranted to have a value between 0 and 4, inclusive.</p>
5015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     *
5025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES
5035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
5045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SYNC_MAX_LATENCY
5055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
506c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
5075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE = 6;
5085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    //
5105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Enumeration values for CameraCharacteristics#SCALER_CROPPING_TYPE
511c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    //
5125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
513c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
514c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * <p>The camera device only supports centered crop regions.</p>
515868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)     * @see CameraCharacteristics#SCALER_CROPPING_TYPE
516c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
5175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SCALER_CROPPING_TYPE_CENTER_ONLY = 0;
5185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
5205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>The camera device supports arbitrarily chosen crop regions.</p>
521c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SCALER_CROPPING_TYPE
522c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
5235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SCALER_CROPPING_TYPE_FREEFORM = 1;
524c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
525c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    //
526c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    // Enumeration values for CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
527c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    //
528c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
529c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
530c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
531c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
532c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB = 0;
533c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
534c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
535c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
536c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
537c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG = 1;
538c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
539c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
5405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
5415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
5425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG = 2;
5435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
5455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
5465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
5475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR = 3;
5485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
5505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * <p>Sensor is not Bayer; output has 3 16-bit
5515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * values for each pixel, instead of just 1 16-bit value
5525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * per pixel.</p>
5535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
5545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
5555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB = 4;
5565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
5575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    //
5585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    // Enumeration values for CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
5595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    //
5602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
5612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    /**
5622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <p>Timestamps from {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} are in nanoseconds and monotonic,
5632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * but can not be compared to timestamps from other subsystems
5642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * (e.g. accelerometer, gyro etc.), or other instances of the same or different
5652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * camera devices in the same system. Timestamps between streams and results for
5662a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * a single camera instance are comparable, and the timestamps for all buffers
5672a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * and the result metadata generated by a single capture are identical.</p>
568c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
569c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CaptureResult#SENSOR_TIMESTAMP
570c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
571c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
572c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN = 0;
5732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
5742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    /**
5752a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)     * <p>Timestamps from {@link CaptureResult#SENSOR_TIMESTAMP android.sensor.timestamp} are in the same timebase as
576c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * android.os.SystemClock#elapsedRealtimeNanos(),
577c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * and they can be compared to other timestamps using that base.</p>
578c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     *
579c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CaptureResult#SENSOR_TIMESTAMP
580c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
581c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
582c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME = 1;
583c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
584c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    //
585c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    // Enumeration values for CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
586c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    //
587c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
588c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
589c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
590c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
591c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT = 1;
592c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
593c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
594c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
595c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
596c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT = 2;
597c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)
598c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    /**
599b2df76ea8fec9e32f6f3718986dba0d95315b29cTorne (Richard Coles)     * <p>Incandescent light</p>
600c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
601c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)     */
602c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN = 3;
6032a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
6042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)    /**
6055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
6065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
6075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_FLASH = 4;
6085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
6105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
6115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
6125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER = 9;
6135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
6155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
6165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
6175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER = 10;
6185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
6205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
6215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)     */
6225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_SHADE = 11;
6235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
6245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    /**
62590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * <p>D 5700 - 7100K</p>
62690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
62790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     */
62890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT = 12;
62990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
63090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)    /**
63190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * <p>N 4600 - 5400K</p>
63290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
63390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     */
63490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)    public static final int SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT = 13;
63590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
63690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)    /**
63790dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * <p>W 3900 - 4500K</p>
63890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
639     */
640    public static final int SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT = 14;
641
642    /**
643     * <p>WW 3200 - 3700K</p>
644     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
645     */
646    public static final int SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT = 15;
647
648    /**
649     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
650     */
651    public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A = 17;
652
653    /**
654     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
655     */
656    public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B = 18;
657
658    /**
659     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
660     */
661    public static final int SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C = 19;
662
663    /**
664     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
665     */
666    public static final int SENSOR_REFERENCE_ILLUMINANT1_D55 = 20;
667
668    /**
669     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
670     */
671    public static final int SENSOR_REFERENCE_ILLUMINANT1_D65 = 21;
672
673    /**
674     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
675     */
676    public static final int SENSOR_REFERENCE_ILLUMINANT1_D75 = 22;
677
678    /**
679     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
680     */
681    public static final int SENSOR_REFERENCE_ILLUMINANT1_D50 = 23;
682
683    /**
684     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
685     */
686    public static final int SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN = 24;
687
688    //
689    // Enumeration values for CameraCharacteristics#LED_AVAILABLE_LEDS
690    //
691
692    /**
693     * <p>android.led.transmit control is used.</p>
694     * @see CameraCharacteristics#LED_AVAILABLE_LEDS
695     * @hide
696     */
697    public static final int LED_AVAILABLE_LEDS_TRANSMIT = 0;
698
699    //
700    // Enumeration values for CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
701    //
702
703    /**
704     * <p>This camera device has only limited capabilities.</p>
705     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
706     */
707    public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED = 0;
708
709    /**
710     * <p>This camera device is capable of supporting advanced imaging applications.</p>
711     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
712     */
713    public static final int INFO_SUPPORTED_HARDWARE_LEVEL_FULL = 1;
714
715    /**
716     * <p>This camera device is running in backward compatibility mode.</p>
717     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
718     */
719    public static final int INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY = 2;
720
721    //
722    // Enumeration values for CameraCharacteristics#SYNC_MAX_LATENCY
723    //
724
725    /**
726     * <p>Every frame has the requests immediately applied.</p>
727     * <p>Furthermore for all results,
728     * <code>android.sync.frameNumber == CaptureResult#getFrameNumber()</code></p>
729     * <p>Changing controls over multiple requests one after another will
730     * produce results that have those controls applied atomically
731     * each frame.</p>
732     * <p>All FULL capability devices will have this as their maxLatency.</p>
733     * @see CameraCharacteristics#SYNC_MAX_LATENCY
734     */
735    public static final int SYNC_MAX_LATENCY_PER_FRAME_CONTROL = 0;
736
737    /**
738     * <p>Each new frame has some subset (potentially the entire set)
739     * of the past requests applied to the camera settings.</p>
740     * <p>By submitting a series of identical requests, the camera device
741     * will eventually have the camera settings applied, but it is
742     * unknown when that exact point will be.</p>
743     * <p>All LEGACY capability devices will have this as their maxLatency.</p>
744     * @see CameraCharacteristics#SYNC_MAX_LATENCY
745     */
746    public static final int SYNC_MAX_LATENCY_UNKNOWN = -1;
747
748    //
749    // Enumeration values for CaptureRequest#COLOR_CORRECTION_MODE
750    //
751
752    /**
753     * <p>Use the {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} matrix
754     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} to do color conversion.</p>
755     * <p>All advanced white balance adjustments (not specified
756     * by our white balance pipeline) must be disabled.</p>
757     * <p>If AWB is enabled with <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != OFF</code>, then
758     * TRANSFORM_MATRIX is ignored. The camera device will override
759     * this value to either FAST or HIGH_QUALITY.</p>
760     *
761     * @see CaptureRequest#COLOR_CORRECTION_GAINS
762     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
763     * @see CaptureRequest#CONTROL_AWB_MODE
764     * @see CaptureRequest#COLOR_CORRECTION_MODE
765     */
766    public static final int COLOR_CORRECTION_MODE_TRANSFORM_MATRIX = 0;
767
768    /**
769     * <p>Color correction processing must not slow down
770     * capture rate relative to sensor raw output.</p>
771     * <p>Advanced white balance adjustments above and beyond
772     * the specified white balance pipeline may be applied.</p>
773     * <p>If AWB is enabled with <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != OFF</code>, then
774     * the camera device uses the last frame's AWB values
775     * (or defaults if AWB has never been run).</p>
776     *
777     * @see CaptureRequest#CONTROL_AWB_MODE
778     * @see CaptureRequest#COLOR_CORRECTION_MODE
779     */
780    public static final int COLOR_CORRECTION_MODE_FAST = 1;
781
782    /**
783     * <p>Color correction processing operates at improved
784     * quality but reduced capture rate (relative to sensor raw
785     * output).</p>
786     * <p>Advanced white balance adjustments above and beyond
787     * the specified white balance pipeline may be applied.</p>
788     * <p>If AWB is enabled with <code>{@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} != OFF</code>, then
789     * the camera device uses the last frame's AWB values
790     * (or defaults if AWB has never been run).</p>
791     *
792     * @see CaptureRequest#CONTROL_AWB_MODE
793     * @see CaptureRequest#COLOR_CORRECTION_MODE
794     */
795    public static final int COLOR_CORRECTION_MODE_HIGH_QUALITY = 2;
796
797    //
798    // Enumeration values for CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
799    //
800
801    /**
802     * <p>No aberration correction is applied.</p>
803     * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
804     */
805    public static final int COLOR_CORRECTION_ABERRATION_MODE_OFF = 0;
806
807    /**
808     * <p>Aberration correction will not slow down capture rate
809     * relative to sensor raw output.</p>
810     * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
811     */
812    public static final int COLOR_CORRECTION_ABERRATION_MODE_FAST = 1;
813
814    /**
815     * <p>Aberration correction operates at improved quality but reduced
816     * capture rate (relative to sensor raw output).</p>
817     * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
818     */
819    public static final int COLOR_CORRECTION_ABERRATION_MODE_HIGH_QUALITY = 2;
820
821    //
822    // Enumeration values for CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
823    //
824
825    /**
826     * <p>The camera device will not adjust exposure duration to
827     * avoid banding problems.</p>
828     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
829     */
830    public static final int CONTROL_AE_ANTIBANDING_MODE_OFF = 0;
831
832    /**
833     * <p>The camera device will adjust exposure duration to
834     * avoid banding problems with 50Hz illumination sources.</p>
835     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
836     */
837    public static final int CONTROL_AE_ANTIBANDING_MODE_50HZ = 1;
838
839    /**
840     * <p>The camera device will adjust exposure duration to
841     * avoid banding problems with 60Hz illumination
842     * sources.</p>
843     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
844     */
845    public static final int CONTROL_AE_ANTIBANDING_MODE_60HZ = 2;
846
847    /**
848     * <p>The camera device will automatically adapt its
849     * antibanding routine to the current illumination
850     * conditions. This is the default.</p>
851     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
852     */
853    public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3;
854
855    //
856    // Enumeration values for CaptureRequest#CONTROL_AE_MODE
857    //
858
859    /**
860     * <p>The camera device's autoexposure routine is disabled.</p>
861     * <p>The application-selected {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
862     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} and
863     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} are used by the camera
864     * device, along with android.flash.* fields, if there's
865     * a flash unit for this camera device.</p>
866     * <p>Note that auto-white balance (AWB) and auto-focus (AF)
867     * behavior is device dependent when AE is in OFF mode.
868     * To have consistent behavior across different devices,
869     * it is recommended to either set AWB and AF to OFF mode
870     * or lock AWB and AF before setting AE to OFF.
871     * See {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode},
872     * {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}, and {@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}
873     * for more details.</p>
874     * <p>LEGACY devices do not support the OFF mode and will
875     * override attempts to use this value to ON.</p>
876     *
877     * @see CaptureRequest#CONTROL_AF_MODE
878     * @see CaptureRequest#CONTROL_AF_TRIGGER
879     * @see CaptureRequest#CONTROL_AWB_LOCK
880     * @see CaptureRequest#CONTROL_AWB_MODE
881     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
882     * @see CaptureRequest#SENSOR_FRAME_DURATION
883     * @see CaptureRequest#SENSOR_SENSITIVITY
884     * @see CaptureRequest#CONTROL_AE_MODE
885     */
886    public static final int CONTROL_AE_MODE_OFF = 0;
887
888    /**
889     * <p>The camera device's autoexposure routine is active,
890     * with no flash control.</p>
891     * <p>The application's values for
892     * {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime},
893     * {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, and
894     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} are ignored. The
895     * application has control over the various
896     * android.flash.* fields.</p>
897     *
898     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
899     * @see CaptureRequest#SENSOR_FRAME_DURATION
900     * @see CaptureRequest#SENSOR_SENSITIVITY
901     * @see CaptureRequest#CONTROL_AE_MODE
902     */
903    public static final int CONTROL_AE_MODE_ON = 1;
904
905    /**
906     * <p>Like ON, except that the camera device also controls
907     * the camera's flash unit, firing it in low-light
908     * conditions.</p>
909     * <p>The flash may be fired during a precapture sequence
910     * (triggered by {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) and
911     * may be fired for captures for which the
912     * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} field is set to
913     * STILL_CAPTURE</p>
914     *
915     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
916     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
917     * @see CaptureRequest#CONTROL_AE_MODE
918     */
919    public static final int CONTROL_AE_MODE_ON_AUTO_FLASH = 2;
920
921    /**
922     * <p>Like ON, except that the camera device also controls
923     * the camera's flash unit, always firing it for still
924     * captures.</p>
925     * <p>The flash may be fired during a precapture sequence
926     * (triggered by {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}) and
927     * will always be fired for captures for which the
928     * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} field is set to
929     * STILL_CAPTURE</p>
930     *
931     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
932     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
933     * @see CaptureRequest#CONTROL_AE_MODE
934     */
935    public static final int CONTROL_AE_MODE_ON_ALWAYS_FLASH = 3;
936
937    /**
938     * <p>Like ON_AUTO_FLASH, but with automatic red eye
939     * reduction.</p>
940     * <p>If deemed necessary by the camera device, a red eye
941     * reduction flash will fire during the precapture
942     * sequence.</p>
943     * @see CaptureRequest#CONTROL_AE_MODE
944     */
945    public static final int CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE = 4;
946
947    //
948    // Enumeration values for CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
949    //
950
951    /**
952     * <p>The trigger is idle.</p>
953     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
954     */
955    public static final int CONTROL_AE_PRECAPTURE_TRIGGER_IDLE = 0;
956
957    /**
958     * <p>The precapture metering sequence will be started
959     * by the camera device.</p>
960     * <p>The exact effect of the precapture trigger depends on
961     * the current AE mode and state.</p>
962     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
963     */
964    public static final int CONTROL_AE_PRECAPTURE_TRIGGER_START = 1;
965
966    //
967    // Enumeration values for CaptureRequest#CONTROL_AF_MODE
968    //
969
970    /**
971     * <p>The auto-focus routine does not control the lens;
972     * {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} is controlled by the
973     * application.</p>
974     *
975     * @see CaptureRequest#LENS_FOCUS_DISTANCE
976     * @see CaptureRequest#CONTROL_AF_MODE
977     */
978    public static final int CONTROL_AF_MODE_OFF = 0;
979
980    /**
981     * <p>Basic automatic focus mode.</p>
982     * <p>In this mode, the lens does not move unless
983     * the autofocus trigger action is called. When that trigger
984     * is activated, AF will transition to ACTIVE_SCAN, then to
985     * the outcome of the scan (FOCUSED or NOT_FOCUSED).</p>
986     * <p>Always supported if lens is not fixed focus.</p>
987     * <p>Use {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} to determine if lens
988     * is fixed-focus.</p>
989     * <p>Triggering AF_CANCEL resets the lens position to default,
990     * and sets the AF state to INACTIVE.</p>
991     *
992     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
993     * @see CaptureRequest#CONTROL_AF_MODE
994     */
995    public static final int CONTROL_AF_MODE_AUTO = 1;
996
997    /**
998     * <p>Close-up focusing mode.</p>
999     * <p>In this mode, the lens does not move unless the
1000     * autofocus trigger action is called. When that trigger is
1001     * activated, AF will transition to ACTIVE_SCAN, then to
1002     * the outcome of the scan (FOCUSED or NOT_FOCUSED). This
1003     * mode is optimized for focusing on objects very close to
1004     * the camera.</p>
1005     * <p>When that trigger is activated, AF will transition to
1006     * ACTIVE_SCAN, then to the outcome of the scan (FOCUSED or
1007     * NOT_FOCUSED). Triggering cancel AF resets the lens
1008     * position to default, and sets the AF state to
1009     * INACTIVE.</p>
1010     * @see CaptureRequest#CONTROL_AF_MODE
1011     */
1012    public static final int CONTROL_AF_MODE_MACRO = 2;
1013
1014    /**
1015     * <p>In this mode, the AF algorithm modifies the lens
1016     * position continually to attempt to provide a
1017     * constantly-in-focus image stream.</p>
1018     * <p>The focusing behavior should be suitable for good quality
1019     * video recording; typically this means slower focus
1020     * movement and no overshoots. When the AF trigger is not
1021     * involved, the AF algorithm should start in INACTIVE state,
1022     * and then transition into PASSIVE_SCAN and PASSIVE_FOCUSED
1023     * states as appropriate. When the AF trigger is activated,
1024     * the algorithm should immediately transition into
1025     * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
1026     * lens position until a cancel AF trigger is received.</p>
1027     * <p>Once cancel is received, the algorithm should transition
1028     * back to INACTIVE and resume passive scan. Note that this
1029     * behavior is not identical to CONTINUOUS_PICTURE, since an
1030     * ongoing PASSIVE_SCAN must immediately be
1031     * canceled.</p>
1032     * @see CaptureRequest#CONTROL_AF_MODE
1033     */
1034    public static final int CONTROL_AF_MODE_CONTINUOUS_VIDEO = 3;
1035
1036    /**
1037     * <p>In this mode, the AF algorithm modifies the lens
1038     * position continually to attempt to provide a
1039     * constantly-in-focus image stream.</p>
1040     * <p>The focusing behavior should be suitable for still image
1041     * capture; typically this means focusing as fast as
1042     * possible. When the AF trigger is not involved, the AF
1043     * algorithm should start in INACTIVE state, and then
1044     * transition into PASSIVE_SCAN and PASSIVE_FOCUSED states as
1045     * appropriate as it attempts to maintain focus. When the AF
1046     * trigger is activated, the algorithm should finish its
1047     * PASSIVE_SCAN if active, and then transition into
1048     * AF_FOCUSED or AF_NOT_FOCUSED as appropriate, and lock the
1049     * lens position until a cancel AF trigger is received.</p>
1050     * <p>When the AF cancel trigger is activated, the algorithm
1051     * should transition back to INACTIVE and then act as if it
1052     * has just been started.</p>
1053     * @see CaptureRequest#CONTROL_AF_MODE
1054     */
1055    public static final int CONTROL_AF_MODE_CONTINUOUS_PICTURE = 4;
1056
1057    /**
1058     * <p>Extended depth of field (digital focus) mode.</p>
1059     * <p>The camera device will produce images with an extended
1060     * depth of field automatically; no special focusing
1061     * operations need to be done before taking a picture.</p>
1062     * <p>AF triggers are ignored, and the AF state will always be
1063     * INACTIVE.</p>
1064     * @see CaptureRequest#CONTROL_AF_MODE
1065     */
1066    public static final int CONTROL_AF_MODE_EDOF = 5;
1067
1068    //
1069    // Enumeration values for CaptureRequest#CONTROL_AF_TRIGGER
1070    //
1071
1072    /**
1073     * <p>The trigger is idle.</p>
1074     * @see CaptureRequest#CONTROL_AF_TRIGGER
1075     */
1076    public static final int CONTROL_AF_TRIGGER_IDLE = 0;
1077
1078    /**
1079     * <p>Autofocus will trigger now.</p>
1080     * @see CaptureRequest#CONTROL_AF_TRIGGER
1081     */
1082    public static final int CONTROL_AF_TRIGGER_START = 1;
1083
1084    /**
1085     * <p>Autofocus will return to its initial
1086     * state, and cancel any currently active trigger.</p>
1087     * @see CaptureRequest#CONTROL_AF_TRIGGER
1088     */
1089    public static final int CONTROL_AF_TRIGGER_CANCEL = 2;
1090
1091    //
1092    // Enumeration values for CaptureRequest#CONTROL_AWB_MODE
1093    //
1094
1095    /**
1096     * <p>The camera device's auto-white balance routine is disabled.</p>
1097     * <p>The application-selected color transform matrix
1098     * ({@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}) and gains
1099     * ({@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}) are used by the camera
1100     * device for manual white balance control.</p>
1101     *
1102     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1103     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1104     * @see CaptureRequest#CONTROL_AWB_MODE
1105     */
1106    public static final int CONTROL_AWB_MODE_OFF = 0;
1107
1108    /**
1109     * <p>The camera device's auto-white balance routine is active.</p>
1110     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1111     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1112     * For devices that support the MANUAL_POST_PROCESSING capability, the
1113     * values used by the camera device for the transform and gains
1114     * will be available in the capture result for this request.</p>
1115     *
1116     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1117     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1118     * @see CaptureRequest#CONTROL_AWB_MODE
1119     */
1120    public static final int CONTROL_AWB_MODE_AUTO = 1;
1121
1122    /**
1123     * <p>The camera device's auto-white balance routine is disabled;
1124     * the camera device uses incandescent light as the assumed scene
1125     * illumination for white balance.</p>
1126     * <p>While the exact white balance transforms are up to the
1127     * camera device, they will approximately match the CIE
1128     * standard illuminant A.</p>
1129     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1130     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1131     * For devices that support the MANUAL_POST_PROCESSING capability, the
1132     * values used by the camera device for the transform and gains
1133     * will be available in the capture result for this request.</p>
1134     *
1135     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1136     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1137     * @see CaptureRequest#CONTROL_AWB_MODE
1138     */
1139    public static final int CONTROL_AWB_MODE_INCANDESCENT = 2;
1140
1141    /**
1142     * <p>The camera device's auto-white balance routine is disabled;
1143     * the camera device uses fluorescent light as the assumed scene
1144     * illumination for white balance.</p>
1145     * <p>While the exact white balance transforms are up to the
1146     * camera device, they will approximately match the CIE
1147     * standard illuminant F2.</p>
1148     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1149     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1150     * For devices that support the MANUAL_POST_PROCESSING capability, the
1151     * values used by the camera device for the transform and gains
1152     * will be available in the capture result for this request.</p>
1153     *
1154     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1155     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1156     * @see CaptureRequest#CONTROL_AWB_MODE
1157     */
1158    public static final int CONTROL_AWB_MODE_FLUORESCENT = 3;
1159
1160    /**
1161     * <p>The camera device's auto-white balance routine is disabled;
1162     * the camera device uses warm fluorescent light as the assumed scene
1163     * illumination for white balance.</p>
1164     * <p>While the exact white balance transforms are up to the
1165     * camera device, they will approximately match the CIE
1166     * standard illuminant F4.</p>
1167     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1168     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1169     * For devices that support the MANUAL_POST_PROCESSING capability, the
1170     * values used by the camera device for the transform and gains
1171     * will be available in the capture result for this request.</p>
1172     *
1173     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1174     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1175     * @see CaptureRequest#CONTROL_AWB_MODE
1176     */
1177    public static final int CONTROL_AWB_MODE_WARM_FLUORESCENT = 4;
1178
1179    /**
1180     * <p>The camera device's auto-white balance routine is disabled;
1181     * the camera device uses daylight light as the assumed scene
1182     * illumination for white balance.</p>
1183     * <p>While the exact white balance transforms are up to the
1184     * camera device, they will approximately match the CIE
1185     * standard illuminant D65.</p>
1186     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1187     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1188     * For devices that support the MANUAL_POST_PROCESSING capability, the
1189     * values used by the camera device for the transform and gains
1190     * will be available in the capture result for this request.</p>
1191     *
1192     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1193     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1194     * @see CaptureRequest#CONTROL_AWB_MODE
1195     */
1196    public static final int CONTROL_AWB_MODE_DAYLIGHT = 5;
1197
1198    /**
1199     * <p>The camera device's auto-white balance routine is disabled;
1200     * the camera device uses cloudy daylight light as the assumed scene
1201     * illumination for white balance.</p>
1202     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1203     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1204     * For devices that support the MANUAL_POST_PROCESSING capability, the
1205     * values used by the camera device for the transform and gains
1206     * will be available in the capture result for this request.</p>
1207     *
1208     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1209     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1210     * @see CaptureRequest#CONTROL_AWB_MODE
1211     */
1212    public static final int CONTROL_AWB_MODE_CLOUDY_DAYLIGHT = 6;
1213
1214    /**
1215     * <p>The camera device's auto-white balance routine is disabled;
1216     * the camera device uses twilight light as the assumed scene
1217     * illumination for white balance.</p>
1218     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1219     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1220     * For devices that support the MANUAL_POST_PROCESSING capability, the
1221     * values used by the camera device for the transform and gains
1222     * will be available in the capture result for this request.</p>
1223     *
1224     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1225     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1226     * @see CaptureRequest#CONTROL_AWB_MODE
1227     */
1228    public static final int CONTROL_AWB_MODE_TWILIGHT = 7;
1229
1230    /**
1231     * <p>The camera device's auto-white balance routine is disabled;
1232     * the camera device uses shade light as the assumed scene
1233     * illumination for white balance.</p>
1234     * <p>The application's values for {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform}
1235     * and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains} are ignored.
1236     * For devices that support the MANUAL_POST_PROCESSING capability, the
1237     * values used by the camera device for the transform and gains
1238     * will be available in the capture result for this request.</p>
1239     *
1240     * @see CaptureRequest#COLOR_CORRECTION_GAINS
1241     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
1242     * @see CaptureRequest#CONTROL_AWB_MODE
1243     */
1244    public static final int CONTROL_AWB_MODE_SHADE = 8;
1245
1246    //
1247    // Enumeration values for CaptureRequest#CONTROL_CAPTURE_INTENT
1248    //
1249
1250    /**
1251     * <p>The goal of this request doesn't fall into the other
1252     * categories. The camera device will default to preview-like
1253     * behavior.</p>
1254     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1255     */
1256    public static final int CONTROL_CAPTURE_INTENT_CUSTOM = 0;
1257
1258    /**
1259     * <p>This request is for a preview-like use case.</p>
1260     * <p>The precapture trigger may be used to start off a metering
1261     * w/flash sequence.</p>
1262     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1263     */
1264    public static final int CONTROL_CAPTURE_INTENT_PREVIEW = 1;
1265
1266    /**
1267     * <p>This request is for a still capture-type
1268     * use case.</p>
1269     * <p>If the flash unit is under automatic control, it may fire as needed.</p>
1270     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1271     */
1272    public static final int CONTROL_CAPTURE_INTENT_STILL_CAPTURE = 2;
1273
1274    /**
1275     * <p>This request is for a video recording
1276     * use case.</p>
1277     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1278     */
1279    public static final int CONTROL_CAPTURE_INTENT_VIDEO_RECORD = 3;
1280
1281    /**
1282     * <p>This request is for a video snapshot (still
1283     * image while recording video) use case.</p>
1284     * <p>The camera device should take the highest-quality image
1285     * possible (given the other settings) without disrupting the
1286     * frame rate of video recording.  </p>
1287     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1288     */
1289    public static final int CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT = 4;
1290
1291    /**
1292     * <p>This request is for a ZSL usecase; the
1293     * application will stream full-resolution images and
1294     * reprocess one or several later for a final
1295     * capture.</p>
1296     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1297     */
1298    public static final int CONTROL_CAPTURE_INTENT_ZERO_SHUTTER_LAG = 5;
1299
1300    /**
1301     * <p>This request is for manual capture use case where
1302     * the applications want to directly control the capture parameters.</p>
1303     * <p>For example, the application may wish to manually control
1304     * {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}, {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity}, etc.</p>
1305     *
1306     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1307     * @see CaptureRequest#SENSOR_SENSITIVITY
1308     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1309     */
1310    public static final int CONTROL_CAPTURE_INTENT_MANUAL = 6;
1311
1312    //
1313    // Enumeration values for CaptureRequest#CONTROL_EFFECT_MODE
1314    //
1315
1316    /**
1317     * <p>No color effect will be applied.</p>
1318     * @see CaptureRequest#CONTROL_EFFECT_MODE
1319     */
1320    public static final int CONTROL_EFFECT_MODE_OFF = 0;
1321
1322    /**
1323     * <p>A "monocolor" effect where the image is mapped into
1324     * a single color.</p>
1325     * <p>This will typically be grayscale.</p>
1326     * @see CaptureRequest#CONTROL_EFFECT_MODE
1327     */
1328    public static final int CONTROL_EFFECT_MODE_MONO = 1;
1329
1330    /**
1331     * <p>A "photo-negative" effect where the image's colors
1332     * are inverted.</p>
1333     * @see CaptureRequest#CONTROL_EFFECT_MODE
1334     */
1335    public static final int CONTROL_EFFECT_MODE_NEGATIVE = 2;
1336
1337    /**
1338     * <p>A "solarisation" effect (Sabattier effect) where the
1339     * image is wholly or partially reversed in
1340     * tone.</p>
1341     * @see CaptureRequest#CONTROL_EFFECT_MODE
1342     */
1343    public static final int CONTROL_EFFECT_MODE_SOLARIZE = 3;
1344
1345    /**
1346     * <p>A "sepia" effect where the image is mapped into warm
1347     * gray, red, and brown tones.</p>
1348     * @see CaptureRequest#CONTROL_EFFECT_MODE
1349     */
1350    public static final int CONTROL_EFFECT_MODE_SEPIA = 4;
1351
1352    /**
1353     * <p>A "posterization" effect where the image uses
1354     * discrete regions of tone rather than a continuous
1355     * gradient of tones.</p>
1356     * @see CaptureRequest#CONTROL_EFFECT_MODE
1357     */
1358    public static final int CONTROL_EFFECT_MODE_POSTERIZE = 5;
1359
1360    /**
1361     * <p>A "whiteboard" effect where the image is typically displayed
1362     * as regions of white, with black or grey details.</p>
1363     * @see CaptureRequest#CONTROL_EFFECT_MODE
1364     */
1365    public static final int CONTROL_EFFECT_MODE_WHITEBOARD = 6;
1366
1367    /**
1368     * <p>A "blackboard" effect where the image is typically displayed
1369     * as regions of black, with white or grey details.</p>
1370     * @see CaptureRequest#CONTROL_EFFECT_MODE
1371     */
1372    public static final int CONTROL_EFFECT_MODE_BLACKBOARD = 7;
1373
1374    /**
1375     * <p>An "aqua" effect where a blue hue is added to the image.</p>
1376     * @see CaptureRequest#CONTROL_EFFECT_MODE
1377     */
1378    public static final int CONTROL_EFFECT_MODE_AQUA = 8;
1379
1380    //
1381    // Enumeration values for CaptureRequest#CONTROL_MODE
1382    //
1383
1384    /**
1385     * <p>Full application control of pipeline.</p>
1386     * <p>All control by the device's metering and focusing (3A)
1387     * routines is disabled, and no other settings in
1388     * android.control.* have any effect, except that
1389     * {@link CaptureRequest#CONTROL_CAPTURE_INTENT android.control.captureIntent} may be used by the camera
1390     * device to select post-processing values for processing
1391     * blocks that do not allow for manual control, or are not
1392     * exposed by the camera API.</p>
1393     * <p>However, the camera device's 3A routines may continue to
1394     * collect statistics and update their internal state so that
1395     * when control is switched to AUTO mode, good control values
1396     * can be immediately applied.</p>
1397     *
1398     * @see CaptureRequest#CONTROL_CAPTURE_INTENT
1399     * @see CaptureRequest#CONTROL_MODE
1400     */
1401    public static final int CONTROL_MODE_OFF = 0;
1402
1403    /**
1404     * <p>Use settings for each individual 3A routine.</p>
1405     * <p>Manual control of capture parameters is disabled. All
1406     * controls in android.control.* besides sceneMode take
1407     * effect.</p>
1408     * @see CaptureRequest#CONTROL_MODE
1409     */
1410    public static final int CONTROL_MODE_AUTO = 1;
1411
1412    /**
1413     * <p>Use a specific scene mode.</p>
1414     * <p>Enabling this disables control.aeMode, control.awbMode and
1415     * control.afMode controls; the camera device will ignore
1416     * those settings while USE_SCENE_MODE is active (except for
1417     * FACE_PRIORITY scene mode). Other control entries are still
1418     * active.  This setting can only be used if scene mode is
1419     * supported (i.e. {@link CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES android.control.availableSceneModes}
1420     * contain some modes other than DISABLED).</p>
1421     *
1422     * @see CameraCharacteristics#CONTROL_AVAILABLE_SCENE_MODES
1423     * @see CaptureRequest#CONTROL_MODE
1424     */
1425    public static final int CONTROL_MODE_USE_SCENE_MODE = 2;
1426
1427    /**
1428     * <p>Same as OFF mode, except that this capture will not be
1429     * used by camera device background auto-exposure, auto-white balance and
1430     * auto-focus algorithms (3A) to update their statistics.</p>
1431     * <p>Specifically, the 3A routines are locked to the last
1432     * values set from a request with AUTO, OFF, or
1433     * USE_SCENE_MODE, and any statistics or state updates
1434     * collected from manual captures with OFF_KEEP_STATE will be
1435     * discarded by the camera device.</p>
1436     * @see CaptureRequest#CONTROL_MODE
1437     */
1438    public static final int CONTROL_MODE_OFF_KEEP_STATE = 3;
1439
1440    //
1441    // Enumeration values for CaptureRequest#CONTROL_SCENE_MODE
1442    //
1443
1444    /**
1445     * <p>Indicates that no scene modes are set for a given capture request.</p>
1446     * @see CaptureRequest#CONTROL_SCENE_MODE
1447     */
1448    public static final int CONTROL_SCENE_MODE_DISABLED = 0;
1449
1450    /**
1451     * <p>If face detection support exists, use face
1452     * detection data for auto-focus, auto-white balance, and
1453     * auto-exposure routines.</p>
1454     * <p>If face detection statistics are disabled
1455     * (i.e. {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} is set to OFF),
1456     * this should still operate correctly (but will not return
1457     * face detection statistics to the framework).</p>
1458     * <p>Unlike the other scene modes, {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode},
1459     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}, and {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}
1460     * remain active when FACE_PRIORITY is set.</p>
1461     *
1462     * @see CaptureRequest#CONTROL_AE_MODE
1463     * @see CaptureRequest#CONTROL_AF_MODE
1464     * @see CaptureRequest#CONTROL_AWB_MODE
1465     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
1466     * @see CaptureRequest#CONTROL_SCENE_MODE
1467     */
1468    public static final int CONTROL_SCENE_MODE_FACE_PRIORITY = 1;
1469
1470    /**
1471     * <p>Optimized for photos of quickly moving objects.</p>
1472     * <p>Similar to SPORTS.</p>
1473     * @see CaptureRequest#CONTROL_SCENE_MODE
1474     */
1475    public static final int CONTROL_SCENE_MODE_ACTION = 2;
1476
1477    /**
1478     * <p>Optimized for still photos of people.</p>
1479     * @see CaptureRequest#CONTROL_SCENE_MODE
1480     */
1481    public static final int CONTROL_SCENE_MODE_PORTRAIT = 3;
1482
1483    /**
1484     * <p>Optimized for photos of distant macroscopic objects.</p>
1485     * @see CaptureRequest#CONTROL_SCENE_MODE
1486     */
1487    public static final int CONTROL_SCENE_MODE_LANDSCAPE = 4;
1488
1489    /**
1490     * <p>Optimized for low-light settings.</p>
1491     * @see CaptureRequest#CONTROL_SCENE_MODE
1492     */
1493    public static final int CONTROL_SCENE_MODE_NIGHT = 5;
1494
1495    /**
1496     * <p>Optimized for still photos of people in low-light
1497     * settings.</p>
1498     * @see CaptureRequest#CONTROL_SCENE_MODE
1499     */
1500    public static final int CONTROL_SCENE_MODE_NIGHT_PORTRAIT = 6;
1501
1502    /**
1503     * <p>Optimized for dim, indoor settings where flash must
1504     * remain off.</p>
1505     * @see CaptureRequest#CONTROL_SCENE_MODE
1506     */
1507    public static final int CONTROL_SCENE_MODE_THEATRE = 7;
1508
1509    /**
1510     * <p>Optimized for bright, outdoor beach settings.</p>
1511     * @see CaptureRequest#CONTROL_SCENE_MODE
1512     */
1513    public static final int CONTROL_SCENE_MODE_BEACH = 8;
1514
1515    /**
1516     * <p>Optimized for bright, outdoor settings containing snow.</p>
1517     * @see CaptureRequest#CONTROL_SCENE_MODE
1518     */
1519    public static final int CONTROL_SCENE_MODE_SNOW = 9;
1520
1521    /**
1522     * <p>Optimized for scenes of the setting sun.</p>
1523     * @see CaptureRequest#CONTROL_SCENE_MODE
1524     */
1525    public static final int CONTROL_SCENE_MODE_SUNSET = 10;
1526
1527    /**
1528     * <p>Optimized to avoid blurry photos due to small amounts of
1529     * device motion (for example: due to hand shake).</p>
1530     * @see CaptureRequest#CONTROL_SCENE_MODE
1531     */
1532    public static final int CONTROL_SCENE_MODE_STEADYPHOTO = 11;
1533
1534    /**
1535     * <p>Optimized for nighttime photos of fireworks.</p>
1536     * @see CaptureRequest#CONTROL_SCENE_MODE
1537     */
1538    public static final int CONTROL_SCENE_MODE_FIREWORKS = 12;
1539
1540    /**
1541     * <p>Optimized for photos of quickly moving people.</p>
1542     * <p>Similar to ACTION.</p>
1543     * @see CaptureRequest#CONTROL_SCENE_MODE
1544     */
1545    public static final int CONTROL_SCENE_MODE_SPORTS = 13;
1546
1547    /**
1548     * <p>Optimized for dim, indoor settings with multiple moving
1549     * people.</p>
1550     * @see CaptureRequest#CONTROL_SCENE_MODE
1551     */
1552    public static final int CONTROL_SCENE_MODE_PARTY = 14;
1553
1554    /**
1555     * <p>Optimized for dim settings where the main light source
1556     * is a flame.</p>
1557     * @see CaptureRequest#CONTROL_SCENE_MODE
1558     */
1559    public static final int CONTROL_SCENE_MODE_CANDLELIGHT = 15;
1560
1561    /**
1562     * <p>Optimized for accurately capturing a photo of barcode
1563     * for use by camera applications that wish to read the
1564     * barcode value.</p>
1565     * @see CaptureRequest#CONTROL_SCENE_MODE
1566     */
1567    public static final int CONTROL_SCENE_MODE_BARCODE = 16;
1568
1569    /**
1570     * <p>Optimized for high speed video recording (frame rate &gt;=60fps) use case.</p>
1571     * <p>The supported high speed video sizes and fps ranges are specified in
1572     * android.control.availableHighSpeedVideoConfigurations. To get desired
1573     * output frame rates, the application is only allowed to select video size
1574     * and fps range combinations listed in this static metadata. The fps range
1575     * can be control via {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}.</p>
1576     * <p>In this mode, the camera device will override aeMode, awbMode, and afMode to
1577     * ON, ON, and CONTINUOUS_VIDEO, respectively. All post-processing block mode
1578     * controls will be overridden to be FAST. Therefore, no manual control of capture
1579     * and post-processing parameters is possible. All other controls operate the
1580     * same as when {@link CaptureRequest#CONTROL_MODE android.control.mode} == AUTO. This means that all other
1581     * android.control.* fields continue to work, such as</p>
1582     * <ul>
1583     * <li>{@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange}</li>
1584     * <li>{@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}</li>
1585     * <li>{@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</li>
1586     * <li>{@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</li>
1587     * <li>{@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</li>
1588     * <li>{@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}</li>
1589     * <li>{@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}</li>
1590     * <li>{@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}</li>
1591     * <li>{@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}</li>
1592     * <li>{@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger}</li>
1593     * </ul>
1594     * <p>Outside of android.control.*, the following controls will work:</p>
1595     * <ul>
1596     * <li>{@link CaptureRequest#FLASH_MODE android.flash.mode} (automatic flash for still capture will not work since aeMode is ON)</li>
1597     * <li>{@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} (if it is supported)</li>
1598     * <li>{@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}</li>
1599     * <li>{@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</li>
1600     * </ul>
1601     * <p>For high speed recording use case, the actual maximum supported frame rate may
1602     * be lower than what camera can output, depending on the destination Surfaces for
1603     * the image data. For example, if the destination surface is from video encoder,
1604     * the application need check if the video encoder is capable of supporting the
1605     * high frame rate for a given video size, or it will end up with lower recording
1606     * frame rate. If the destination surface is from preview window, the preview frame
1607     * rate will be bounded by the screen refresh rate.</p>
1608     * <p>The camera device will only support up to 2 output high speed streams
1609     * (processed non-stalling format defined in android.request.maxNumOutputStreams)
1610     * in this mode. This control will be effective only if all of below conditions are true:</p>
1611     * <ul>
1612     * <li>The application created no more than maxNumHighSpeedStreams processed non-stalling
1613     * format output streams, where maxNumHighSpeedStreams is calculated as
1614     * min(2, android.request.maxNumOutputStreams[Processed (but not-stalling)]).</li>
1615     * <li>The stream sizes are selected from the sizes reported by
1616     * android.control.availableHighSpeedVideoConfigurations.</li>
1617     * <li>No processed non-stalling or raw streams are configured.</li>
1618     * </ul>
1619     * <p>When above conditions are NOT satistied, the controls of this mode and
1620     * {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} will be ignored by the camera device,
1621     * the camera device will fall back to {@link CaptureRequest#CONTROL_MODE android.control.mode} <code>==</code> AUTO,
1622     * and the returned capture result metadata will give the fps range choosen
1623     * by the camera device.</p>
1624     * <p>Switching into or out of this mode may trigger some camera ISP/sensor
1625     * reconfigurations, which may introduce extra latency. It is recommended that
1626     * the application avoids unnecessary scene mode switch as much as possible.</p>
1627     *
1628     * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
1629     * @see CaptureRequest#CONTROL_AE_LOCK
1630     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
1631     * @see CaptureRequest#CONTROL_AE_REGIONS
1632     * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
1633     * @see CaptureRequest#CONTROL_AF_REGIONS
1634     * @see CaptureRequest#CONTROL_AF_TRIGGER
1635     * @see CaptureRequest#CONTROL_AWB_LOCK
1636     * @see CaptureRequest#CONTROL_AWB_REGIONS
1637     * @see CaptureRequest#CONTROL_EFFECT_MODE
1638     * @see CaptureRequest#CONTROL_MODE
1639     * @see CaptureRequest#FLASH_MODE
1640     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1641     * @see CaptureRequest#SCALER_CROP_REGION
1642     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
1643     * @see CaptureRequest#CONTROL_SCENE_MODE
1644     */
1645    public static final int CONTROL_SCENE_MODE_HIGH_SPEED_VIDEO = 17;
1646
1647    /**
1648     * <p>Turn on custom high dynamic range (HDR) mode.</p>
1649     * <p>This is intended for LEGACY mode devices only;
1650     * HAL3+ camera devices should not implement this mode.</p>
1651     * @see CaptureRequest#CONTROL_SCENE_MODE
1652     * @hide
1653     */
1654    public static final int CONTROL_SCENE_MODE_HDR = 18;
1655
1656    //
1657    // Enumeration values for CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1658    //
1659
1660    /**
1661     * <p>Video stabilization is disabled.</p>
1662     * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1663     */
1664    public static final int CONTROL_VIDEO_STABILIZATION_MODE_OFF = 0;
1665
1666    /**
1667     * <p>Video stabilization is enabled.</p>
1668     * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
1669     */
1670    public static final int CONTROL_VIDEO_STABILIZATION_MODE_ON = 1;
1671
1672    //
1673    // Enumeration values for CaptureRequest#EDGE_MODE
1674    //
1675
1676    /**
1677     * <p>No edge enhancement is applied.</p>
1678     * @see CaptureRequest#EDGE_MODE
1679     */
1680    public static final int EDGE_MODE_OFF = 0;
1681
1682    /**
1683     * <p>Apply edge enhancement at a quality level that does not slow down frame rate relative to sensor
1684     * output</p>
1685     * @see CaptureRequest#EDGE_MODE
1686     */
1687    public static final int EDGE_MODE_FAST = 1;
1688
1689    /**
1690     * <p>Apply high-quality edge enhancement, at a cost of reducing output frame rate.</p>
1691     * @see CaptureRequest#EDGE_MODE
1692     */
1693    public static final int EDGE_MODE_HIGH_QUALITY = 2;
1694
1695    //
1696    // Enumeration values for CaptureRequest#FLASH_MODE
1697    //
1698
1699    /**
1700     * <p>Do not fire the flash for this capture.</p>
1701     * @see CaptureRequest#FLASH_MODE
1702     */
1703    public static final int FLASH_MODE_OFF = 0;
1704
1705    /**
1706     * <p>If the flash is available and charged, fire flash
1707     * for this capture.</p>
1708     * @see CaptureRequest#FLASH_MODE
1709     */
1710    public static final int FLASH_MODE_SINGLE = 1;
1711
1712    /**
1713     * <p>Transition flash to continuously on.</p>
1714     * @see CaptureRequest#FLASH_MODE
1715     */
1716    public static final int FLASH_MODE_TORCH = 2;
1717
1718    //
1719    // Enumeration values for CaptureRequest#HOT_PIXEL_MODE
1720    //
1721
1722    /**
1723     * <p>No hot pixel correction is applied.</p>
1724     * <p>The frame rate must not be reduced relative to sensor raw output
1725     * for this option.</p>
1726     * <p>The hotpixel map may be returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.</p>
1727     *
1728     * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
1729     * @see CaptureRequest#HOT_PIXEL_MODE
1730     */
1731    public static final int HOT_PIXEL_MODE_OFF = 0;
1732
1733    /**
1734     * <p>Hot pixel correction is applied, without reducing frame
1735     * rate relative to sensor raw output.</p>
1736     * <p>The hotpixel map may be returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.</p>
1737     *
1738     * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
1739     * @see CaptureRequest#HOT_PIXEL_MODE
1740     */
1741    public static final int HOT_PIXEL_MODE_FAST = 1;
1742
1743    /**
1744     * <p>High-quality hot pixel correction is applied, at a cost
1745     * of reducing frame rate relative to sensor raw output.</p>
1746     * <p>The hotpixel map may be returned in {@link CaptureResult#STATISTICS_HOT_PIXEL_MAP android.statistics.hotPixelMap}.</p>
1747     *
1748     * @see CaptureResult#STATISTICS_HOT_PIXEL_MAP
1749     * @see CaptureRequest#HOT_PIXEL_MODE
1750     */
1751    public static final int HOT_PIXEL_MODE_HIGH_QUALITY = 2;
1752
1753    //
1754    // Enumeration values for CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1755    //
1756
1757    /**
1758     * <p>Optical stabilization is unavailable.</p>
1759     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1760     */
1761    public static final int LENS_OPTICAL_STABILIZATION_MODE_OFF = 0;
1762
1763    /**
1764     * <p>Optical stabilization is enabled.</p>
1765     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
1766     */
1767    public static final int LENS_OPTICAL_STABILIZATION_MODE_ON = 1;
1768
1769    //
1770    // Enumeration values for CaptureRequest#NOISE_REDUCTION_MODE
1771    //
1772
1773    /**
1774     * <p>No noise reduction is applied.</p>
1775     * @see CaptureRequest#NOISE_REDUCTION_MODE
1776     */
1777    public static final int NOISE_REDUCTION_MODE_OFF = 0;
1778
1779    /**
1780     * <p>Noise reduction is applied without reducing frame rate relative to sensor
1781     * output.</p>
1782     * @see CaptureRequest#NOISE_REDUCTION_MODE
1783     */
1784    public static final int NOISE_REDUCTION_MODE_FAST = 1;
1785
1786    /**
1787     * <p>High-quality noise reduction is applied, at the cost of reducing frame rate
1788     * relative to sensor output.</p>
1789     * @see CaptureRequest#NOISE_REDUCTION_MODE
1790     */
1791    public static final int NOISE_REDUCTION_MODE_HIGH_QUALITY = 2;
1792
1793    //
1794    // Enumeration values for CaptureRequest#SENSOR_TEST_PATTERN_MODE
1795    //
1796
1797    /**
1798     * <p>No test pattern mode is used, and the camera
1799     * device returns captures from the image sensor.</p>
1800     * <p>This is the default if the key is not set.</p>
1801     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1802     */
1803    public static final int SENSOR_TEST_PATTERN_MODE_OFF = 0;
1804
1805    /**
1806     * <p>Each pixel in <code>[R, G_even, G_odd, B]</code> is replaced by its
1807     * respective color channel provided in
1808     * {@link CaptureRequest#SENSOR_TEST_PATTERN_DATA android.sensor.testPatternData}.</p>
1809     * <p>For example:</p>
1810     * <pre><code>android.testPatternData = [0, 0xFFFFFFFF, 0xFFFFFFFF, 0]
1811     * </code></pre>
1812     * <p>All green pixels are 100% green. All red/blue pixels are black.</p>
1813     * <pre><code>android.testPatternData = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0]
1814     * </code></pre>
1815     * <p>All red pixels are 100% red. Only the odd green pixels
1816     * are 100% green. All blue pixels are 100% black.</p>
1817     *
1818     * @see CaptureRequest#SENSOR_TEST_PATTERN_DATA
1819     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1820     */
1821    public static final int SENSOR_TEST_PATTERN_MODE_SOLID_COLOR = 1;
1822
1823    /**
1824     * <p>All pixel data is replaced with an 8-bar color pattern.</p>
1825     * <p>The vertical bars (left-to-right) are as follows:</p>
1826     * <ul>
1827     * <li>100% white</li>
1828     * <li>yellow</li>
1829     * <li>cyan</li>
1830     * <li>green</li>
1831     * <li>magenta</li>
1832     * <li>red</li>
1833     * <li>blue</li>
1834     * <li>black</li>
1835     * </ul>
1836     * <p>In general the image would look like the following:</p>
1837     * <pre><code>W Y C G M R B K
1838     * W Y C G M R B K
1839     * W Y C G M R B K
1840     * W Y C G M R B K
1841     * W Y C G M R B K
1842     * . . . . . . . .
1843     * . . . . . . . .
1844     * . . . . . . . .
1845     *
1846     * (B = Blue, K = Black)
1847     * </code></pre>
1848     * <p>Each bar should take up 1/8 of the sensor pixel array width.
1849     * When this is not possible, the bar size should be rounded
1850     * down to the nearest integer and the pattern can repeat
1851     * on the right side.</p>
1852     * <p>Each bar's height must always take up the full sensor
1853     * pixel array height.</p>
1854     * <p>Each pixel in this test pattern must be set to either
1855     * 0% intensity or 100% intensity.</p>
1856     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1857     */
1858    public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS = 2;
1859
1860    /**
1861     * <p>The test pattern is similar to COLOR_BARS, except that
1862     * each bar should start at its specified color at the top,
1863     * and fade to gray at the bottom.</p>
1864     * <p>Furthermore each bar is further subdivided into a left and
1865     * right half. The left half should have a smooth gradient,
1866     * and the right half should have a quantized gradient.</p>
1867     * <p>In particular, the right half's should consist of blocks of the
1868     * same color for 1/16th active sensor pixel array width.</p>
1869     * <p>The least significant bits in the quantized gradient should
1870     * be copied from the most significant bits of the smooth gradient.</p>
1871     * <p>The height of each bar should always be a multiple of 128.
1872     * When this is not the case, the pattern should repeat at the bottom
1873     * of the image.</p>
1874     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1875     */
1876    public static final int SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY = 3;
1877
1878    /**
1879     * <p>All pixel data is replaced by a pseudo-random sequence
1880     * generated from a PN9 512-bit sequence (typically implemented
1881     * in hardware with a linear feedback shift register).</p>
1882     * <p>The generator should be reset at the beginning of each frame,
1883     * and thus each subsequent raw frame with this test pattern should
1884     * be exactly the same as the last.</p>
1885     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1886     */
1887    public static final int SENSOR_TEST_PATTERN_MODE_PN9 = 4;
1888
1889    /**
1890     * <p>The first custom test pattern. All custom patterns that are
1891     * available only on this camera device are at least this numeric
1892     * value.</p>
1893     * <p>All of the custom test patterns will be static
1894     * (that is the raw image must not vary from frame to frame).</p>
1895     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1896     */
1897    public static final int SENSOR_TEST_PATTERN_MODE_CUSTOM1 = 256;
1898
1899    //
1900    // Enumeration values for CaptureRequest#SHADING_MODE
1901    //
1902
1903    /**
1904     * <p>No lens shading correction is applied.</p>
1905     * @see CaptureRequest#SHADING_MODE
1906     */
1907    public static final int SHADING_MODE_OFF = 0;
1908
1909    /**
1910     * <p>Apply lens shading corrections, without slowing
1911     * frame rate relative to sensor raw output</p>
1912     * @see CaptureRequest#SHADING_MODE
1913     */
1914    public static final int SHADING_MODE_FAST = 1;
1915
1916    /**
1917     * <p>Apply high-quality lens shading correction, at the
1918     * cost of reduced frame rate.</p>
1919     * @see CaptureRequest#SHADING_MODE
1920     */
1921    public static final int SHADING_MODE_HIGH_QUALITY = 2;
1922
1923    //
1924    // Enumeration values for CaptureRequest#STATISTICS_FACE_DETECT_MODE
1925    //
1926
1927    /**
1928     * <p>Do not include face detection statistics in capture
1929     * results.</p>
1930     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
1931     */
1932    public static final int STATISTICS_FACE_DETECT_MODE_OFF = 0;
1933
1934    /**
1935     * <p>Return face rectangle and confidence values only.</p>
1936     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
1937     */
1938    public static final int STATISTICS_FACE_DETECT_MODE_SIMPLE = 1;
1939
1940    /**
1941     * <p>Return all face
1942     * metadata.</p>
1943     * <p>In this mode, face rectangles, scores, landmarks, and face IDs are all valid.</p>
1944     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
1945     */
1946    public static final int STATISTICS_FACE_DETECT_MODE_FULL = 2;
1947
1948    //
1949    // Enumeration values for CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1950    //
1951
1952    /**
1953     * <p>Do not include a lens shading map in the capture result.</p>
1954     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1955     */
1956    public static final int STATISTICS_LENS_SHADING_MAP_MODE_OFF = 0;
1957
1958    /**
1959     * <p>Include a lens shading map in the capture result.</p>
1960     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1961     */
1962    public static final int STATISTICS_LENS_SHADING_MAP_MODE_ON = 1;
1963
1964    //
1965    // Enumeration values for CaptureRequest#TONEMAP_MODE
1966    //
1967
1968    /**
1969     * <p>Use the tone mapping curve specified in
1970     * the {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}* entries.</p>
1971     * <p>All color enhancement and tonemapping must be disabled, except
1972     * for applying the tonemapping curve specified by
1973     * {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
1974     * <p>Must not slow down frame rate relative to raw
1975     * sensor output.</p>
1976     *
1977     * @see CaptureRequest#TONEMAP_CURVE
1978     * @see CaptureRequest#TONEMAP_MODE
1979     */
1980    public static final int TONEMAP_MODE_CONTRAST_CURVE = 0;
1981
1982    /**
1983     * <p>Advanced gamma mapping and color enhancement may be applied, without
1984     * reducing frame rate compared to raw sensor output.</p>
1985     * @see CaptureRequest#TONEMAP_MODE
1986     */
1987    public static final int TONEMAP_MODE_FAST = 1;
1988
1989    /**
1990     * <p>High-quality gamma mapping and color enhancement will be applied, at
1991     * the cost of reduced frame rate compared to raw sensor output.</p>
1992     * @see CaptureRequest#TONEMAP_MODE
1993     */
1994    public static final int TONEMAP_MODE_HIGH_QUALITY = 2;
1995
1996    //
1997    // Enumeration values for CaptureResult#CONTROL_AE_STATE
1998    //
1999
2000    /**
2001     * <p>AE is off or recently reset.</p>
2002     * <p>When a camera device is opened, it starts in
2003     * this state. This is a transient state, the camera device may skip reporting
2004     * this state in capture result.</p>
2005     * @see CaptureResult#CONTROL_AE_STATE
2006     */
2007    public static final int CONTROL_AE_STATE_INACTIVE = 0;
2008
2009    /**
2010     * <p>AE doesn't yet have a good set of control values
2011     * for the current scene.</p>
2012     * <p>This is a transient state, the camera device may skip
2013     * reporting this state in capture result.</p>
2014     * @see CaptureResult#CONTROL_AE_STATE
2015     */
2016    public static final int CONTROL_AE_STATE_SEARCHING = 1;
2017
2018    /**
2019     * <p>AE has a good set of control values for the
2020     * current scene.</p>
2021     * @see CaptureResult#CONTROL_AE_STATE
2022     */
2023    public static final int CONTROL_AE_STATE_CONVERGED = 2;
2024
2025    /**
2026     * <p>AE has been locked.</p>
2027     * @see CaptureResult#CONTROL_AE_STATE
2028     */
2029    public static final int CONTROL_AE_STATE_LOCKED = 3;
2030
2031    /**
2032     * <p>AE has a good set of control values, but flash
2033     * needs to be fired for good quality still
2034     * capture.</p>
2035     * @see CaptureResult#CONTROL_AE_STATE
2036     */
2037    public static final int CONTROL_AE_STATE_FLASH_REQUIRED = 4;
2038
2039    /**
2040     * <p>AE has been asked to do a precapture sequence
2041     * and is currently executing it.</p>
2042     * <p>Precapture can be triggered through setting
2043     * {@link CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER android.control.aePrecaptureTrigger} to START.</p>
2044     * <p>Once PRECAPTURE completes, AE will transition to CONVERGED
2045     * or FLASH_REQUIRED as appropriate. This is a transient
2046     * state, the camera device may skip reporting this state in
2047     * capture result.</p>
2048     *
2049     * @see CaptureRequest#CONTROL_AE_PRECAPTURE_TRIGGER
2050     * @see CaptureResult#CONTROL_AE_STATE
2051     */
2052    public static final int CONTROL_AE_STATE_PRECAPTURE = 5;
2053
2054    //
2055    // Enumeration values for CaptureResult#CONTROL_AF_STATE
2056    //
2057
2058    /**
2059     * <p>AF is off or has not yet tried to scan/been asked
2060     * to scan.</p>
2061     * <p>When a camera device is opened, it starts in this
2062     * state. This is a transient state, the camera device may
2063     * skip reporting this state in capture
2064     * result.</p>
2065     * @see CaptureResult#CONTROL_AF_STATE
2066     */
2067    public static final int CONTROL_AF_STATE_INACTIVE = 0;
2068
2069    /**
2070     * <p>AF is currently performing an AF scan initiated the
2071     * camera device in a continuous autofocus mode.</p>
2072     * <p>Only used by CONTINUOUS_* AF modes. This is a transient
2073     * state, the camera device may skip reporting this state in
2074     * capture result.</p>
2075     * @see CaptureResult#CONTROL_AF_STATE
2076     */
2077    public static final int CONTROL_AF_STATE_PASSIVE_SCAN = 1;
2078
2079    /**
2080     * <p>AF currently believes it is in focus, but may
2081     * restart scanning at any time.</p>
2082     * <p>Only used by CONTINUOUS_* AF modes. This is a transient
2083     * state, the camera device may skip reporting this state in
2084     * capture result.</p>
2085     * @see CaptureResult#CONTROL_AF_STATE
2086     */
2087    public static final int CONTROL_AF_STATE_PASSIVE_FOCUSED = 2;
2088
2089    /**
2090     * <p>AF is performing an AF scan because it was
2091     * triggered by AF trigger.</p>
2092     * <p>Only used by AUTO or MACRO AF modes. This is a transient
2093     * state, the camera device may skip reporting this state in
2094     * capture result.</p>
2095     * @see CaptureResult#CONTROL_AF_STATE
2096     */
2097    public static final int CONTROL_AF_STATE_ACTIVE_SCAN = 3;
2098
2099    /**
2100     * <p>AF believes it is focused correctly and has locked
2101     * focus.</p>
2102     * <p>This state is reached only after an explicit START AF trigger has been
2103     * sent ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}), when good focus has been obtained.</p>
2104     * <p>The lens will remain stationary until the AF mode ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) is changed or
2105     * a new AF trigger is sent to the camera device ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}).</p>
2106     *
2107     * @see CaptureRequest#CONTROL_AF_MODE
2108     * @see CaptureRequest#CONTROL_AF_TRIGGER
2109     * @see CaptureResult#CONTROL_AF_STATE
2110     */
2111    public static final int CONTROL_AF_STATE_FOCUSED_LOCKED = 4;
2112
2113    /**
2114     * <p>AF has failed to focus successfully and has locked
2115     * focus.</p>
2116     * <p>This state is reached only after an explicit START AF trigger has been
2117     * sent ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}), when good focus cannot be obtained.</p>
2118     * <p>The lens will remain stationary until the AF mode ({@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}) is changed or
2119     * a new AF trigger is sent to the camera device ({@link CaptureRequest#CONTROL_AF_TRIGGER android.control.afTrigger}).</p>
2120     *
2121     * @see CaptureRequest#CONTROL_AF_MODE
2122     * @see CaptureRequest#CONTROL_AF_TRIGGER
2123     * @see CaptureResult#CONTROL_AF_STATE
2124     */
2125    public static final int CONTROL_AF_STATE_NOT_FOCUSED_LOCKED = 5;
2126
2127    /**
2128     * <p>AF finished a passive scan without finding focus,
2129     * and may restart scanning at any time.</p>
2130     * <p>Only used by CONTINUOUS_* AF modes. This is a transient state, the camera
2131     * device may skip reporting this state in capture result.</p>
2132     * <p>LEGACY camera devices do not support this state. When a passive
2133     * scan has finished, it will always go to PASSIVE_FOCUSED.</p>
2134     * @see CaptureResult#CONTROL_AF_STATE
2135     */
2136    public static final int CONTROL_AF_STATE_PASSIVE_UNFOCUSED = 6;
2137
2138    //
2139    // Enumeration values for CaptureResult#CONTROL_AWB_STATE
2140    //
2141
2142    /**
2143     * <p>AWB is not in auto mode, or has not yet started metering.</p>
2144     * <p>When a camera device is opened, it starts in this
2145     * state. This is a transient state, the camera device may
2146     * skip reporting this state in capture
2147     * result.</p>
2148     * @see CaptureResult#CONTROL_AWB_STATE
2149     */
2150    public static final int CONTROL_AWB_STATE_INACTIVE = 0;
2151
2152    /**
2153     * <p>AWB doesn't yet have a good set of control
2154     * values for the current scene.</p>
2155     * <p>This is a transient state, the camera device
2156     * may skip reporting this state in capture result.</p>
2157     * @see CaptureResult#CONTROL_AWB_STATE
2158     */
2159    public static final int CONTROL_AWB_STATE_SEARCHING = 1;
2160
2161    /**
2162     * <p>AWB has a good set of control values for the
2163     * current scene.</p>
2164     * @see CaptureResult#CONTROL_AWB_STATE
2165     */
2166    public static final int CONTROL_AWB_STATE_CONVERGED = 2;
2167
2168    /**
2169     * <p>AWB has been locked.</p>
2170     * @see CaptureResult#CONTROL_AWB_STATE
2171     */
2172    public static final int CONTROL_AWB_STATE_LOCKED = 3;
2173
2174    //
2175    // Enumeration values for CaptureResult#FLASH_STATE
2176    //
2177
2178    /**
2179     * <p>No flash on camera.</p>
2180     * @see CaptureResult#FLASH_STATE
2181     */
2182    public static final int FLASH_STATE_UNAVAILABLE = 0;
2183
2184    /**
2185     * <p>Flash is charging and cannot be fired.</p>
2186     * @see CaptureResult#FLASH_STATE
2187     */
2188    public static final int FLASH_STATE_CHARGING = 1;
2189
2190    /**
2191     * <p>Flash is ready to fire.</p>
2192     * @see CaptureResult#FLASH_STATE
2193     */
2194    public static final int FLASH_STATE_READY = 2;
2195
2196    /**
2197     * <p>Flash fired for this capture.</p>
2198     * @see CaptureResult#FLASH_STATE
2199     */
2200    public static final int FLASH_STATE_FIRED = 3;
2201
2202    /**
2203     * <p>Flash partially illuminated this frame.</p>
2204     * <p>This is usually due to the next or previous frame having
2205     * the flash fire, and the flash spilling into this capture
2206     * due to hardware limitations.</p>
2207     * @see CaptureResult#FLASH_STATE
2208     */
2209    public static final int FLASH_STATE_PARTIAL = 4;
2210
2211    //
2212    // Enumeration values for CaptureResult#LENS_STATE
2213    //
2214
2215    /**
2216     * <p>The lens parameters ({@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2217     * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} and {@link CaptureRequest#LENS_APERTURE android.lens.aperture}) are not changing.</p>
2218     *
2219     * @see CaptureRequest#LENS_APERTURE
2220     * @see CaptureRequest#LENS_FILTER_DENSITY
2221     * @see CaptureRequest#LENS_FOCAL_LENGTH
2222     * @see CaptureRequest#LENS_FOCUS_DISTANCE
2223     * @see CaptureResult#LENS_STATE
2224     */
2225    public static final int LENS_STATE_STATIONARY = 0;
2226
2227    /**
2228     * <p>One or several of the lens parameters
2229     * ({@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}, {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
2230     * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} or {@link CaptureRequest#LENS_APERTURE android.lens.aperture}) is
2231     * currently changing.</p>
2232     *
2233     * @see CaptureRequest#LENS_APERTURE
2234     * @see CaptureRequest#LENS_FILTER_DENSITY
2235     * @see CaptureRequest#LENS_FOCAL_LENGTH
2236     * @see CaptureRequest#LENS_FOCUS_DISTANCE
2237     * @see CaptureResult#LENS_STATE
2238     */
2239    public static final int LENS_STATE_MOVING = 1;
2240
2241    //
2242    // Enumeration values for CaptureResult#STATISTICS_SCENE_FLICKER
2243    //
2244
2245    /**
2246     * <p>The camera device does not detect any flickering illumination
2247     * in the current scene.</p>
2248     * @see CaptureResult#STATISTICS_SCENE_FLICKER
2249     */
2250    public static final int STATISTICS_SCENE_FLICKER_NONE = 0;
2251
2252    /**
2253     * <p>The camera device detects illumination flickering at 50Hz
2254     * in the current scene.</p>
2255     * @see CaptureResult#STATISTICS_SCENE_FLICKER
2256     */
2257    public static final int STATISTICS_SCENE_FLICKER_50HZ = 1;
2258
2259    /**
2260     * <p>The camera device detects illumination flickering at 60Hz
2261     * in the current scene.</p>
2262     * @see CaptureResult#STATISTICS_SCENE_FLICKER
2263     */
2264    public static final int STATISTICS_SCENE_FLICKER_60HZ = 2;
2265
2266    //
2267    // Enumeration values for CaptureResult#SYNC_FRAME_NUMBER
2268    //
2269
2270    /**
2271     * <p>The current result is not yet fully synchronized to any request.</p>
2272     * <p>Synchronization is in progress, and reading metadata from this
2273     * result may include a mix of data that have taken effect since the
2274     * last synchronization time.</p>
2275     * <p>In some future result, within {@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} frames,
2276     * this value will update to the actual frame number frame number
2277     * the result is guaranteed to be synchronized to (as long as the
2278     * request settings remain constant).</p>
2279     *
2280     * @see CameraCharacteristics#SYNC_MAX_LATENCY
2281     * @see CaptureResult#SYNC_FRAME_NUMBER
2282     * @hide
2283     */
2284    public static final int SYNC_FRAME_NUMBER_CONVERGING = -1;
2285
2286    /**
2287     * <p>The current result's synchronization status is unknown.</p>
2288     * <p>The result may have already converged, or it may be in
2289     * progress.  Reading from this result may include some mix
2290     * of settings from past requests.</p>
2291     * <p>After a settings change, the new settings will eventually all
2292     * take effect for the output buffers and results. However, this
2293     * value will not change when that happens. Altering settings
2294     * rapidly may provide outcomes using mixes of settings from recent
2295     * requests.</p>
2296     * <p>This value is intended primarily for backwards compatibility with
2297     * the older camera implementations (for android.hardware.Camera).</p>
2298     * @see CaptureResult#SYNC_FRAME_NUMBER
2299     * @hide
2300     */
2301    public static final int SYNC_FRAME_NUMBER_UNKNOWN = -2;
2302
2303    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2304     * End generated code
2305     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
2306
2307}
2308