CameraCharacteristics.java revision 8490ace76fd350e53de9554c11fca715c5a37aaf
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 in addition to through the CameraDevice interface.</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     * 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 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 should
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     */
591    public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
592            new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
593
594    /**
595     * <p>The lens focus distance calibration quality.</p>
596     * <p>The lens focus distance calibration quality determines the reliability of
597     * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
598     * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
599     * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
600     *
601     * @see CaptureRequest#LENS_FOCUS_DISTANCE
602     * @see CaptureResult#LENS_FOCUS_RANGE
603     * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
604     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
605     * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
606     * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
607     * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
608     */
609    public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
610            new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
611
612    /**
613     * <p>Direction the camera faces relative to
614     * device screen</p>
615     * @see #LENS_FACING_FRONT
616     * @see #LENS_FACING_BACK
617     */
618    public static final Key<Integer> LENS_FACING =
619            new Key<Integer>("android.lens.facing", int.class);
620
621    /**
622     * <p>The set of noise reduction modes supported by this camera device.</p>
623     * <p>This tag lists the valid modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}.</p>
624     * <p>Full-capability camera devices must laways support OFF and FAST.</p>
625     *
626     * @see CaptureRequest#NOISE_REDUCTION_MODE
627     */
628    public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
629            new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
630
631    /**
632     * <p>If set to 1, the HAL will always split result
633     * metadata for a single capture into multiple buffers,
634     * returned using multiple process_capture_result calls.</p>
635     * <p>Does not need to be listed in static
636     * metadata. Support for partial results will be reworked in
637     * future versions of camera service. This quirk will stop
638     * working at that point; DO NOT USE without careful
639     * consideration of future support.</p>
640     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
641     * @deprecated
642     * @hide
643     */
644    @Deprecated
645    public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
646            new Key<Byte>("android.quirks.usePartialResult", byte.class);
647
648    /**
649     * <p>The maximum numbers of different types of output streams
650     * that can be configured and used simultaneously by a camera device.</p>
651     * <p>This is a 3 element tuple that contains the max number of output simultaneous
652     * streams for raw sensor, processed (but not stalling), and processed (and stalling)
653     * formats respectively. For example, assuming that JPEG is typically a processed and
654     * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
655     * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
656     * <p>This lists the upper bound of the number of output streams supported by
657     * the camera device. Using more streams simultaneously may require more hardware and
658     * CPU resources that will consume more power. The image format for an output stream can
659     * be any supported format provided by android.scaler.availableStreamConfigurations.
660     * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
661     * into the 3 stream types as below:</p>
662     * <ul>
663     * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
664     * Typically JPEG format (ImageFormat#JPEG).</li>
665     * <li>Raw formats: ImageFormat#RAW_SENSOR and ImageFormat#RAW_OPAQUE.</li>
666     * <li>Processed (but not-stalling): any non-RAW format without a stall duration.
667     * Typically ImageFormat#YUV_420_888, ImageFormat#NV21, ImageFormat#YV12.</li>
668     * </ul>
669     * @hide
670     */
671    public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
672            new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
673
674    /**
675     * <p>The maximum numbers of different types of output streams
676     * that can be configured and used simultaneously by a camera device
677     * for any <code>RAW</code> formats.</p>
678     * <p>This value contains the max number of output simultaneous
679     * streams from the raw sensor.</p>
680     * <p>This lists the upper bound of the number of output streams supported by
681     * the camera device. Using more streams simultaneously may require more hardware and
682     * CPU resources that will consume more power. The image format for this kind of an output stream can
683     * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
684     * <p>In particular, a <code>RAW</code> format is typically one of:</p>
685     * <ul>
686     * <li>ImageFormat#RAW_SENSOR</li>
687     * <li>Opaque <code>RAW</code></li>
688     * </ul>
689     *
690     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
691     */
692    public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
693            new Key<Integer>("android.request.maxNumOutputRaw", int.class);
694
695    /**
696     * <p>The maximum numbers of different types of output streams
697     * that can be configured and used simultaneously by a camera device
698     * for any processed (but not-stalling) formats.</p>
699     * <p>This value contains the max number of output simultaneous
700     * streams for any processed (but not-stalling) formats.</p>
701     * <p>This lists the upper bound of the number of output streams supported by
702     * the camera device. Using more streams simultaneously may require more hardware and
703     * CPU resources that will consume more power. The image format for this kind of an output stream can
704     * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
705     * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
706     * Typically:</p>
707     * <ul>
708     * <li>ImageFormat#YUV_420_888</li>
709     * <li>ImageFormat#NV21</li>
710     * <li>ImageFormat#YV12</li>
711     * <li>Implementation-defined formats, i.e. StreamConfiguration#isOutputSupportedFor(Class)</li>
712     * </ul>
713     * <p>For full guarantees, query StreamConfigurationMap#getOutputStallDuration with
714     * a processed format -- it will return 0 for a non-stalling stream.</p>
715     *
716     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
717     */
718    public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
719            new Key<Integer>("android.request.maxNumOutputProc", int.class);
720
721    /**
722     * <p>The maximum numbers of different types of output streams
723     * that can be configured and used simultaneously by a camera device
724     * for any processed (and stalling) formats.</p>
725     * <p>This value contains the max number of output simultaneous
726     * streams for any processed (but not-stalling) formats.</p>
727     * <p>This lists the upper bound of the number of output streams supported by
728     * the camera device. Using more streams simultaneously may require more hardware and
729     * CPU resources that will consume more power. The image format for this kind of an output stream can
730     * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
731     * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations &gt; 0.
732     * Typically only the <code>JPEG</code> format (ImageFormat#JPEG)</p>
733     * <p>For full guarantees, query StreamConfigurationMap#getOutputStallDuration with
734     * a processed format -- it will return a non-0 value for a stalling stream.</p>
735     *
736     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
737     */
738    public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
739            new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
740
741    /**
742     * <p>The maximum numbers of any type of input streams
743     * that can be configured and used simultaneously by a camera device.</p>
744     * <p>When set to 0, it means no input stream is supported.</p>
745     * <p>The image format for a input stream can be any supported
746     * format provided by
747     * android.scaler.availableInputOutputFormatsMap. When using an
748     * input stream, there must be at least one output stream
749     * configured to to receive the reprocessed images.</p>
750     * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
751     * stream image format will be RAW_OPAQUE, the associated output stream image format
752     * should be JPEG.</p>
753     */
754    public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
755            new Key<Integer>("android.request.maxNumInputStreams", int.class);
756
757    /**
758     * <p>Specifies the number of maximum pipeline stages a frame
759     * has to go through from when it's exposed to when it's available
760     * to the framework.</p>
761     * <p>A typical minimum value for this is 2 (one stage to expose,
762     * one stage to readout) from the sensor. The ISP then usually adds
763     * its own stages to do custom HW processing. Further stages may be
764     * added by SW processing.</p>
765     * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
766     * processing is enabled (e.g. face detection), the actual pipeline
767     * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
768     * the max pipeline depth.</p>
769     * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
770     * X frame intervals.</p>
771     * <p>This value will be 8 or less.</p>
772     *
773     * @see CaptureResult#REQUEST_PIPELINE_DEPTH
774     */
775    public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
776            new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
777
778    /**
779     * <p>Optional. Defaults to 1. Defines how many sub-components
780     * a result will be composed of.</p>
781     * <p>In order to combat the pipeline latency, partial results
782     * may be delivered to the application layer from the camera device as
783     * soon as they are available.</p>
784     * <p>A value of 1 means that partial results are not supported.</p>
785     * <p>A typical use case for this might be: after requesting an AF lock the
786     * new AF state might be available 50% of the way through the pipeline.
787     * The camera device could then immediately dispatch this state via a
788     * partial result to the framework/application layer, and the rest of
789     * the metadata via later partial results.</p>
790     */
791    public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
792            new Key<Integer>("android.request.partialResultCount", int.class);
793
794    /**
795     * <p>List of capabilities that the camera device
796     * advertises as fully supporting.</p>
797     * <p>A capability is a contract that the camera device makes in order
798     * to be able to satisfy one or more use cases.</p>
799     * <p>Listing a capability guarantees that the whole set of features
800     * required to support a common use will all be available.</p>
801     * <p>Using a subset of the functionality provided by an unsupported
802     * capability may be possible on a specific camera device implementation;
803     * to do this query each of android.request.availableRequestKeys,
804     * android.request.availableResultKeys,
805     * android.request.availableCharacteristicsKeys.</p>
806     * <p>XX: Maybe these should go into {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}
807     * as a table instead?</p>
808     * <p>The following capabilities are guaranteed to be available on
809     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
810     * <ul>
811     * <li>MANUAL_SENSOR</li>
812     * <li>ZSL</li>
813     * </ul>
814     * <p>Other capabilities may be available on either FULL or LIMITED
815     * devices, but the app. should query this field to be sure.</p>
816     *
817     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
818     * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
819     * @see #REQUEST_AVAILABLE_CAPABILITIES_OPTIONAL
820     * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
821     * @see #REQUEST_AVAILABLE_CAPABILITIES_GCAM
822     * @see #REQUEST_AVAILABLE_CAPABILITIES_ZSL
823     * @see #REQUEST_AVAILABLE_CAPABILITIES_DNG
824     */
825    public static final Key<Integer> REQUEST_AVAILABLE_CAPABILITIES =
826            new Key<Integer>("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     * <p>TODO: This should be used by #getAvailableCaptureRequestKeys.</p>
839     *
840     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
841     * @hide
842     */
843    public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
844            new Key<int[]>("android.request.availableRequestKeys", int[].class);
845
846    /**
847     * <p>A list of all keys that the camera device has available
848     * to use with CaptureResult.</p>
849     * <p>Attempting to get a key from a CaptureResult that is not
850     * listed here will always return a <code>null</code> value. Getting a key from
851     * a CaptureResult that is listed here must never return a <code>null</code>
852     * value.</p>
853     * <p>The following keys may return <code>null</code> unless they are enabled:</p>
854     * <ul>
855     * <li>{@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
856     * </ul>
857     * <p>(Those sometimes-null keys should nevertheless be listed here
858     * if they are available.)</p>
859     * <p>This field can be used to query the feature set of a camera device
860     * at a more granular level than capabilities. This is especially
861     * important for optional keys that are not listed under any capability
862     * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
863     * <p>TODO: This should be used by #getAvailableCaptureResultKeys.</p>
864     *
865     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
866     * @see CaptureResult#STATISTICS_LENS_SHADING_MAP
867     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
868     * @hide
869     */
870    public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
871            new Key<int[]>("android.request.availableResultKeys", int[].class);
872
873    /**
874     * <p>A list of all keys that the camera device has available
875     * to use with CameraCharacteristics.</p>
876     * <p>This entry follows the same rules as
877     * android.request.availableResultKeys (except that it applies for
878     * CameraCharacteristics instead of CaptureResult). See above for more
879     * details.</p>
880     * <p>TODO: This should be used by CameraCharacteristics#getKeys.</p>
881     * @hide
882     */
883    public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
884            new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
885
886    /**
887     * <p>The list of image formats that are supported by this
888     * camera device for output streams.</p>
889     * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
890     * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
891     * @deprecated
892     * @hide
893     */
894    @Deprecated
895    public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
896            new Key<int[]>("android.scaler.availableFormats", int[].class);
897
898    /**
899     * <p>The minimum frame duration that is supported
900     * for each resolution in android.scaler.availableJpegSizes.</p>
901     * <p>This corresponds to the minimum steady-state frame duration when only
902     * that JPEG stream is active and captured in a burst, with all
903     * processing (typically in android.*.mode) set to FAST.</p>
904     * <p>When multiple streams are configured, the minimum
905     * frame duration will be &gt;= max(individual stream min
906     * durations)</p>
907     * @deprecated
908     * @hide
909     */
910    @Deprecated
911    public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
912            new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
913
914    /**
915     * <p>The JPEG resolutions that are supported by this camera device.</p>
916     * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
917     * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
918     *
919     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
920     * @deprecated
921     * @hide
922     */
923    @Deprecated
924    public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
925            new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
926
927    /**
928     * <p>The maximum ratio between active area width
929     * and crop region width, or between active area height and
930     * crop region height, if the crop region height is larger
931     * than width</p>
932     */
933    public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
934            new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
935
936    /**
937     * <p>For each available processed output size (defined in
938     * android.scaler.availableProcessedSizes), this property lists the
939     * minimum supportable frame duration for that size.</p>
940     * <p>This should correspond to the frame duration when only that processed
941     * stream is active, with all processing (typically in android.*.mode)
942     * set to FAST.</p>
943     * <p>When multiple streams are configured, the minimum frame duration will
944     * be &gt;= max(individual stream min durations).</p>
945     * @deprecated
946     * @hide
947     */
948    @Deprecated
949    public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
950            new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
951
952    /**
953     * <p>The resolutions available for use with
954     * processed output streams, such as YV12, NV12, and
955     * platform opaque YUV/RGB streams to the GPU or video
956     * encoders.</p>
957     * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
958     * <p>For a given use case, the actual maximum supported resolution
959     * may be lower than what is listed here, depending on the destination
960     * Surface for the image data. For example, for recording video,
961     * the video encoder chosen may have a maximum size limit (e.g. 1080p)
962     * smaller than what the camera (e.g. maximum resolution is 3264x2448)
963     * can provide.</p>
964     * <p>Please reference the documentation for the image data destination to
965     * check if it limits the maximum size for image data.</p>
966     * @deprecated
967     * @hide
968     */
969    @Deprecated
970    public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
971            new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
972
973    /**
974     * <p>The mapping of image formats that are supported by this
975     * camera device for input streams, to their corresponding output formats.</p>
976     * <p>All camera devices with at least 1
977     * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
978     * available input format.</p>
979     * <p>The camera device will support the following map of formats,
980     * if its dependent capability is supported:</p>
981     * <table>
982     * <thead>
983     * <tr>
984     * <th align="left">Input Format</th>
985     * <th align="left">Output Format</th>
986     * <th align="left">Capability</th>
987     * </tr>
988     * </thead>
989     * <tbody>
990     * <tr>
991     * <td align="left">RAW_OPAQUE</td>
992     * <td align="left">JPEG</td>
993     * <td align="left">ZSL</td>
994     * </tr>
995     * <tr>
996     * <td align="left">RAW_OPAQUE</td>
997     * <td align="left">YUV_420_888</td>
998     * <td align="left">ZSL</td>
999     * </tr>
1000     * <tr>
1001     * <td align="left">RAW_OPAQUE</td>
1002     * <td align="left">RAW16</td>
1003     * <td align="left">DNG</td>
1004     * </tr>
1005     * <tr>
1006     * <td align="left">RAW16</td>
1007     * <td align="left">YUV_420_888</td>
1008     * <td align="left">DNG</td>
1009     * </tr>
1010     * <tr>
1011     * <td align="left">RAW16</td>
1012     * <td align="left">JPEG</td>
1013     * <td align="left">DNG</td>
1014     * </tr>
1015     * </tbody>
1016     * </table>
1017     * <p>For ZSL-capable camera devices, using the RAW_OPAQUE format
1018     * as either input or output will never hurt maximum frame rate (i.e.
1019     * StreamConfigurationMap#getOutputStallDuration(int,Size)
1020     * for a <code>format =</code> RAW_OPAQUE is always 0).</p>
1021     * <p>Attempting to configure an input stream with output streams not
1022     * listed as available in this map is not valid.</p>
1023     * <p>TODO: typedef to ReprocessFormatMap</p>
1024     *
1025     * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
1026     * @hide
1027     */
1028    public static final Key<int[]> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
1029            new Key<int[]>("android.scaler.availableInputOutputFormatsMap", int[].class);
1030
1031    /**
1032     * <p>The available stream configurations that this
1033     * camera device supports
1034     * (i.e. format, width, height, output/input stream).</p>
1035     * <p>The configurations are listed as <code>(format, width, height, input?)</code>
1036     * tuples.</p>
1037     * <p>All camera devices will support sensor maximum resolution (defined by
1038     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
1039     * <p>For a given use case, the actual maximum supported resolution
1040     * may be lower than what is listed here, depending on the destination
1041     * Surface for the image data. For example, for recording video,
1042     * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1043     * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1044     * can provide.</p>
1045     * <p>Please reference the documentation for the image data destination to
1046     * check if it limits the maximum size for image data.</p>
1047     * <p>Not all output formats may be supported in a configuration with
1048     * an input stream of a particular format. For more details, see
1049     * android.scaler.availableInputOutputFormatsMap.</p>
1050     * <p>The following table describes the minimum required output stream
1051     * configurations based on the hardware level
1052     * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
1053     * <table>
1054     * <thead>
1055     * <tr>
1056     * <th align="center">Format</th>
1057     * <th align="center">Size</th>
1058     * <th align="center">Hardware Level</th>
1059     * <th align="center">Notes</th>
1060     * </tr>
1061     * </thead>
1062     * <tbody>
1063     * <tr>
1064     * <td align="center">JPEG</td>
1065     * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
1066     * <td align="center">Any</td>
1067     * <td align="center"></td>
1068     * </tr>
1069     * <tr>
1070     * <td align="center">JPEG</td>
1071     * <td align="center">1920x1080 (1080p)</td>
1072     * <td align="center">Any</td>
1073     * <td align="center">if 1080p &lt;= activeArraySize</td>
1074     * </tr>
1075     * <tr>
1076     * <td align="center">JPEG</td>
1077     * <td align="center">1280x720 (720)</td>
1078     * <td align="center">Any</td>
1079     * <td align="center">if 720p &lt;= activeArraySize</td>
1080     * </tr>
1081     * <tr>
1082     * <td align="center">JPEG</td>
1083     * <td align="center">640x480 (480p)</td>
1084     * <td align="center">Any</td>
1085     * <td align="center">if 480p &lt;= activeArraySize</td>
1086     * </tr>
1087     * <tr>
1088     * <td align="center">JPEG</td>
1089     * <td align="center">320x240 (240p)</td>
1090     * <td align="center">Any</td>
1091     * <td align="center">if 240p &lt;= activeArraySize</td>
1092     * </tr>
1093     * <tr>
1094     * <td align="center">YUV_420_888</td>
1095     * <td align="center">all output sizes available for JPEG</td>
1096     * <td align="center">FULL</td>
1097     * <td align="center"></td>
1098     * </tr>
1099     * <tr>
1100     * <td align="center">YUV_420_888</td>
1101     * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
1102     * <td align="center">LIMITED</td>
1103     * <td align="center"></td>
1104     * </tr>
1105     * <tr>
1106     * <td align="center">IMPLEMENTATION_DEFINED</td>
1107     * <td align="center">same as YUV_420_888</td>
1108     * <td align="center">Any</td>
1109     * <td align="center"></td>
1110     * </tr>
1111     * </tbody>
1112     * </table>
1113     * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
1114     * mandatory stream configurations on a per-capability basis.</p>
1115     *
1116     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1117     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1118     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1119     * @hide
1120     */
1121    public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
1122            new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
1123
1124    /**
1125     * <p>This lists the minimum frame duration for each
1126     * format/size combination.</p>
1127     * <p>This should correspond to the frame duration when only that
1128     * stream is active, with all processing (typically in android.*.mode)
1129     * set to either OFF or FAST.</p>
1130     * <p>When multiple streams are used in a request, the minimum frame
1131     * duration will be max(individual stream min durations).</p>
1132     * <p>The minimum frame duration of a stream (of a particular format, size)
1133     * is the same regardless of whether the stream is input or output.</p>
1134     * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
1135     * android.scaler.availableStallDurations for more details about
1136     * calculating the max frame rate.</p>
1137     * <p>(Keep in sync with
1138     * StreamConfigurationMap#getOutputMinFrameDuration)</p>
1139     *
1140     * @see CaptureRequest#SENSOR_FRAME_DURATION
1141     * @hide
1142     */
1143    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
1144            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
1145
1146    /**
1147     * <p>This lists the maximum stall duration for each
1148     * format/size combination.</p>
1149     * <p>A stall duration is how much extra time would get added
1150     * to the normal minimum frame duration for a repeating request
1151     * that has streams with non-zero stall.</p>
1152     * <p>For example, consider JPEG captures which have the following
1153     * characteristics:</p>
1154     * <ul>
1155     * <li>JPEG streams act like processed YUV streams in requests for which
1156     * they are not included; in requests in which they are directly
1157     * referenced, they act as JPEG streams. This is because supporting a
1158     * JPEG stream requires the underlying YUV data to always be ready for
1159     * use by a JPEG encoder, but the encoder will only be used (and impact
1160     * frame duration) on requests that actually reference a JPEG stream.</li>
1161     * <li>The JPEG processor can run concurrently to the rest of the camera
1162     * pipeline, but cannot process more than 1 capture at a time.</li>
1163     * </ul>
1164     * <p>In other words, using a repeating YUV request would result
1165     * in a steady frame rate (let's say it's 30 FPS). If a single
1166     * JPEG request is submitted periodically, the frame rate will stay
1167     * at 30 FPS (as long as we wait for the previous JPEG to return each
1168     * time). If we try to submit a repeating YUV + JPEG request, then
1169     * the frame rate will drop from 30 FPS.</p>
1170     * <p>In general, submitting a new request with a non-0 stall time
1171     * stream will <em>not</em> cause a frame rate drop unless there are still
1172     * outstanding buffers for that stream from previous requests.</p>
1173     * <p>Submitting a repeating request with streams (call this <code>S</code>)
1174     * is the same as setting the minimum frame duration from
1175     * the normal minimum frame duration corresponding to <code>S</code>, added with
1176     * the maximum stall duration for <code>S</code>.</p>
1177     * <p>If interleaving requests with and without a stall duration,
1178     * a request will stall by the maximum of the remaining times
1179     * for each can-stall stream with outstanding buffers.</p>
1180     * <p>This means that a stalling request will not have an exposure start
1181     * until the stall has completed.</p>
1182     * <p>This should correspond to the stall duration when only that stream is
1183     * active, with all processing (typically in android.*.mode) set to FAST
1184     * or OFF. Setting any of the processing modes to HIGH_QUALITY
1185     * effectively results in an indeterminate stall duration for all
1186     * streams in a request (the regular stall calculation rules are
1187     * ignored).</p>
1188     * <p>The following formats may always have a stall duration:</p>
1189     * <ul>
1190     * <li>JPEG</li>
1191     * <li>RAW16</li>
1192     * </ul>
1193     * <p>The following formats will never have a stall duration:</p>
1194     * <ul>
1195     * <li>YUV_420_888</li>
1196     * <li>IMPLEMENTATION_DEFINED</li>
1197     * </ul>
1198     * <p>All other formats may or may not have an allowed stall duration on
1199     * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1200     * for more details.</p>
1201     * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
1202     * calculating the max frame rate (absent stalls).</p>
1203     * <p>(Keep up to date with
1204     * StreamConfigurationMap#getOutputStallDuration(int, Size) )</p>
1205     *
1206     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1207     * @see CaptureRequest#SENSOR_FRAME_DURATION
1208     * @hide
1209     */
1210    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
1211            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
1212
1213    /**
1214     * <p>The available stream configurations that this
1215     * camera device supports; also includes the minimum frame durations
1216     * and the stall durations for each format/size combination.</p>
1217     * <p>All camera devices will support sensor maximum resolution (defined by
1218     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
1219     * <p>For a given use case, the actual maximum supported resolution
1220     * may be lower than what is listed here, depending on the destination
1221     * Surface for the image data. For example, for recording video,
1222     * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1223     * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1224     * can provide.</p>
1225     * <p>Please reference the documentation for the image data destination to
1226     * check if it limits the maximum size for image data.</p>
1227     * <p>The following table describes the minimum required output stream
1228     * configurations based on the hardware level
1229     * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
1230     * <table>
1231     * <thead>
1232     * <tr>
1233     * <th align="center">Format</th>
1234     * <th align="center">Size</th>
1235     * <th align="center">Hardware Level</th>
1236     * <th align="center">Notes</th>
1237     * </tr>
1238     * </thead>
1239     * <tbody>
1240     * <tr>
1241     * <td align="center">JPEG</td>
1242     * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
1243     * <td align="center">Any</td>
1244     * <td align="center"></td>
1245     * </tr>
1246     * <tr>
1247     * <td align="center">JPEG</td>
1248     * <td align="center">1920x1080 (1080p)</td>
1249     * <td align="center">Any</td>
1250     * <td align="center">if 1080p &lt;= activeArraySize</td>
1251     * </tr>
1252     * <tr>
1253     * <td align="center">JPEG</td>
1254     * <td align="center">1280x720 (720)</td>
1255     * <td align="center">Any</td>
1256     * <td align="center">if 720p &lt;= activeArraySize</td>
1257     * </tr>
1258     * <tr>
1259     * <td align="center">JPEG</td>
1260     * <td align="center">640x480 (480p)</td>
1261     * <td align="center">Any</td>
1262     * <td align="center">if 480p &lt;= activeArraySize</td>
1263     * </tr>
1264     * <tr>
1265     * <td align="center">JPEG</td>
1266     * <td align="center">320x240 (240p)</td>
1267     * <td align="center">Any</td>
1268     * <td align="center">if 240p &lt;= activeArraySize</td>
1269     * </tr>
1270     * <tr>
1271     * <td align="center">YUV_420_888</td>
1272     * <td align="center">all output sizes available for JPEG</td>
1273     * <td align="center">FULL</td>
1274     * <td align="center"></td>
1275     * </tr>
1276     * <tr>
1277     * <td align="center">YUV_420_888</td>
1278     * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
1279     * <td align="center">LIMITED</td>
1280     * <td align="center"></td>
1281     * </tr>
1282     * <tr>
1283     * <td align="center">IMPLEMENTATION_DEFINED</td>
1284     * <td align="center">same as YUV_420_888</td>
1285     * <td align="center">Any</td>
1286     * <td align="center"></td>
1287     * </tr>
1288     * </tbody>
1289     * </table>
1290     * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
1291     * mandatory stream configurations on a per-capability basis.</p>
1292     *
1293     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1294     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1295     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1296     */
1297    public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
1298            new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
1299
1300    /**
1301     * <p>The crop type that this camera device supports.</p>
1302     * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
1303     * device that only supports CENTER_ONLY cropping, the camera device will move the
1304     * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
1305     * and keep the crop region width and height unchanged. The camera device will return the
1306     * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
1307     * <p>Camera devices that support FREEFORM cropping will support any crop region that
1308     * is inside of the active array. The camera device will apply the same crop region and
1309     * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
1310     * <p>FULL capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL) will support
1311     * FREEFORM cropping.</p>
1312     *
1313     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1314     * @see CaptureRequest#SCALER_CROP_REGION
1315     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1316     * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
1317     * @see #SCALER_CROPPING_TYPE_FREEFORM
1318     */
1319    public static final Key<Integer> SCALER_CROPPING_TYPE =
1320            new Key<Integer>("android.scaler.croppingType", int.class);
1321
1322    /**
1323     * <p>Area of raw data which corresponds to only
1324     * active pixels.</p>
1325     * <p>It is smaller or equal to
1326     * sensor full pixel array, which could include the black calibration pixels.</p>
1327     */
1328    public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
1329            new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
1330
1331    /**
1332     * <p>Range of valid sensitivities</p>
1333     */
1334    public static final Key<int[]> SENSOR_INFO_SENSITIVITY_RANGE =
1335            new Key<int[]>("android.sensor.info.sensitivityRange", int[].class);
1336
1337    /**
1338     * <p>Arrangement of color filters on sensor;
1339     * represents the colors in the top-left 2x2 section of
1340     * the sensor, in reading order</p>
1341     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
1342     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
1343     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
1344     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
1345     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
1346     */
1347    public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
1348            new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
1349
1350    /**
1351     * <p>Range of valid exposure
1352     * times used by {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}.</p>
1353     *
1354     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
1355     */
1356    public static final Key<long[]> SENSOR_INFO_EXPOSURE_TIME_RANGE =
1357            new Key<long[]>("android.sensor.info.exposureTimeRange", long[].class);
1358
1359    /**
1360     * <p>Maximum possible frame duration (minimum frame
1361     * rate).</p>
1362     * <p>The largest possible {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration}
1363     * that will be accepted by the camera device. Attempting to use
1364     * frame durations beyond the maximum will result in the frame duration
1365     * being clipped to the maximum. See that control
1366     * for a full definition of frame durations.</p>
1367     * <p>Refer to
1368     * StreamConfigurationMap#getOutputMinFrameDuration(int,Size)
1369     * for the minimum frame duration values.</p>
1370     *
1371     * @see CaptureRequest#SENSOR_FRAME_DURATION
1372     */
1373    public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
1374            new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
1375
1376    /**
1377     * <p>The physical dimensions of the full pixel
1378     * array</p>
1379     * <p>Needed for FOV calculation for old API</p>
1380     */
1381    public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
1382            new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
1383
1384    /**
1385     * <p>Dimensions of full pixel array, possibly
1386     * including black calibration pixels.</p>
1387     * <p>Maximum output resolution for raw format must
1388     * match this in
1389     * android.scaler.availableStreamConfigurations.</p>
1390     */
1391    public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
1392            new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
1393
1394    /**
1395     * <p>Maximum raw value output by sensor.</p>
1396     * <p>This specifies the fully-saturated encoding level for the raw
1397     * sample values from the sensor.  This is typically caused by the
1398     * sensor becoming highly non-linear or clipping. The minimum for
1399     * each channel is specified by the offset in the
1400     * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} tag.</p>
1401     * <p>The white level is typically determined either by sensor bit depth
1402     * (8-14 bits is expected), or by the point where the sensor response
1403     * becomes too non-linear to be useful.  The default value for this is
1404     * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
1405     *
1406     * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
1407     */
1408    public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
1409            new Key<Integer>("android.sensor.info.whiteLevel", int.class);
1410
1411    /**
1412     * <p>The standard reference illuminant used as the scene light source when
1413     * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
1414     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
1415     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
1416     * <p>The values in this tag correspond to the values defined for the
1417     * EXIF LightSource tag. These illuminants are standard light sources
1418     * that are often used calibrating camera devices.</p>
1419     * <p>If this tag is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
1420     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
1421     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
1422     * <p>Some devices may choose to provide a second set of calibration
1423     * information for improved quality, including
1424     * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
1425     *
1426     * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
1427     * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
1428     * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
1429     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
1430     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
1431     * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
1432     * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
1433     * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
1434     * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
1435     * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
1436     * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
1437     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
1438     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
1439     * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
1440     * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
1441     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
1442     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
1443     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
1444     * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
1445     * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
1446     * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
1447     * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
1448     * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
1449     */
1450    public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
1451            new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
1452
1453    /**
1454     * <p>The standard reference illuminant used as the scene light source when
1455     * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
1456     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
1457     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
1458     * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.
1459     * Valid values for this are the same as those given for the first
1460     * reference illuminant.</p>
1461     * <p>If this tag is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
1462     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
1463     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
1464     *
1465     * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
1466     * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
1467     * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
1468     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
1469     */
1470    public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
1471            new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
1472
1473    /**
1474     * <p>A per-device calibration transform matrix that maps from the
1475     * reference sensor colorspace to the actual device sensor colorspace.</p>
1476     * <p>This matrix is used to correct for per-device variations in the
1477     * sensor colorspace, and is used for processing raw buffer data.</p>
1478     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
1479     * contains a per-device calibration transform that maps colors
1480     * from reference sensor color space (i.e. the "golden module"
1481     * colorspace) into this camera device's native sensor color
1482     * space under the first reference illuminant
1483     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
1484     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1485     *
1486     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
1487     */
1488    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
1489            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
1490
1491    /**
1492     * <p>A per-device calibration transform matrix that maps from the
1493     * reference sensor colorspace to the actual device sensor colorspace
1494     * (this is the colorspace of the raw buffer data).</p>
1495     * <p>This matrix is used to correct for per-device variations in the
1496     * sensor colorspace, and is used for processing raw buffer data.</p>
1497     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
1498     * contains a per-device calibration transform that maps colors
1499     * from reference sensor color space (i.e. the "golden module"
1500     * colorspace) into this camera device's native sensor color
1501     * space under the second reference illuminant
1502     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
1503     * <p>This matrix will only be present if the second reference
1504     * illuminant is present.</p>
1505     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1506     *
1507     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
1508     */
1509    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
1510            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
1511
1512    /**
1513     * <p>A matrix that transforms color values from CIE XYZ color space to
1514     * reference sensor color space.</p>
1515     * <p>This matrix is used to convert from the standard CIE XYZ color
1516     * space to the reference sensor colorspace, and is used when processing
1517     * raw buffer data.</p>
1518     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
1519     * contains a color transform matrix that maps colors from the CIE
1520     * XYZ color space to the reference sensor color space (i.e. the
1521     * "golden module" colorspace) under the first reference illuminant
1522     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
1523     * <p>The white points chosen in both the reference sensor color space
1524     * and the CIE XYZ colorspace when calculating this transform will
1525     * match the standard white point for the first reference illuminant
1526     * (i.e. no chromatic adaptation will be applied by this transform).</p>
1527     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1528     *
1529     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
1530     */
1531    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
1532            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
1533
1534    /**
1535     * <p>A matrix that transforms color values from CIE XYZ color space to
1536     * reference sensor color space.</p>
1537     * <p>This matrix is used to convert from the standard CIE XYZ color
1538     * space to the reference sensor colorspace, and is used when processing
1539     * raw buffer data.</p>
1540     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
1541     * contains a color transform matrix that maps colors from the CIE
1542     * XYZ color space to the reference sensor color space (i.e. the
1543     * "golden module" colorspace) under the second reference illuminant
1544     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
1545     * <p>The white points chosen in both the reference sensor color space
1546     * and the CIE XYZ colorspace when calculating this transform will
1547     * match the standard white point for the second reference illuminant
1548     * (i.e. no chromatic adaptation will be applied by this transform).</p>
1549     * <p>This matrix will only be present if the second reference
1550     * illuminant is present.</p>
1551     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1552     *
1553     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
1554     */
1555    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
1556            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
1557
1558    /**
1559     * <p>A matrix that transforms white balanced camera colors from the reference
1560     * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
1561     * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
1562     * is used when processing raw buffer data.</p>
1563     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
1564     * a color transform matrix that maps white balanced colors from the
1565     * reference sensor color space to the CIE XYZ color space with a D50 white
1566     * point.</p>
1567     * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
1568     * this matrix is chosen so that the standard white point for this reference
1569     * illuminant in the reference sensor colorspace is mapped to D50 in the
1570     * CIE XYZ colorspace.</p>
1571     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1572     *
1573     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
1574     */
1575    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
1576            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
1577
1578    /**
1579     * <p>A matrix that transforms white balanced camera colors from the reference
1580     * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
1581     * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
1582     * is used when processing raw buffer data.</p>
1583     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
1584     * a color transform matrix that maps white balanced colors from the
1585     * reference sensor color space to the CIE XYZ color space with a D50 white
1586     * point.</p>
1587     * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
1588     * this matrix is chosen so that the standard white point for this reference
1589     * illuminant in the reference sensor colorspace is mapped to D50 in the
1590     * CIE XYZ colorspace.</p>
1591     * <p>This matrix will only be present if the second reference
1592     * illuminant is present.</p>
1593     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1594     *
1595     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
1596     */
1597    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
1598            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
1599
1600    /**
1601     * <p>A fixed black level offset for each of the color filter arrangement
1602     * (CFA) mosaic channels.</p>
1603     * <p>This tag specifies the zero light value for each of the CFA mosaic
1604     * channels in the camera sensor.  The maximal value output by the
1605     * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.</p>
1606     * <p>The values are given in row-column scan order, with the first value
1607     * corresponding to the element of the CFA in row=0, column=0.</p>
1608     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1609     *
1610     * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
1611     */
1612    public static final Key<int[]> SENSOR_BLACK_LEVEL_PATTERN =
1613            new Key<int[]>("android.sensor.blackLevelPattern", int[].class);
1614
1615    /**
1616     * <p>Maximum sensitivity that is implemented
1617     * purely through analog gain.</p>
1618     * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
1619     * equal to this, all applied gain must be analog. For
1620     * values above this, the gain applied can be a mix of analog and
1621     * digital.</p>
1622     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1623     * <p><b>Full capability</b> -
1624     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1625     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1626     *
1627     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1628     * @see CaptureRequest#SENSOR_SENSITIVITY
1629     */
1630    public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
1631            new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
1632
1633    /**
1634     * <p>Clockwise angle through which the output
1635     * image needs to be rotated to be upright on the device
1636     * screen in its native orientation. Also defines the
1637     * direction of rolling shutter readout, which is from top
1638     * to bottom in the sensor's coordinate system</p>
1639     */
1640    public static final Key<Integer> SENSOR_ORIENTATION =
1641            new Key<Integer>("android.sensor.orientation", int.class);
1642
1643    /**
1644     * <p>Optional. Defaults to [OFF]. Lists the supported test
1645     * pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}.</p>
1646     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1647     *
1648     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
1649     */
1650    public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
1651            new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
1652
1653    /**
1654     * <p>Which face detection modes are available,
1655     * if any</p>
1656     * <p>OFF means face detection is disabled, it must
1657     * be included in the list.</p>
1658     * <p>SIMPLE means the device supports the
1659     * android.statistics.faceRectangles and
1660     * android.statistics.faceScores outputs.</p>
1661     * <p>FULL means the device additionally supports the
1662     * android.statistics.faceIds and
1663     * android.statistics.faceLandmarks outputs.</p>
1664     */
1665    public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
1666            new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
1667
1668    /**
1669     * <p>Maximum number of simultaneously detectable
1670     * faces</p>
1671     */
1672    public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
1673            new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
1674
1675    /**
1676     * <p>The set of hot pixel map output modes supported by this camera device.</p>
1677     * <p>This tag lists valid output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}.</p>
1678     * <p>If no hotpixel map is available for this camera device, this will contain
1679     * only OFF.  If the hotpixel map is available, this should include both
1680     * the ON and OFF options.</p>
1681     *
1682     * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
1683     */
1684    public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
1685            new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
1686
1687    /**
1688     * <p>Maximum number of supported points in the
1689     * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
1690     * <p>If the actual number of points provided by the application (in
1691     * {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*)  is less than max, the camera device will
1692     * resample the curve to its internal representation, using linear
1693     * interpolation.</p>
1694     * <p>The output curves in the result metadata may have a different number
1695     * of points than the input curves, and will represent the actual
1696     * hardware curves used as closely as possible when linearly interpolated.</p>
1697     *
1698     * @see CaptureRequest#TONEMAP_CURVE
1699     */
1700    public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
1701            new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
1702
1703    /**
1704     * <p>The set of tonemapping modes supported by this camera device.</p>
1705     * <p>This tag lists the valid modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}.</p>
1706     * <p>Full-capability camera devices must always support CONTRAST_CURVE and
1707     * FAST.</p>
1708     *
1709     * @see CaptureRequest#TONEMAP_MODE
1710     */
1711    public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
1712            new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
1713
1714    /**
1715     * <p>A list of camera LEDs that are available on this system.</p>
1716     * @see #LED_AVAILABLE_LEDS_TRANSMIT
1717     * @hide
1718     */
1719    public static final Key<int[]> LED_AVAILABLE_LEDS =
1720            new Key<int[]>("android.led.availableLeds", int[].class);
1721
1722    /**
1723     * <p>Generally classifies the overall set of the camera device functionality.</p>
1724     * <p>Camera devices will come in two flavors: LIMITED and FULL.</p>
1725     * <p>A FULL device has the most support possible and will enable the
1726     * widest range of use cases such as:</p>
1727     * <ul>
1728     * <li>30 FPS at maximum resolution (== sensor resolution)</li>
1729     * <li>Per frame control</li>
1730     * <li>Manual sensor control</li>
1731     * <li>Zero Shutter Lag (ZSL)</li>
1732     * </ul>
1733     * <p>A LIMITED device may have some or none of the above characteristics.
1734     * To find out more refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
1735     *
1736     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1737     * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
1738     * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
1739     */
1740    public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
1741            new Key<Integer>("android.info.supportedHardwareLevel", int.class);
1742
1743    /**
1744     * <p>The maximum number of frames that can occur after a request
1745     * (different than the previous) has been submitted, and before the
1746     * result's state becomes synchronized (by setting
1747     * android.sync.frameNumber to a non-negative value).</p>
1748     * <p>This defines the maximum distance (in number of metadata results),
1749     * between android.sync.frameNumber and the equivalent
1750     * android.request.frameCount.</p>
1751     * <p>In other words this acts as an upper boundary for how many frames
1752     * must occur before the camera device knows for a fact that the new
1753     * submitted camera settings have been applied in outgoing frames.</p>
1754     * <p>For example if the distance was 2,</p>
1755     * <pre><code>initial request = X (repeating)
1756     * request1 = X
1757     * request2 = Y
1758     * request3 = Y
1759     * request4 = Y
1760     *
1761     * where requestN has frameNumber N, and the first of the repeating
1762     * initial request's has frameNumber F (and F &lt; 1).
1763     *
1764     * initial result = X' + { android.sync.frameNumber == F }
1765     * result1 = X' + { android.sync.frameNumber == F }
1766     * result2 = X' + { android.sync.frameNumber == CONVERGING }
1767     * result3 = X' + { android.sync.frameNumber == CONVERGING }
1768     * result4 = X' + { android.sync.frameNumber == 2 }
1769     *
1770     * where resultN has frameNumber N.
1771     * </code></pre>
1772     * <p>Since <code>result4</code> has a <code>frameNumber == 4</code> and
1773     * <code>android.sync.frameNumber == 2</code>, the distance is clearly
1774     * <code>4 - 2 = 2</code>.</p>
1775     * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
1776     * @see #SYNC_MAX_LATENCY_UNKNOWN
1777     */
1778    public static final Key<Integer> SYNC_MAX_LATENCY =
1779            new Key<Integer>("android.sync.maxLatency", int.class);
1780
1781    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
1782     * End generated code
1783     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
1784}
1785