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