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