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