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