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