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