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