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