CameraCharacteristics.java revision 12a8385b7e403c6e1af6c824d3e77088242f89a7
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.annotation.NonNull;
20import android.annotation.Nullable;
21import android.hardware.camera2.impl.CameraMetadataNative;
22import android.hardware.camera2.impl.PublicKey;
23import android.hardware.camera2.impl.SyntheticKey;
24import android.hardware.camera2.utils.TypeReference;
25import android.util.Rational;
26
27import java.util.Collections;
28import java.util.List;
29
30/**
31 * <p>The properties describing a
32 * {@link CameraDevice CameraDevice}.</p>
33 *
34 * <p>These properties are fixed for a given CameraDevice, and can be queried
35 * through the {@link CameraManager CameraManager}
36 * interface with {@link CameraManager#getCameraCharacteristics}.</p>
37 *
38 * <p>{@link CameraCharacteristics} objects are immutable.</p>
39 *
40 * @see CameraDevice
41 * @see CameraManager
42 */
43public final class CameraCharacteristics extends CameraMetadata<CameraCharacteristics.Key<?>> {
44
45    /**
46     * A {@code Key} is used to do camera characteristics field lookups with
47     * {@link CameraCharacteristics#get}.
48     *
49     * <p>For example, to get the stream configuration map:
50     * <code><pre>
51     * StreamConfigurationMap map = cameraCharacteristics.get(
52     *      CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
53     * </pre></code>
54     * </p>
55     *
56     * <p>To enumerate over all possible keys for {@link CameraCharacteristics}, see
57     * {@link CameraCharacteristics#getKeys()}.</p>
58     *
59     * @see CameraCharacteristics#get
60     * @see CameraCharacteristics#getKeys()
61     */
62    public static final class Key<T> {
63        private final CameraMetadataNative.Key<T> mKey;
64
65        /**
66         * Visible for testing and vendor extensions only.
67         *
68         * @hide
69         */
70        public Key(String name, Class<T> type) {
71            mKey = new CameraMetadataNative.Key<T>(name,  type);
72        }
73
74        /**
75         * Visible for testing and vendor extensions only.
76         *
77         * @hide
78         */
79        public Key(String name, TypeReference<T> typeReference) {
80            mKey = new CameraMetadataNative.Key<T>(name,  typeReference);
81        }
82
83        /**
84         * Return a camelCase, period separated name formatted like:
85         * {@code "root.section[.subsections].name"}.
86         *
87         * <p>Built-in keys exposed by the Android SDK are always prefixed with {@code "android."};
88         * keys that are device/platform-specific are prefixed with {@code "com."}.</p>
89         *
90         * <p>For example, {@code CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP} would
91         * have a name of {@code "android.scaler.streamConfigurationMap"}; whereas a device
92         * specific key might look like {@code "com.google.nexus.data.private"}.</p>
93         *
94         * @return String representation of the key name
95         */
96        @NonNull
97        public String getName() {
98            return mKey.getName();
99        }
100
101        /**
102         * {@inheritDoc}
103         */
104        @Override
105        public final int hashCode() {
106            return mKey.hashCode();
107        }
108
109        /**
110         * {@inheritDoc}
111         */
112        @SuppressWarnings("unchecked")
113        @Override
114        public final boolean equals(Object o) {
115            return o instanceof Key && ((Key<T>)o).mKey.equals(mKey);
116        }
117
118        /**
119         * Return this {@link Key} as a string representation.
120         *
121         * <p>{@code "CameraCharacteristics.Key(%s)"}, where {@code %s} represents
122         * the name of this key as returned by {@link #getName}.</p>
123         *
124         * @return string representation of {@link Key}
125         */
126        @NonNull
127        @Override
128        public String toString() {
129            return String.format("CameraCharacteristics.Key(%s)", mKey.getName());
130        }
131
132        /**
133         * Visible for CameraMetadataNative implementation only; do not use.
134         *
135         * TODO: Make this private or remove it altogether.
136         *
137         * @hide
138         */
139        public CameraMetadataNative.Key<T> getNativeKey() {
140            return mKey;
141        }
142
143        @SuppressWarnings({
144                "unused", "unchecked"
145        })
146        private Key(CameraMetadataNative.Key<?> nativeKey) {
147            mKey = (CameraMetadataNative.Key<T>) nativeKey;
148        }
149    }
150
151    private final CameraMetadataNative mProperties;
152    private List<CameraCharacteristics.Key<?>> mKeys;
153    private List<CaptureRequest.Key<?>> mAvailableRequestKeys;
154    private List<CaptureResult.Key<?>> mAvailableResultKeys;
155
156    /**
157     * Takes ownership of the passed-in properties object
158     * @hide
159     */
160    public CameraCharacteristics(CameraMetadataNative properties) {
161        mProperties = CameraMetadataNative.move(properties);
162    }
163
164    /**
165     * Returns a copy of the underlying {@link CameraMetadataNative}.
166     * @hide
167     */
168    public CameraMetadataNative getNativeCopy() {
169        return new CameraMetadataNative(mProperties);
170    }
171
172    /**
173     * Get a camera characteristics field value.
174     *
175     * <p>The field definitions can be
176     * found in {@link CameraCharacteristics}.</p>
177     *
178     * <p>Querying the value for the same key more than once will return a value
179     * which is equal to the previous queried value.</p>
180     *
181     * @throws IllegalArgumentException if the key was not valid
182     *
183     * @param key The characteristics field to read.
184     * @return The value of that key, or {@code null} if the field is not set.
185     */
186    @Nullable
187    public <T> T get(Key<T> key) {
188        return mProperties.get(key);
189    }
190
191    /**
192     * {@inheritDoc}
193     * @hide
194     */
195    @SuppressWarnings("unchecked")
196    @Override
197    protected <T> T getProtected(Key<?> key) {
198        return (T) mProperties.get(key);
199    }
200
201    /**
202     * {@inheritDoc}
203     * @hide
204     */
205    @SuppressWarnings("unchecked")
206    @Override
207    protected Class<Key<?>> getKeyClass() {
208        Object thisClass = Key.class;
209        return (Class<Key<?>>)thisClass;
210    }
211
212    /**
213     * {@inheritDoc}
214     */
215    @NonNull
216    @Override
217    public List<Key<?>> getKeys() {
218        // List of keys is immutable; cache the results after we calculate them
219        if (mKeys != null) {
220            return mKeys;
221        }
222
223        int[] filterTags = get(REQUEST_AVAILABLE_CHARACTERISTICS_KEYS);
224        if (filterTags == null) {
225            throw new AssertionError("android.request.availableCharacteristicsKeys must be non-null"
226                    + " in the characteristics");
227        }
228
229        mKeys = Collections.unmodifiableList(
230                getKeysStatic(getClass(), getKeyClass(), this, filterTags));
231        return mKeys;
232    }
233
234    /**
235     * Returns the list of keys supported by this {@link CameraDevice} for querying
236     * with a {@link CaptureRequest}.
237     *
238     * <p>The list returned is not modifiable, so any attempts to modify it will throw
239     * a {@code UnsupportedOperationException}.</p>
240     *
241     * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
242     *
243     * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
244     * {@link #getKeys()} instead.</p>
245     *
246     * @return List of keys supported by this CameraDevice for CaptureRequests.
247     */
248    @SuppressWarnings({"unchecked"})
249    @NonNull
250    public List<CaptureRequest.Key<?>> getAvailableCaptureRequestKeys() {
251        if (mAvailableRequestKeys == null) {
252            Object crKey = CaptureRequest.Key.class;
253            Class<CaptureRequest.Key<?>> crKeyTyped = (Class<CaptureRequest.Key<?>>)crKey;
254
255            int[] filterTags = get(REQUEST_AVAILABLE_REQUEST_KEYS);
256            if (filterTags == null) {
257                throw new AssertionError("android.request.availableRequestKeys must be non-null "
258                        + "in the characteristics");
259            }
260            mAvailableRequestKeys =
261                    getAvailableKeyList(CaptureRequest.class, crKeyTyped, filterTags);
262        }
263        return mAvailableRequestKeys;
264    }
265
266    /**
267     * Returns the list of keys supported by this {@link CameraDevice} for querying
268     * with a {@link CaptureResult}.
269     *
270     * <p>The list returned is not modifiable, so any attempts to modify it will throw
271     * a {@code UnsupportedOperationException}.</p>
272     *
273     * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
274     *
275     * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
276     * {@link #getKeys()} instead.</p>
277     *
278     * @return List of keys supported by this CameraDevice for CaptureResults.
279     */
280    @SuppressWarnings({"unchecked"})
281    @NonNull
282    public List<CaptureResult.Key<?>> getAvailableCaptureResultKeys() {
283        if (mAvailableResultKeys == null) {
284            Object crKey = CaptureResult.Key.class;
285            Class<CaptureResult.Key<?>> crKeyTyped = (Class<CaptureResult.Key<?>>)crKey;
286
287            int[] filterTags = get(REQUEST_AVAILABLE_RESULT_KEYS);
288            if (filterTags == null) {
289                throw new AssertionError("android.request.availableResultKeys must be non-null "
290                        + "in the characteristics");
291            }
292            mAvailableResultKeys = getAvailableKeyList(CaptureResult.class, crKeyTyped, filterTags);
293        }
294        return mAvailableResultKeys;
295    }
296
297    /**
298     * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
299     *
300     * <p>The list returned is not modifiable, so any attempts to modify it will throw
301     * a {@code UnsupportedOperationException}.</p>
302     *
303     * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
304     *
305     * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
306     * @param keyClass The class of the metadata key, e.g. CaptureRequest.Key.class
307     *
308     * @return List of keys supported by this CameraDevice for metadataClass.
309     *
310     * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
311     */
312    private <TKey> List<TKey>
313    getAvailableKeyList(Class<?> metadataClass, Class<TKey> keyClass, int[] filterTags) {
314
315        if (metadataClass.equals(CameraMetadata.class)) {
316            throw new AssertionError(
317                    "metadataClass must be a strict subclass of CameraMetadata");
318        } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
319            throw new AssertionError(
320                    "metadataClass must be a subclass of CameraMetadata");
321        }
322
323        List<TKey> staticKeyList = CameraCharacteristics.<TKey>getKeysStatic(
324                metadataClass, keyClass, /*instance*/null, filterTags);
325        return Collections.unmodifiableList(staticKeyList);
326    }
327
328    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
329     * The key entries below this point are generated from metadata
330     * definitions in /system/media/camera/docs. Do not modify by hand or
331     * modify the comment blocks at the start or end.
332     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
333
334    /**
335     * <p>List of aberration correction modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode} that are
336     * supported by this camera device.</p>
337     * <p>This key lists the valid modes for {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}.  If no
338     * aberration correction modes are available for a device, this list will solely include
339     * OFF mode. All camera devices will support either OFF or FAST mode.</p>
340     * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always list
341     * OFF mode. This includes all FULL level devices.</p>
342     * <p>LEGACY devices will always only support FAST mode.</p>
343     * <p><b>Range of valid values:</b><br>
344     * Any value listed in {@link CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE android.colorCorrection.aberrationMode}</p>
345     * <p>This key is available on all devices.</p>
346     *
347     * @see CaptureRequest#COLOR_CORRECTION_ABERRATION_MODE
348     */
349    @PublicKey
350    public static final Key<int[]> COLOR_CORRECTION_AVAILABLE_ABERRATION_MODES =
351            new Key<int[]>("android.colorCorrection.availableAberrationModes", int[].class);
352
353    /**
354     * <p>List of auto-exposure antibanding modes for {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} that are
355     * supported by this camera device.</p>
356     * <p>Not all of the auto-exposure anti-banding modes may be
357     * supported by a given camera device. This field lists the
358     * valid anti-banding modes that the application may request
359     * for this camera device with the
360     * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
361     * <p><b>Range of valid values:</b><br>
362     * Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
363     * <p>This key is available on all devices.</p>
364     *
365     * @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
366     */
367    @PublicKey
368    public static final Key<int[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
369            new Key<int[]>("android.control.aeAvailableAntibandingModes", int[].class);
370
371    /**
372     * <p>List of auto-exposure modes for {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} that are supported by this camera
373     * device.</p>
374     * <p>Not all the auto-exposure modes may be supported by a
375     * given camera device, especially if no flash unit is
376     * available. This entry lists the valid modes for
377     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
378     * <p>All camera devices support ON, and all camera devices with flash
379     * units support ON_AUTO_FLASH and ON_ALWAYS_FLASH.</p>
380     * <p>FULL mode camera devices always support OFF mode,
381     * which enables application control of camera exposure time,
382     * sensitivity, and frame duration.</p>
383     * <p>LEGACY mode camera devices never support OFF mode.
384     * LIMITED mode devices support OFF if they support the MANUAL_SENSOR
385     * capability.</p>
386     * <p><b>Range of valid values:</b><br>
387     * Any value listed in {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode}</p>
388     * <p>This key is available on all devices.</p>
389     *
390     * @see CaptureRequest#CONTROL_AE_MODE
391     */
392    @PublicKey
393    public static final Key<int[]> CONTROL_AE_AVAILABLE_MODES =
394            new Key<int[]>("android.control.aeAvailableModes", int[].class);
395
396    /**
397     * <p>List of frame rate ranges for {@link CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE android.control.aeTargetFpsRange} supported by
398     * this camera device.</p>
399     * <p>For devices at the LEGACY level or above:</p>
400     * <ul>
401     * <li>This list will always include (30, 30).</li>
402     * <li>Also, for constant-framerate recording, for each normal
403     * {@link android.media.CamcorderProfile CamcorderProfile} that has
404     * {@link android.media.CamcorderProfile#quality quality} in
405     * the range [{@link android.media.CamcorderProfile#QUALITY_LOW QUALITY_LOW},
406     * {@link android.media.CamcorderProfile#QUALITY_2160P QUALITY_2160P}], if the profile is
407     * supported by the device and has
408     * {@link android.media.CamcorderProfile#videoFrameRate videoFrameRate} <code>x</code>, this list will
409     * always include (<code>x</code>,<code>x</code>).</li>
410     * <li>For preview streaming use case, this list will always include (<code>min</code>, <code>max</code>) where
411     * <code>min</code> &lt;= 15 and <code>max</code> &gt;= 30.</li>
412     * </ul>
413     * <p>For devices at the LIMITED level or above:</p>
414     * <ul>
415     * <li>For YUV_420_888 burst capture use case, this list will always include (<code>min</code>, <code>max</code>)
416     * and (<code>max</code>, <code>max</code>) where <code>min</code> &lt;= 15 and <code>max</code> = the maximum output frame rate of the
417     * maximum YUV_420_888 output size.</li>
418     * </ul>
419     * <p><b>Units</b>: Frames per second (FPS)</p>
420     * <p>This key is available on all devices.</p>
421     *
422     * @see CaptureRequest#CONTROL_AE_TARGET_FPS_RANGE
423     */
424    @PublicKey
425    public static final Key<android.util.Range<Integer>[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
426            new Key<android.util.Range<Integer>[]>("android.control.aeAvailableTargetFpsRanges", new TypeReference<android.util.Range<Integer>[]>() {{ }});
427
428    /**
429     * <p>Maximum and minimum exposure compensation values for
430     * {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}, in counts of {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep},
431     * that are supported by this camera device.</p>
432     * <p><b>Range of valid values:</b><br></p>
433     * <p>Range [0,0] indicates that exposure compensation is not supported.</p>
434     * <p>For LIMITED and FULL devices, range must follow below requirements if exposure
435     * compensation is supported (<code>range != [0, 0]</code>):</p>
436     * <p><code>Min.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &lt;= -2 EV</code></p>
437     * <p><code>Max.exposure compensation * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep} &gt;= 2 EV</code></p>
438     * <p>LEGACY devices may support a smaller range than this.</p>
439     * <p>This key is available on all devices.</p>
440     *
441     * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP
442     * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
443     */
444    @PublicKey
445    public static final Key<android.util.Range<Integer>> CONTROL_AE_COMPENSATION_RANGE =
446            new Key<android.util.Range<Integer>>("android.control.aeCompensationRange", new TypeReference<android.util.Range<Integer>>() {{ }});
447
448    /**
449     * <p>Smallest step by which the exposure compensation
450     * can be changed.</p>
451     * <p>This is the unit for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation}. For example, if this key has
452     * a value of <code>1/2</code>, then a setting of <code>-2</code> for {@link CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION android.control.aeExposureCompensation} means
453     * that the target EV offset for the auto-exposure routine is -1 EV.</p>
454     * <p>One unit of EV compensation changes the brightness of the captured image by a factor
455     * of two. +1 EV doubles the image brightness, while -1 EV halves the image brightness.</p>
456     * <p><b>Units</b>: Exposure Value (EV)</p>
457     * <p>This key is available on all devices.</p>
458     *
459     * @see CaptureRequest#CONTROL_AE_EXPOSURE_COMPENSATION
460     */
461    @PublicKey
462    public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
463            new Key<Rational>("android.control.aeCompensationStep", Rational.class);
464
465    /**
466     * <p>List of auto-focus (AF) modes for {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} that are
467     * supported by this camera device.</p>
468     * <p>Not all the auto-focus modes may be supported by a
469     * given camera device. This entry lists the valid modes for
470     * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
471     * <p>All LIMITED and FULL mode camera devices will support OFF mode, and all
472     * camera devices with adjustable focuser units
473     * (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>) will support AUTO mode.</p>
474     * <p>LEGACY devices will support OFF mode only if they support
475     * focusing to infinity (by also setting {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance} to
476     * <code>0.0f</code>).</p>
477     * <p><b>Range of valid values:</b><br>
478     * Any value listed in {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}</p>
479     * <p>This key is available on all devices.</p>
480     *
481     * @see CaptureRequest#CONTROL_AF_MODE
482     * @see CaptureRequest#LENS_FOCUS_DISTANCE
483     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
484     */
485    @PublicKey
486    public static final Key<int[]> CONTROL_AF_AVAILABLE_MODES =
487            new Key<int[]>("android.control.afAvailableModes", int[].class);
488
489    /**
490     * <p>List of color effects for {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that are supported by this camera
491     * device.</p>
492     * <p>This list contains the color effect modes that can be applied to
493     * images produced by the camera device.
494     * Implementations are not expected to be consistent across all devices.
495     * If no color effect modes are available for a device, this will only list
496     * OFF.</p>
497     * <p>A color effect will only be applied if
498     * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.  OFF is always included in this list.</p>
499     * <p>This control has no effect on the operation of other control routines such
500     * as auto-exposure, white balance, or focus.</p>
501     * <p><b>Range of valid values:</b><br>
502     * Any value listed in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode}</p>
503     * <p>This key is available on all devices.</p>
504     *
505     * @see CaptureRequest#CONTROL_EFFECT_MODE
506     * @see CaptureRequest#CONTROL_MODE
507     */
508    @PublicKey
509    public static final Key<int[]> CONTROL_AVAILABLE_EFFECTS =
510            new Key<int[]>("android.control.availableEffects", int[].class);
511
512    /**
513     * <p>List of scene modes for {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode} that are supported by this camera
514     * device.</p>
515     * <p>This list contains scene modes that can be set for the camera device.
516     * Only scene modes that have been fully implemented for the
517     * camera device may be included here. Implementations are not expected
518     * to be consistent across all devices.</p>
519     * <p>If no scene modes are supported by the camera device, this
520     * will be set to DISABLED. Otherwise DISABLED will not be listed.</p>
521     * <p>FACE_PRIORITY is always listed if face detection is
522     * supported (i.e.<code>{@link CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT android.statistics.info.maxFaceCount} &gt;
523     * 0</code>).</p>
524     * <p><b>Range of valid values:</b><br>
525     * Any value listed in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}</p>
526     * <p>This key is available on all devices.</p>
527     *
528     * @see CaptureRequest#CONTROL_SCENE_MODE
529     * @see CameraCharacteristics#STATISTICS_INFO_MAX_FACE_COUNT
530     */
531    @PublicKey
532    public static final Key<int[]> CONTROL_AVAILABLE_SCENE_MODES =
533            new Key<int[]>("android.control.availableSceneModes", int[].class);
534
535    /**
536     * <p>List of video stabilization modes for {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}
537     * that are supported by this camera device.</p>
538     * <p>OFF will always be listed.</p>
539     * <p><b>Range of valid values:</b><br>
540     * Any value listed in {@link CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE android.control.videoStabilizationMode}</p>
541     * <p>This key is available on all devices.</p>
542     *
543     * @see CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE
544     */
545    @PublicKey
546    public static final Key<int[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
547            new Key<int[]>("android.control.availableVideoStabilizationModes", int[].class);
548
549    /**
550     * <p>List of auto-white-balance modes for {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} that are supported by this
551     * camera device.</p>
552     * <p>Not all the auto-white-balance modes may be supported by a
553     * given camera device. This entry lists the valid modes for
554     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
555     * <p>All camera devices will support ON mode.</p>
556     * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always support OFF
557     * mode, which enables application control of white balance, by using
558     * {@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). This includes all FULL
559     * mode camera devices.</p>
560     * <p><b>Range of valid values:</b><br>
561     * Any value listed in {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}</p>
562     * <p>This key is available on all devices.</p>
563     *
564     * @see CaptureRequest#COLOR_CORRECTION_GAINS
565     * @see CaptureRequest#COLOR_CORRECTION_MODE
566     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
567     * @see CaptureRequest#CONTROL_AWB_MODE
568     */
569    @PublicKey
570    public static final Key<int[]> CONTROL_AWB_AVAILABLE_MODES =
571            new Key<int[]>("android.control.awbAvailableModes", int[].class);
572
573    /**
574     * <p>List of the maximum number of regions that can be used for metering in
575     * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF);
576     * this corresponds to the the maximum number of elements in
577     * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions},
578     * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
579     * <p><b>Range of valid values:</b><br></p>
580     * <p>Value must be &gt;= 0 for each element. For full-capability devices
581     * this value must be &gt;= 1 for AE and AF. The order of the elements is:
582     * <code>(AE, AWB, AF)</code>.</p>
583     * <p>This key is available on all devices.</p>
584     *
585     * @see CaptureRequest#CONTROL_AE_REGIONS
586     * @see CaptureRequest#CONTROL_AF_REGIONS
587     * @see CaptureRequest#CONTROL_AWB_REGIONS
588     * @hide
589     */
590    public static final Key<int[]> CONTROL_MAX_REGIONS =
591            new Key<int[]>("android.control.maxRegions", int[].class);
592
593    /**
594     * <p>The maximum number of metering regions that can be used by the auto-exposure (AE)
595     * routine.</p>
596     * <p>This corresponds to the the maximum allowed number of elements in
597     * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}.</p>
598     * <p><b>Range of valid values:</b><br>
599     * Value will be &gt;= 0. For FULL-capability devices, this
600     * value will be &gt;= 1.</p>
601     * <p>This key is available on all devices.</p>
602     *
603     * @see CaptureRequest#CONTROL_AE_REGIONS
604     */
605    @PublicKey
606    @SyntheticKey
607    public static final Key<Integer> CONTROL_MAX_REGIONS_AE =
608            new Key<Integer>("android.control.maxRegionsAe", int.class);
609
610    /**
611     * <p>The maximum number of metering regions that can be used by the auto-white balance (AWB)
612     * routine.</p>
613     * <p>This corresponds to the the maximum allowed number of elements in
614     * {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}.</p>
615     * <p><b>Range of valid values:</b><br>
616     * Value will be &gt;= 0.</p>
617     * <p>This key is available on all devices.</p>
618     *
619     * @see CaptureRequest#CONTROL_AWB_REGIONS
620     */
621    @PublicKey
622    @SyntheticKey
623    public static final Key<Integer> CONTROL_MAX_REGIONS_AWB =
624            new Key<Integer>("android.control.maxRegionsAwb", int.class);
625
626    /**
627     * <p>The maximum number of metering regions that can be used by the auto-focus (AF) routine.</p>
628     * <p>This corresponds to the the maximum allowed number of elements in
629     * {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.</p>
630     * <p><b>Range of valid values:</b><br>
631     * Value will be &gt;= 0. For FULL-capability devices, this
632     * value will be &gt;= 1.</p>
633     * <p>This key is available on all devices.</p>
634     *
635     * @see CaptureRequest#CONTROL_AF_REGIONS
636     */
637    @PublicKey
638    @SyntheticKey
639    public static final Key<Integer> CONTROL_MAX_REGIONS_AF =
640            new Key<Integer>("android.control.maxRegionsAf", int.class);
641
642    /**
643     * <p>List of available high speed video size, fps range and max batch size configurations
644     * supported by the camera device, in the format of (width, height, fps_min, fps_max, batch_size_max).</p>
645     * <p>When CONSTRAINED_HIGH_SPEED_VIDEO is supported in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities},
646     * this metadata will list the supported high speed video size, fps range and max batch size
647     * configurations. All the sizes listed in this configuration will be a subset of the sizes
648     * reported by {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputSizes }
649     * for processed non-stalling formats.</p>
650     * <p>For the high speed video use case, the application must
651     * select the video size and fps range from this metadata to configure the recording and
652     * preview streams and setup the recording requests. For example, if the application intends
653     * to do high speed recording, it can select the maximum size reported by this metadata to
654     * configure output streams. Once the size is selected, application can filter this metadata
655     * by selected size and get the supported fps ranges, and use these fps ranges to setup the
656     * recording requests. Note that for the use case of multiple output streams, application
657     * must select one unique size from this metadata to use (e.g., preview and recording streams
658     * must have the same size). Otherwise, the high speed capture session creation will fail.</p>
659     * <p>The min and max fps will be multiple times of 30fps.</p>
660     * <p>High speed video streaming extends significant performance pressue to camera hardware,
661     * to achieve efficient high speed streaming, the camera device may have to aggregate
662     * multiple frames together and send to camera device for processing where the request
663     * controls are same for all the frames in this batch. Max batch size indicates
664     * the max possible number of frames the camera device will group together for this high
665     * speed stream configuration. This max batch size will be used to generate a high speed
666     * recording request list by
667     * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedRequestList }.
668     * The max batch size for each configuration will satisfy below conditions:</p>
669     * <ul>
670     * <li>Each max batch size will be a divisor of its corresponding fps_max / 30. For example,
671     * if max_fps is 300, max batch size will only be 1, 2, 5, or 10.</li>
672     * <li>The camera device may choose smaller internal batch size for each configuration, but
673     * the actual batch size will be a divisor of max batch size. For example, if the max batch
674     * size is 8, the actual batch size used by camera device will only be 1, 2, 4, or 8.</li>
675     * <li>The max batch size in each configuration entry must be no larger than 32.</li>
676     * </ul>
677     * <p>The camera device doesn't have to support batch mode to achieve high speed video recording,
678     * in such case, batch_size_max will be reported as 1 in each configuration entry.</p>
679     * <p>This fps ranges in this configuration list can only be used to create requests
680     * that are submitted to a high speed camera capture session created by
681     * {@link android.hardware.camera2.CameraDevice#createConstrainedHighSpeedCaptureSession }.
682     * The fps ranges reported in this metadata must not be used to setup capture requests for
683     * normal capture session, or it will cause request error.</p>
684     * <p><b>Range of valid values:</b><br></p>
685     * <p>For each configuration, the fps_max &gt;= 120fps.</p>
686     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
687     * <p><b>Limited capability</b> -
688     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
689     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
690     *
691     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
692     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
693     * @hide
694     */
695    public static final Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]> CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS =
696            new Key<android.hardware.camera2.params.HighSpeedVideoConfiguration[]>("android.control.availableHighSpeedVideoConfigurations", android.hardware.camera2.params.HighSpeedVideoConfiguration[].class);
697
698    /**
699     * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AE_LOCK android.control.aeLock}</p>
700     * <p>Devices with MANUAL_SENSOR capability or BURST_CAPTURE capability will always
701     * list <code>true</code>. This includes FULL devices.</p>
702     * <p>This key is available on all devices.</p>
703     *
704     * @see CaptureRequest#CONTROL_AE_LOCK
705     */
706    @PublicKey
707    public static final Key<Boolean> CONTROL_AE_LOCK_AVAILABLE =
708            new Key<Boolean>("android.control.aeLockAvailable", boolean.class);
709
710    /**
711     * <p>Whether the camera device supports {@link CaptureRequest#CONTROL_AWB_LOCK android.control.awbLock}</p>
712     * <p>Devices with MANUAL_POST_PROCESSING capability or BURST_CAPTURE capability will
713     * always list <code>true</code>. This includes FULL devices.</p>
714     * <p>This key is available on all devices.</p>
715     *
716     * @see CaptureRequest#CONTROL_AWB_LOCK
717     */
718    @PublicKey
719    public static final Key<Boolean> CONTROL_AWB_LOCK_AVAILABLE =
720            new Key<Boolean>("android.control.awbLockAvailable", boolean.class);
721
722    /**
723     * <p>List of control modes for {@link CaptureRequest#CONTROL_MODE android.control.mode} that are supported by this camera
724     * device.</p>
725     * <p>This list contains control modes that can be set for the camera device.
726     * LEGACY mode devices will always support AUTO mode. LIMITED and FULL
727     * devices will always support OFF, AUTO modes.</p>
728     * <p><b>Range of valid values:</b><br>
729     * Any value listed in {@link CaptureRequest#CONTROL_MODE android.control.mode}</p>
730     * <p>This key is available on all devices.</p>
731     *
732     * @see CaptureRequest#CONTROL_MODE
733     */
734    @PublicKey
735    public static final Key<int[]> CONTROL_AVAILABLE_MODES =
736            new Key<int[]>("android.control.availableModes", int[].class);
737
738    /**
739     * <p>List of edge enhancement modes for {@link CaptureRequest#EDGE_MODE android.edge.mode} that are supported by this camera
740     * device.</p>
741     * <p>Full-capability camera devices must always support OFF; all devices will list FAST.</p>
742     * <p><b>Range of valid values:</b><br>
743     * Any value listed in {@link CaptureRequest#EDGE_MODE android.edge.mode}</p>
744     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
745     * <p><b>Full capability</b> -
746     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
747     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
748     *
749     * @see CaptureRequest#EDGE_MODE
750     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
751     */
752    @PublicKey
753    public static final Key<int[]> EDGE_AVAILABLE_EDGE_MODES =
754            new Key<int[]>("android.edge.availableEdgeModes", int[].class);
755
756    /**
757     * <p>Whether this camera device has a
758     * flash unit.</p>
759     * <p>Will be <code>false</code> if no flash is available.</p>
760     * <p>If there is no flash unit, none of the flash controls do
761     * anything.
762     * This key is available on all devices.</p>
763     */
764    @PublicKey
765    public static final Key<Boolean> FLASH_INFO_AVAILABLE =
766            new Key<Boolean>("android.flash.info.available", boolean.class);
767
768    /**
769     * <p>List of hot pixel correction modes for {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode} that are supported by this
770     * camera device.</p>
771     * <p>FULL mode camera devices will always support FAST.</p>
772     * <p><b>Range of valid values:</b><br>
773     * Any value listed in {@link CaptureRequest#HOT_PIXEL_MODE android.hotPixel.mode}</p>
774     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
775     *
776     * @see CaptureRequest#HOT_PIXEL_MODE
777     */
778    @PublicKey
779    public static final Key<int[]> HOT_PIXEL_AVAILABLE_HOT_PIXEL_MODES =
780            new Key<int[]>("android.hotPixel.availableHotPixelModes", int[].class);
781
782    /**
783     * <p>List of JPEG thumbnail sizes for {@link CaptureRequest#JPEG_THUMBNAIL_SIZE android.jpeg.thumbnailSize} supported by this
784     * camera device.</p>
785     * <p>This list will include at least one non-zero resolution, plus <code>(0,0)</code> for indicating no
786     * thumbnail should be generated.</p>
787     * <p>Below condiditions will be satisfied for this size list:</p>
788     * <ul>
789     * <li>The sizes will be sorted by increasing pixel area (width x height).
790     * If several resolutions have the same area, they will be sorted by increasing width.</li>
791     * <li>The aspect ratio of the largest thumbnail size will be same as the
792     * aspect ratio of largest JPEG output size in android.scaler.availableStreamConfigurations.
793     * The largest size is defined as the size that has the largest pixel area
794     * in a given size list.</li>
795     * <li>Each output JPEG size in android.scaler.availableStreamConfigurations will have at least
796     * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
797     * and vice versa.</li>
798     * <li>All non-<code>(0, 0)</code> sizes will have non-zero widths and heights.
799     * This key is available on all devices.</li>
800     * </ul>
801     *
802     * @see CaptureRequest#JPEG_THUMBNAIL_SIZE
803     */
804    @PublicKey
805    public static final Key<android.util.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
806            new Key<android.util.Size[]>("android.jpeg.availableThumbnailSizes", android.util.Size[].class);
807
808    /**
809     * <p>List of aperture size values for {@link CaptureRequest#LENS_APERTURE android.lens.aperture} that are
810     * supported by this camera device.</p>
811     * <p>If the camera device doesn't support a variable lens aperture,
812     * this list will contain only one value, which is the fixed aperture size.</p>
813     * <p>If the camera device supports a variable aperture, the aperture values
814     * in this list will be sorted in ascending order.</p>
815     * <p><b>Units</b>: The aperture f-number</p>
816     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
817     * <p><b>Full capability</b> -
818     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
819     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
820     *
821     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
822     * @see CaptureRequest#LENS_APERTURE
823     */
824    @PublicKey
825    public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
826            new Key<float[]>("android.lens.info.availableApertures", float[].class);
827
828    /**
829     * <p>List of neutral density filter values for
830     * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} that are supported by this camera device.</p>
831     * <p>If a neutral density filter is not supported by this camera device,
832     * this list will contain only 0. Otherwise, this list will include every
833     * filter density supported by the camera device, in ascending order.</p>
834     * <p><b>Units</b>: Exposure value (EV)</p>
835     * <p><b>Range of valid values:</b><br></p>
836     * <p>Values are &gt;= 0</p>
837     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
838     * <p><b>Full capability</b> -
839     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
840     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
841     *
842     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
843     * @see CaptureRequest#LENS_FILTER_DENSITY
844     */
845    @PublicKey
846    public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
847            new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
848
849    /**
850     * <p>List of focal lengths for {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength} that are supported by this camera
851     * device.</p>
852     * <p>If optical zoom is not supported, this list will only contain
853     * a single value corresponding to the fixed focal length of the
854     * device. Otherwise, this list will include every focal length supported
855     * by the camera device, in ascending order.</p>
856     * <p><b>Units</b>: Millimeters</p>
857     * <p><b>Range of valid values:</b><br></p>
858     * <p>Values are &gt; 0</p>
859     * <p>This key is available on all devices.</p>
860     *
861     * @see CaptureRequest#LENS_FOCAL_LENGTH
862     */
863    @PublicKey
864    public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
865            new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
866
867    /**
868     * <p>List of optical image stabilization (OIS) modes for
869     * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode} that are supported by this camera device.</p>
870     * <p>If OIS is not supported by a given camera device, this list will
871     * contain only OFF.</p>
872     * <p><b>Range of valid values:</b><br>
873     * Any value listed in {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}</p>
874     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
875     * <p><b>Limited capability</b> -
876     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
877     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
878     *
879     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
880     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
881     */
882    @PublicKey
883    public static final Key<int[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
884            new Key<int[]>("android.lens.info.availableOpticalStabilization", int[].class);
885
886    /**
887     * <p>Hyperfocal distance for this lens.</p>
888     * <p>If the lens is not fixed focus, the camera device will report this
889     * field when {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} is APPROXIMATE or CALIBRATED.</p>
890     * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
891     * <p><b>Range of valid values:</b><br>
892     * If lens is fixed focus, &gt;= 0. If lens has focuser unit, the value is
893     * within <code>(0.0f, {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}]</code></p>
894     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
895     * <p><b>Limited capability</b> -
896     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
897     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
898     *
899     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
900     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
901     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
902     */
903    @PublicKey
904    public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
905            new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
906
907    /**
908     * <p>Shortest distance from frontmost surface
909     * of the lens that can be brought into sharp focus.</p>
910     * <p>If the lens is fixed-focus, this will be
911     * 0.</p>
912     * <p><b>Units</b>: See {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} for details</p>
913     * <p><b>Range of valid values:</b><br>
914     * &gt;= 0</p>
915     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
916     * <p><b>Limited capability</b> -
917     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
918     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
919     *
920     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
921     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
922     */
923    @PublicKey
924    public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
925            new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
926
927    /**
928     * <p>Dimensions of lens shading map.</p>
929     * <p>The map should be on the order of 30-40 rows and columns, and
930     * must be smaller than 64x64.</p>
931     * <p><b>Range of valid values:</b><br>
932     * Both values &gt;= 1</p>
933     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
934     * <p><b>Full capability</b> -
935     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
936     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
937     *
938     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
939     * @hide
940     */
941    public static final Key<android.util.Size> LENS_INFO_SHADING_MAP_SIZE =
942            new Key<android.util.Size>("android.lens.info.shadingMapSize", android.util.Size.class);
943
944    /**
945     * <p>The lens focus distance calibration quality.</p>
946     * <p>The lens focus distance calibration quality determines the reliability of
947     * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance},
948     * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and
949     * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.</p>
950     * <p>APPROXIMATE and CALIBRATED devices report the focus metadata in
951     * units of diopters (1/meter), so <code>0.0f</code> represents focusing at infinity,
952     * and increasing positive numbers represent focusing closer and closer
953     * to the camera device. The focus distance control also uses diopters
954     * on these devices.</p>
955     * <p>UNCALIBRATED devices do not use units that are directly comparable
956     * to any real physical measurement, but <code>0.0f</code> still represents farthest
957     * focus, and {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} represents the
958     * nearest focus the device can achieve.</p>
959     * <p><b>Possible values:</b>
960     * <ul>
961     *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED UNCALIBRATED}</li>
962     *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE APPROXIMATE}</li>
963     *   <li>{@link #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED CALIBRATED}</li>
964     * </ul></p>
965     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
966     * <p><b>Limited capability</b> -
967     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
968     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
969     *
970     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
971     * @see CaptureRequest#LENS_FOCUS_DISTANCE
972     * @see CaptureResult#LENS_FOCUS_RANGE
973     * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE
974     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
975     * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED
976     * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE
977     * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED
978     */
979    @PublicKey
980    public static final Key<Integer> LENS_INFO_FOCUS_DISTANCE_CALIBRATION =
981            new Key<Integer>("android.lens.info.focusDistanceCalibration", int.class);
982
983    /**
984     * <p>Direction the camera faces relative to
985     * device screen.</p>
986     * <p><b>Possible values:</b>
987     * <ul>
988     *   <li>{@link #LENS_FACING_FRONT FRONT}</li>
989     *   <li>{@link #LENS_FACING_BACK BACK}</li>
990     *   <li>{@link #LENS_FACING_EXTERNAL EXTERNAL}</li>
991     * </ul></p>
992     * <p>This key is available on all devices.</p>
993     * @see #LENS_FACING_FRONT
994     * @see #LENS_FACING_BACK
995     * @see #LENS_FACING_EXTERNAL
996     */
997    @PublicKey
998    public static final Key<Integer> LENS_FACING =
999            new Key<Integer>("android.lens.facing", int.class);
1000
1001    /**
1002     * <p>The orientation of the camera relative to the sensor
1003     * coordinate system.</p>
1004     * <p>The four coefficients that describe the quarternion
1005     * rotation from the Android sensor coordinate system to a
1006     * camera-aligned coordinate system where the X-axis is
1007     * aligned with the long side of the image sensor, the Y-axis
1008     * is aligned with the short side of the image sensor, and
1009     * the Z-axis is aligned with the optical axis of the sensor.</p>
1010     * <p>To convert from the quarternion coefficients <code>(x,y,z,w)</code>
1011     * to the axis of rotation <code>(a_x, a_y, a_z)</code> and rotation
1012     * amount <code>theta</code>, the following formulas can be used:</p>
1013     * <pre><code> theta = 2 * acos(w)
1014     * a_x = x / sin(theta/2)
1015     * a_y = y / sin(theta/2)
1016     * a_z = z / sin(theta/2)
1017     * </code></pre>
1018     * <p>To create a 3x3 rotation matrix that applies the rotation
1019     * defined by this quarternion, the following matrix can be
1020     * used:</p>
1021     * <pre><code>R = [ 1 - 2y^2 - 2z^2,       2xy - 2zw,       2xz + 2yw,
1022     *            2xy + 2zw, 1 - 2x^2 - 2z^2,       2yz - 2xw,
1023     *            2xz - 2yw,       2yz + 2xw, 1 - 2x^2 - 2y^2 ]
1024     * </code></pre>
1025     * <p>This matrix can then be used to apply the rotation to a
1026     *  column vector point with</p>
1027     * <p><code>p' = Rp</code></p>
1028     * <p>where <code>p</code> is in the device sensor coordinate system, and
1029     *  <code>p'</code> is in the camera-oriented coordinate system.</p>
1030     * <p><b>Units</b>:
1031     * Quarternion coefficients</p>
1032     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1033     */
1034    @PublicKey
1035    public static final Key<float[]> LENS_POSE_ROTATION =
1036            new Key<float[]>("android.lens.poseRotation", float[].class);
1037
1038    /**
1039     * <p>Position of the camera optical center.</p>
1040     * <p>The position of the camera device's lens optical center,
1041     * as a three-dimensional vector <code>(x,y,z)</code>, relative to the
1042     * optical center of the largest camera device facing in the
1043     * same direction as this camera, in the {@link android.hardware.SensorEvent Android sensor coordinate
1044     * axes}. Note that only the axis definitions are shared with
1045     * the sensor coordinate system, but not the origin.</p>
1046     * <p>If this device is the largest or only camera device with a
1047     * given facing, then this position will be <code>(0, 0, 0)</code>; a
1048     * camera device with a lens optical center located 3 cm from
1049     * the main sensor along the +X axis (to the right from the
1050     * user's perspective) will report <code>(0.03, 0, 0)</code>.</p>
1051     * <p>To transform a pixel coordinates between two cameras
1052     * facing the same direction, first the source camera
1053     * android.lens.radialDistortion must be corrected for.  Then
1054     * the source camera android.lens.intrinsicCalibration needs
1055     * to be applied, followed by the {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation}
1056     * of the source camera, the translation of the source camera
1057     * relative to the destination camera, the
1058     * {@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} of the destination camera, and
1059     * finally the inverse of android.lens.intrinsicCalibration
1060     * of the destination camera. This obtains a
1061     * radial-distortion-free coordinate in the destination
1062     * camera pixel coordinates.</p>
1063     * <p>To compare this against a real image from the destination
1064     * camera, the destination camera image then needs to be
1065     * corrected for radial distortion before comparison or
1066     * sampling.</p>
1067     * <p><b>Units</b>: Meters</p>
1068     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1069     *
1070     * @see CameraCharacteristics#LENS_POSE_ROTATION
1071     */
1072    @PublicKey
1073    public static final Key<float[]> LENS_POSE_TRANSLATION =
1074            new Key<float[]>("android.lens.poseTranslation", float[].class);
1075
1076    /**
1077     * <p>The parameters for this camera device's intrinsic
1078     * calibration.</p>
1079     * <p>The five calibration parameters that describe the
1080     * transform from camera-centric 3D coordinates to sensor
1081     * pixel coordinates:</p>
1082     * <pre><code>[f_x, f_y, c_x, c_y, s]
1083     * </code></pre>
1084     * <p>Where <code>f_x</code> and <code>f_y</code> are the horizontal and vertical
1085     * focal lengths, <code>[c_x, c_y]</code> is the position of the optical
1086     * axis, and <code>s</code> is a skew parameter for the sensor plane not
1087     * being aligned with the lens plane.</p>
1088     * <p>These are typically used within a transformation matrix K:</p>
1089     * <pre><code>K = [ f_x,   s, c_x,
1090     *        0, f_y, c_y,
1091     *        0    0,   1 ]
1092     * </code></pre>
1093     * <p>which can then be combined with the camera pose rotation
1094     * <code>R</code> and translation <code>t</code> ({@link CameraCharacteristics#LENS_POSE_ROTATION android.lens.poseRotation} and
1095     * {@link CameraCharacteristics#LENS_POSE_TRANSLATION android.lens.poseTranslation}, respective) to calculate the
1096     * complete transform from world coordinates to pixel
1097     * coordinates:</p>
1098     * <pre><code>P = [ K 0   * [ R t
1099     *      0 1 ]     0 1 ]
1100     * </code></pre>
1101     * <p>and with <code>p_w</code> being a point in the world coordinate system
1102     * and <code>p_s</code> being a point in the camera active pixel array
1103     * coordinate system, and with the mapping including the
1104     * homogeneous division by z:</p>
1105     * <pre><code> p_h = (x_h, y_h, z_h) = P p_w
1106     * p_s = p_h / z_h
1107     * </code></pre>
1108     * <p>so <code>[x_s, y_s]</code> is the pixel coordinates of the world
1109     * point, <code>z_s = 1</code>, and <code>w_s</code> is a measurement of disparity
1110     * (depth) in pixel coordinates.</p>
1111     * <p>Note that the coordinate system for this transform is the
1112     * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} system,
1113     * where <code>(0,0)</code> is the top-left of the
1114     * preCorrectionActiveArraySize rectangle. Once the pose and
1115     * intrinsic calibration transforms have been applied to a
1116     * world point, then the android.lens.radialDistortion
1117     * transform needs to be applied, and the result adjusted to
1118     * be in the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} coordinate
1119     * system (where <code>(0, 0)</code> is the top-left of the
1120     * activeArraySize rectangle), to determine the final pixel
1121     * coordinate of the world point for processed (non-RAW)
1122     * output buffers.</p>
1123     * <p><b>Units</b>:
1124     * Pixels in the
1125     * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}
1126     * coordinate system.</p>
1127     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1128     *
1129     * @see CameraCharacteristics#LENS_POSE_ROTATION
1130     * @see CameraCharacteristics#LENS_POSE_TRANSLATION
1131     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1132     * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
1133     */
1134    @PublicKey
1135    public static final Key<float[]> LENS_INTRINSIC_CALIBRATION =
1136            new Key<float[]>("android.lens.intrinsicCalibration", float[].class);
1137
1138    /**
1139     * <p>The correction coefficients to correct for this camera device's
1140     * radial and tangential lens distortion.</p>
1141     * <p>Four radial distortion coefficients <code>[kappa_0, kappa_1, kappa_2,
1142     * kappa_3]</code> and two tangential distortion coefficients
1143     * <code>[kappa_4, kappa_5]</code> that can be used to correct the
1144     * lens's geometric distortion with the mapping equations:</p>
1145     * <pre><code> x_c = x_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1146     *        kappa_4 * (2 * x_i * y_i) + kappa_5 * ( r^2 + 2 * x_i^2 )
1147     *  y_c = y_i * ( kappa_0 + kappa_1 * r^2 + kappa_2 * r^4 + kappa_3 * r^6 ) +
1148     *        kappa_5 * (2 * x_i * y_i) + kappa_4 * ( r^2 + 2 * y_i^2 )
1149     * </code></pre>
1150     * <p>Here, <code>[x_c, y_c]</code> are the coordinates to sample in the
1151     * input image that correspond to the pixel values in the
1152     * corrected image at the coordinate <code>[x_i, y_i]</code>:</p>
1153     * <pre><code> correctedImage(x_i, y_i) = sample_at(x_c, y_c, inputImage)
1154     * </code></pre>
1155     * <p>The pixel coordinates are defined in a normalized
1156     * coordinate system related to the
1157     * android.lens.intrinsicCalibration calibration fields.
1158     * Both <code>[x_i, y_i]</code> and <code>[x_c, y_c]</code> have <code>(0,0)</code> at the
1159     * lens optical center <code>[c_x, c_y]</code>. The maximum magnitudes
1160     * of both x and y coordinates are normalized to be 1 at the
1161     * edge further from the optical center, so the range
1162     * for both dimensions is <code>-1 &lt;= x &lt;= 1</code>.</p>
1163     * <p>Finally, <code>r</code> represents the radial distance from the
1164     * optical center, <code>r^2 = x_i^2 + y_i^2</code>, and its magnitude
1165     * is therefore no larger than <code>|r| &lt;= sqrt(2)</code>.</p>
1166     * <p>The distortion model used is the Brown-Conrady model.</p>
1167     * <p><b>Units</b>:
1168     * Unitless coefficients.</p>
1169     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1170     */
1171    @PublicKey
1172    public static final Key<float[]> LENS_RADIAL_DISTORTION =
1173            new Key<float[]>("android.lens.radialDistortion", float[].class);
1174
1175    /**
1176     * <p>List of noise reduction modes for {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode} that are supported
1177     * by this camera device.</p>
1178     * <p>Full-capability camera devices will always support OFF and FAST.</p>
1179     * <p>Legacy-capability camera devices will only support FAST mode.</p>
1180     * <p><b>Range of valid values:</b><br>
1181     * Any value listed in {@link CaptureRequest#NOISE_REDUCTION_MODE android.noiseReduction.mode}</p>
1182     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1183     * <p><b>Limited capability</b> -
1184     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
1185     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1186     *
1187     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1188     * @see CaptureRequest#NOISE_REDUCTION_MODE
1189     */
1190    @PublicKey
1191    public static final Key<int[]> NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES =
1192            new Key<int[]>("android.noiseReduction.availableNoiseReductionModes", int[].class);
1193
1194    /**
1195     * <p>If set to 1, the HAL will always split result
1196     * metadata for a single capture into multiple buffers,
1197     * returned using multiple process_capture_result calls.</p>
1198     * <p>Does not need to be listed in static
1199     * metadata. Support for partial results will be reworked in
1200     * future versions of camera service. This quirk will stop
1201     * working at that point; DO NOT USE without careful
1202     * consideration of future support.</p>
1203     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1204     * @deprecated
1205     * @hide
1206     */
1207    @Deprecated
1208    public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
1209            new Key<Byte>("android.quirks.usePartialResult", byte.class);
1210
1211    /**
1212     * <p>The maximum numbers of different types of output streams
1213     * that can be configured and used simultaneously by a camera device.</p>
1214     * <p>This is a 3 element tuple that contains the max number of output simultaneous
1215     * streams for raw sensor, processed (but not stalling), and processed (and stalling)
1216     * formats respectively. For example, assuming that JPEG is typically a processed and
1217     * stalling stream, if max raw sensor format output stream number is 1, max YUV streams
1218     * number is 3, and max JPEG stream number is 2, then this tuple should be <code>(1, 3, 2)</code>.</p>
1219     * <p>This lists the upper bound of the number of output streams supported by
1220     * the camera device. Using more streams simultaneously may require more hardware and
1221     * CPU resources that will consume more power. The image format for an output stream can
1222     * be any supported format provided by android.scaler.availableStreamConfigurations.
1223     * The formats defined in android.scaler.availableStreamConfigurations can be catergorized
1224     * into the 3 stream types as below:</p>
1225     * <ul>
1226     * <li>Processed (but stalling): any non-RAW format with a stallDurations &gt; 0.
1227     *   Typically {@link android.graphics.ImageFormat#JPEG JPEG format}.</li>
1228     * <li>Raw formats: {@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}, {@link android.graphics.ImageFormat#RAW10 RAW10}, or {@link android.graphics.ImageFormat#RAW12 RAW12}.</li>
1229     * <li>Processed (but not-stalling): any non-RAW format without a stall duration.
1230     *   Typically {@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888},
1231     *   {@link android.graphics.ImageFormat#NV21 NV21}, or
1232     *   {@link android.graphics.ImageFormat#YV12 YV12}.</li>
1233     * </ul>
1234     * <p><b>Range of valid values:</b><br></p>
1235     * <p>For processed (and stalling) format streams, &gt;= 1.</p>
1236     * <p>For Raw format (either stalling or non-stalling) streams, &gt;= 0.</p>
1237     * <p>For processed (but not stalling) format streams, &gt;= 3
1238     * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1239     * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
1240     * <p>This key is available on all devices.</p>
1241     *
1242     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1243     * @hide
1244     */
1245    public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
1246            new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
1247
1248    /**
1249     * <p>The maximum numbers of different types of output streams
1250     * that can be configured and used simultaneously by a camera device
1251     * for any <code>RAW</code> formats.</p>
1252     * <p>This value contains the max number of output simultaneous
1253     * streams from the raw sensor.</p>
1254     * <p>This lists the upper bound of the number of output streams supported by
1255     * the camera device. Using more streams simultaneously may require more hardware and
1256     * CPU resources that will consume more power. The image format for this kind of an output stream can
1257     * be any <code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1258     * <p>In particular, a <code>RAW</code> format is typically one of:</p>
1259     * <ul>
1260     * <li>{@link android.graphics.ImageFormat#RAW_SENSOR RAW_SENSOR}</li>
1261     * <li>{@link android.graphics.ImageFormat#RAW10 RAW10}</li>
1262     * <li>{@link android.graphics.ImageFormat#RAW12 RAW12}</li>
1263     * </ul>
1264     * <p>LEGACY mode devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> LEGACY)
1265     * never support raw streams.</p>
1266     * <p><b>Range of valid values:</b><br></p>
1267     * <p>&gt;= 0</p>
1268     * <p>This key is available on all devices.</p>
1269     *
1270     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1271     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1272     */
1273    @PublicKey
1274    @SyntheticKey
1275    public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_RAW =
1276            new Key<Integer>("android.request.maxNumOutputRaw", int.class);
1277
1278    /**
1279     * <p>The maximum numbers of different types of output streams
1280     * that can be configured and used simultaneously by a camera device
1281     * for any processed (but not-stalling) formats.</p>
1282     * <p>This value contains the max number of output simultaneous
1283     * streams for any processed (but not-stalling) formats.</p>
1284     * <p>This lists the upper bound of the number of output streams supported by
1285     * the camera device. Using more streams simultaneously may require more hardware and
1286     * CPU resources that will consume more power. The image format for this kind of an output stream can
1287     * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1288     * <p>Processed (but not-stalling) is defined as any non-RAW format without a stall duration.
1289     * Typically:</p>
1290     * <ul>
1291     * <li>{@link android.graphics.ImageFormat#YUV_420_888 YUV_420_888}</li>
1292     * <li>{@link android.graphics.ImageFormat#NV21 NV21}</li>
1293     * <li>{@link android.graphics.ImageFormat#YV12 YV12}</li>
1294     * <li>Implementation-defined formats, i.e. {@link android.hardware.camera2.params.StreamConfigurationMap#isOutputSupportedFor(Class) }</li>
1295     * </ul>
1296     * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1297     * processed format -- it will return 0 for a non-stalling stream.</p>
1298     * <p>LEGACY devices will support at least 2 processing/non-stalling streams.</p>
1299     * <p><b>Range of valid values:</b><br></p>
1300     * <p>&gt;= 3
1301     * for FULL mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL</code>);
1302     * &gt;= 2 for LIMITED mode devices (<code>{@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == LIMITED</code>).</p>
1303     * <p>This key is available on all devices.</p>
1304     *
1305     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1306     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1307     */
1308    @PublicKey
1309    @SyntheticKey
1310    public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC =
1311            new Key<Integer>("android.request.maxNumOutputProc", int.class);
1312
1313    /**
1314     * <p>The maximum numbers of different types of output streams
1315     * that can be configured and used simultaneously by a camera device
1316     * for any processed (and stalling) formats.</p>
1317     * <p>This value contains the max number of output simultaneous
1318     * streams for any processed (but not-stalling) formats.</p>
1319     * <p>This lists the upper bound of the number of output streams supported by
1320     * the camera device. Using more streams simultaneously may require more hardware and
1321     * CPU resources that will consume more power. The image format for this kind of an output stream can
1322     * be any non-<code>RAW</code> and supported format provided by {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}.</p>
1323     * <p>A processed and stalling format is defined as any non-RAW format with a stallDurations
1324     * &gt; 0.  Typically only the {@link android.graphics.ImageFormat#JPEG JPEG format} is a
1325     * stalling format.</p>
1326     * <p>For full guarantees, query {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } with a
1327     * processed format -- it will return a non-0 value for a stalling stream.</p>
1328     * <p>LEGACY devices will support up to 1 processing/stalling stream.</p>
1329     * <p><b>Range of valid values:</b><br></p>
1330     * <p>&gt;= 1</p>
1331     * <p>This key is available on all devices.</p>
1332     *
1333     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
1334     */
1335    @PublicKey
1336    @SyntheticKey
1337    public static final Key<Integer> REQUEST_MAX_NUM_OUTPUT_PROC_STALLING =
1338            new Key<Integer>("android.request.maxNumOutputProcStalling", int.class);
1339
1340    /**
1341     * <p>The maximum numbers of any type of input streams
1342     * that can be configured and used simultaneously by a camera device.</p>
1343     * <p>When set to 0, it means no input stream is supported.</p>
1344     * <p>The image format for a input stream can be any supported format returned by {@link android.hardware.camera2.params.StreamConfigurationMap#getInputFormats }. When using an
1345     * input stream, there must be at least one output stream configured to to receive the
1346     * reprocessed images.</p>
1347     * <p>When an input stream and some output streams are used in a reprocessing request,
1348     * only the input buffer will be used to produce these output stream buffers, and a
1349     * new sensor image will not be captured.</p>
1350     * <p>For example, for Zero Shutter Lag (ZSL) still capture use case, the input
1351     * stream image format will be PRIVATE, the associated output stream image format
1352     * should be JPEG.</p>
1353     * <p><b>Range of valid values:</b><br></p>
1354     * <p>0 or 1.</p>
1355     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1356     * <p><b>Full capability</b> -
1357     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
1358     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
1359     *
1360     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1361     */
1362    @PublicKey
1363    public static final Key<Integer> REQUEST_MAX_NUM_INPUT_STREAMS =
1364            new Key<Integer>("android.request.maxNumInputStreams", int.class);
1365
1366    /**
1367     * <p>Specifies the number of maximum pipeline stages a frame
1368     * has to go through from when it's exposed to when it's available
1369     * to the framework.</p>
1370     * <p>A typical minimum value for this is 2 (one stage to expose,
1371     * one stage to readout) from the sensor. The ISP then usually adds
1372     * its own stages to do custom HW processing. Further stages may be
1373     * added by SW processing.</p>
1374     * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
1375     * processing is enabled (e.g. face detection), the actual pipeline
1376     * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
1377     * the max pipeline depth.</p>
1378     * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
1379     * X frame intervals.</p>
1380     * <p>This value will normally be 8 or less, however, for high speed capture session,
1381     * the max pipeline depth will be up to 8 x size of high speed capture request list.</p>
1382     * <p>This key is available on all devices.</p>
1383     *
1384     * @see CaptureResult#REQUEST_PIPELINE_DEPTH
1385     */
1386    @PublicKey
1387    public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
1388            new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
1389
1390    /**
1391     * <p>Defines how many sub-components
1392     * a result will be composed of.</p>
1393     * <p>In order to combat the pipeline latency, partial results
1394     * may be delivered to the application layer from the camera device as
1395     * soon as they are available.</p>
1396     * <p>Optional; defaults to 1. A value of 1 means that partial
1397     * results are not supported, and only the final TotalCaptureResult will
1398     * be produced by the camera device.</p>
1399     * <p>A typical use case for this might be: after requesting an
1400     * auto-focus (AF) lock the new AF state might be available 50%
1401     * of the way through the pipeline.  The camera device could
1402     * then immediately dispatch this state via a partial result to
1403     * the application, and the rest of the metadata via later
1404     * partial results.</p>
1405     * <p><b>Range of valid values:</b><br>
1406     * &gt;= 1</p>
1407     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1408     */
1409    @PublicKey
1410    public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
1411            new Key<Integer>("android.request.partialResultCount", int.class);
1412
1413    /**
1414     * <p>List of capabilities that this camera device
1415     * advertises as fully supporting.</p>
1416     * <p>A capability is a contract that the camera device makes in order
1417     * to be able to satisfy one or more use cases.</p>
1418     * <p>Listing a capability guarantees that the whole set of features
1419     * required to support a common use will all be available.</p>
1420     * <p>Using a subset of the functionality provided by an unsupported
1421     * capability may be possible on a specific camera device implementation;
1422     * to do this query each of android.request.availableRequestKeys,
1423     * android.request.availableResultKeys,
1424     * android.request.availableCharacteristicsKeys.</p>
1425     * <p>The following capabilities are guaranteed to be available on
1426     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} <code>==</code> FULL devices:</p>
1427     * <ul>
1428     * <li>MANUAL_SENSOR</li>
1429     * <li>MANUAL_POST_PROCESSING</li>
1430     * </ul>
1431     * <p>Other capabilities may be available on either FULL or LIMITED
1432     * devices, but the application should query this key to be sure.</p>
1433     * <p><b>Possible values:</b>
1434     * <ul>
1435     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE BACKWARD_COMPATIBLE}</li>
1436     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR MANUAL_SENSOR}</li>
1437     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING MANUAL_POST_PROCESSING}</li>
1438     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_RAW RAW}</li>
1439     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING PRIVATE_REPROCESSING}</li>
1440     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}</li>
1441     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}</li>
1442     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING YUV_REPROCESSING}</li>
1443     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT DEPTH_OUTPUT}</li>
1444     *   <li>{@link #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO CONSTRAINED_HIGH_SPEED_VIDEO}</li>
1445     * </ul></p>
1446     * <p>This key is available on all devices.</p>
1447     *
1448     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1449     * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE
1450     * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR
1451     * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING
1452     * @see #REQUEST_AVAILABLE_CAPABILITIES_RAW
1453     * @see #REQUEST_AVAILABLE_CAPABILITIES_PRIVATE_REPROCESSING
1454     * @see #REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS
1455     * @see #REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE
1456     * @see #REQUEST_AVAILABLE_CAPABILITIES_YUV_REPROCESSING
1457     * @see #REQUEST_AVAILABLE_CAPABILITIES_DEPTH_OUTPUT
1458     * @see #REQUEST_AVAILABLE_CAPABILITIES_CONSTRAINED_HIGH_SPEED_VIDEO
1459     */
1460    @PublicKey
1461    public static final Key<int[]> REQUEST_AVAILABLE_CAPABILITIES =
1462            new Key<int[]>("android.request.availableCapabilities", int[].class);
1463
1464    /**
1465     * <p>A list of all keys that the camera device has available
1466     * to use with {@link android.hardware.camera2.CaptureRequest }.</p>
1467     * <p>Attempting to set a key into a CaptureRequest that is not
1468     * listed here will result in an invalid request and will be rejected
1469     * by the camera device.</p>
1470     * <p>This field can be used to query the feature set of a camera device
1471     * at a more granular level than capabilities. This is especially
1472     * important for optional keys that are not listed under any capability
1473     * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
1474     * <p>This key is available on all devices.</p>
1475     *
1476     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1477     * @hide
1478     */
1479    public static final Key<int[]> REQUEST_AVAILABLE_REQUEST_KEYS =
1480            new Key<int[]>("android.request.availableRequestKeys", int[].class);
1481
1482    /**
1483     * <p>A list of all keys that the camera device has available
1484     * to use with {@link android.hardware.camera2.CaptureResult }.</p>
1485     * <p>Attempting to get a key from a CaptureResult that is not
1486     * listed here will always return a <code>null</code> value. Getting a key from
1487     * a CaptureResult that is listed here will generally never return a <code>null</code>
1488     * value.</p>
1489     * <p>The following keys may return <code>null</code> unless they are enabled:</p>
1490     * <ul>
1491     * <li>android.statistics.lensShadingMap (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)</li>
1492     * </ul>
1493     * <p>(Those sometimes-null keys will nevertheless be listed here
1494     * if they are available.)</p>
1495     * <p>This field can be used to query the feature set of a camera device
1496     * at a more granular level than capabilities. This is especially
1497     * important for optional keys that are not listed under any capability
1498     * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
1499     * <p>This key is available on all devices.</p>
1500     *
1501     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1502     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
1503     * @hide
1504     */
1505    public static final Key<int[]> REQUEST_AVAILABLE_RESULT_KEYS =
1506            new Key<int[]>("android.request.availableResultKeys", int[].class);
1507
1508    /**
1509     * <p>A list of all keys that the camera device has available
1510     * to use with {@link android.hardware.camera2.CameraCharacteristics }.</p>
1511     * <p>This entry follows the same rules as
1512     * android.request.availableResultKeys (except that it applies for
1513     * CameraCharacteristics instead of CaptureResult). See above for more
1514     * details.</p>
1515     * <p>This key is available on all devices.</p>
1516     * @hide
1517     */
1518    public static final Key<int[]> REQUEST_AVAILABLE_CHARACTERISTICS_KEYS =
1519            new Key<int[]>("android.request.availableCharacteristicsKeys", int[].class);
1520
1521    /**
1522     * <p>The list of image formats that are supported by this
1523     * camera device for output streams.</p>
1524     * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
1525     * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
1526     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1527     * @deprecated
1528     * @hide
1529     */
1530    @Deprecated
1531    public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
1532            new Key<int[]>("android.scaler.availableFormats", int[].class);
1533
1534    /**
1535     * <p>The minimum frame duration that is supported
1536     * for each resolution in android.scaler.availableJpegSizes.</p>
1537     * <p>This corresponds to the minimum steady-state frame duration when only
1538     * that JPEG stream is active and captured in a burst, with all
1539     * processing (typically in android.*.mode) set to FAST.</p>
1540     * <p>When multiple streams are configured, the minimum
1541     * frame duration will be &gt;= max(individual stream min
1542     * durations)</p>
1543     * <p><b>Units</b>: Nanoseconds</p>
1544     * <p><b>Range of valid values:</b><br>
1545     * TODO: Remove property.</p>
1546     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1547     * @deprecated
1548     * @hide
1549     */
1550    @Deprecated
1551    public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
1552            new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
1553
1554    /**
1555     * <p>The JPEG resolutions that are supported by this camera device.</p>
1556     * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
1557     * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
1558     * <p><b>Range of valid values:</b><br>
1559     * TODO: Remove property.</p>
1560     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1561     *
1562     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1563     * @deprecated
1564     * @hide
1565     */
1566    @Deprecated
1567    public static final Key<android.util.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
1568            new Key<android.util.Size[]>("android.scaler.availableJpegSizes", android.util.Size[].class);
1569
1570    /**
1571     * <p>The maximum ratio between both active area width
1572     * and crop region width, and active area height and
1573     * crop region height, for {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
1574     * <p>This represents the maximum amount of zooming possible by
1575     * the camera device, or equivalently, the minimum cropping
1576     * window size.</p>
1577     * <p>Crop regions that have a width or height that is smaller
1578     * than this ratio allows will be rounded up to the minimum
1579     * allowed size by the camera device.</p>
1580     * <p><b>Units</b>: Zoom scale factor</p>
1581     * <p><b>Range of valid values:</b><br>
1582     * &gt;=1</p>
1583     * <p>This key is available on all devices.</p>
1584     *
1585     * @see CaptureRequest#SCALER_CROP_REGION
1586     */
1587    @PublicKey
1588    public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
1589            new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
1590
1591    /**
1592     * <p>For each available processed output size (defined in
1593     * android.scaler.availableProcessedSizes), this property lists the
1594     * minimum supportable frame duration for that size.</p>
1595     * <p>This should correspond to the frame duration when only that processed
1596     * stream is active, with all processing (typically in android.*.mode)
1597     * set to FAST.</p>
1598     * <p>When multiple streams are configured, the minimum frame duration will
1599     * be &gt;= max(individual stream min durations).</p>
1600     * <p><b>Units</b>: Nanoseconds</p>
1601     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1602     * @deprecated
1603     * @hide
1604     */
1605    @Deprecated
1606    public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
1607            new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
1608
1609    /**
1610     * <p>The resolutions available for use with
1611     * processed output streams, such as YV12, NV12, and
1612     * platform opaque YUV/RGB streams to the GPU or video
1613     * encoders.</p>
1614     * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
1615     * <p>For a given use case, the actual maximum supported resolution
1616     * may be lower than what is listed here, depending on the destination
1617     * Surface for the image data. For example, for recording video,
1618     * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1619     * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1620     * can provide.</p>
1621     * <p>Please reference the documentation for the image data destination to
1622     * check if it limits the maximum size for image data.</p>
1623     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1624     * @deprecated
1625     * @hide
1626     */
1627    @Deprecated
1628    public static final Key<android.util.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
1629            new Key<android.util.Size[]>("android.scaler.availableProcessedSizes", android.util.Size[].class);
1630
1631    /**
1632     * <p>The mapping of image formats that are supported by this
1633     * camera device for input streams, to their corresponding output formats.</p>
1634     * <p>All camera devices with at least 1
1635     * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one
1636     * available input format.</p>
1637     * <p>The camera device will support the following map of formats,
1638     * if its dependent capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}) is supported:</p>
1639     * <table>
1640     * <thead>
1641     * <tr>
1642     * <th align="left">Input Format</th>
1643     * <th align="left">Output Format</th>
1644     * <th align="left">Capability</th>
1645     * </tr>
1646     * </thead>
1647     * <tbody>
1648     * <tr>
1649     * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
1650     * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
1651     * <td align="left">PRIVATE_REPROCESSING</td>
1652     * </tr>
1653     * <tr>
1654     * <td align="left">{@link android.graphics.ImageFormat#PRIVATE }</td>
1655     * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1656     * <td align="left">PRIVATE_REPROCESSING</td>
1657     * </tr>
1658     * <tr>
1659     * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1660     * <td align="left">{@link android.graphics.ImageFormat#JPEG }</td>
1661     * <td align="left">YUV_REPROCESSING</td>
1662     * </tr>
1663     * <tr>
1664     * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1665     * <td align="left">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1666     * <td align="left">YUV_REPROCESSING</td>
1667     * </tr>
1668     * </tbody>
1669     * </table>
1670     * <p>PRIVATE refers to a device-internal format that is not directly application-visible.  A
1671     * PRIVATE input surface can be acquired by {@link android.media.ImageReader#newInstance }
1672     * with {@link android.graphics.ImageFormat#PRIVATE } as the format.</p>
1673     * <p>For a PRIVATE_REPROCESSING-capable camera device, using the PRIVATE format as either input
1674     * or output will never hurt maximum frame rate (i.e.  {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration getOutputStallDuration(ImageFormat.PRIVATE, size)} is always 0),</p>
1675     * <p>Attempting to configure an input stream with output streams not
1676     * listed as available in this map is not valid.</p>
1677     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
1678     *
1679     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1680     * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS
1681     * @hide
1682     */
1683    public static final Key<android.hardware.camera2.params.ReprocessFormatsMap> SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP =
1684            new Key<android.hardware.camera2.params.ReprocessFormatsMap>("android.scaler.availableInputOutputFormatsMap", android.hardware.camera2.params.ReprocessFormatsMap.class);
1685
1686    /**
1687     * <p>The available stream configurations that this
1688     * camera device supports
1689     * (i.e. format, width, height, output/input stream).</p>
1690     * <p>The configurations are listed as <code>(format, width, height, input?)</code>
1691     * tuples.</p>
1692     * <p>For a given use case, the actual maximum supported resolution
1693     * may be lower than what is listed here, depending on the destination
1694     * Surface for the image data. For example, for recording video,
1695     * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1696     * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1697     * can provide.</p>
1698     * <p>Please reference the documentation for the image data destination to
1699     * check if it limits the maximum size for image data.</p>
1700     * <p>Not all output formats may be supported in a configuration with
1701     * an input stream of a particular format. For more details, see
1702     * android.scaler.availableInputOutputFormatsMap.</p>
1703     * <p>The following table describes the minimum required output stream
1704     * configurations based on the hardware level
1705     * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
1706     * <table>
1707     * <thead>
1708     * <tr>
1709     * <th align="center">Format</th>
1710     * <th align="center">Size</th>
1711     * <th align="center">Hardware Level</th>
1712     * <th align="center">Notes</th>
1713     * </tr>
1714     * </thead>
1715     * <tbody>
1716     * <tr>
1717     * <td align="center">JPEG</td>
1718     * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
1719     * <td align="center">Any</td>
1720     * <td align="center"></td>
1721     * </tr>
1722     * <tr>
1723     * <td align="center">JPEG</td>
1724     * <td align="center">1920x1080 (1080p)</td>
1725     * <td align="center">Any</td>
1726     * <td align="center">if 1080p &lt;= activeArraySize</td>
1727     * </tr>
1728     * <tr>
1729     * <td align="center">JPEG</td>
1730     * <td align="center">1280x720 (720)</td>
1731     * <td align="center">Any</td>
1732     * <td align="center">if 720p &lt;= activeArraySize</td>
1733     * </tr>
1734     * <tr>
1735     * <td align="center">JPEG</td>
1736     * <td align="center">640x480 (480p)</td>
1737     * <td align="center">Any</td>
1738     * <td align="center">if 480p &lt;= activeArraySize</td>
1739     * </tr>
1740     * <tr>
1741     * <td align="center">JPEG</td>
1742     * <td align="center">320x240 (240p)</td>
1743     * <td align="center">Any</td>
1744     * <td align="center">if 240p &lt;= activeArraySize</td>
1745     * </tr>
1746     * <tr>
1747     * <td align="center">YUV_420_888</td>
1748     * <td align="center">all output sizes available for JPEG</td>
1749     * <td align="center">FULL</td>
1750     * <td align="center"></td>
1751     * </tr>
1752     * <tr>
1753     * <td align="center">YUV_420_888</td>
1754     * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
1755     * <td align="center">LIMITED</td>
1756     * <td align="center"></td>
1757     * </tr>
1758     * <tr>
1759     * <td align="center">IMPLEMENTATION_DEFINED</td>
1760     * <td align="center">same as YUV_420_888</td>
1761     * <td align="center">Any</td>
1762     * <td align="center"></td>
1763     * </tr>
1764     * </tbody>
1765     * </table>
1766     * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional
1767     * mandatory stream configurations on a per-capability basis.</p>
1768     * <p>This key is available on all devices.</p>
1769     *
1770     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1771     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1772     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1773     * @hide
1774     */
1775    public static final Key<android.hardware.camera2.params.StreamConfiguration[]> SCALER_AVAILABLE_STREAM_CONFIGURATIONS =
1776            new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.scaler.availableStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
1777
1778    /**
1779     * <p>This lists the minimum frame duration for each
1780     * format/size combination.</p>
1781     * <p>This should correspond to the frame duration when only that
1782     * stream is active, with all processing (typically in android.*.mode)
1783     * set to either OFF or FAST.</p>
1784     * <p>When multiple streams are used in a request, the minimum frame
1785     * duration will be max(individual stream min durations).</p>
1786     * <p>The minimum frame duration of a stream (of a particular format, size)
1787     * is the same regardless of whether the stream is input or output.</p>
1788     * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
1789     * android.scaler.availableStallDurations for more details about
1790     * calculating the max frame rate.</p>
1791     * <p>(Keep in sync with
1792     * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration })</p>
1793     * <p><b>Units</b>: (format, width, height, ns) x n</p>
1794     * <p>This key is available on all devices.</p>
1795     *
1796     * @see CaptureRequest#SENSOR_FRAME_DURATION
1797     * @hide
1798     */
1799    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_MIN_FRAME_DURATIONS =
1800            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
1801
1802    /**
1803     * <p>This lists the maximum stall duration for each
1804     * output format/size combination.</p>
1805     * <p>A stall duration is how much extra time would get added
1806     * to the normal minimum frame duration for a repeating request
1807     * that has streams with non-zero stall.</p>
1808     * <p>For example, consider JPEG captures which have the following
1809     * characteristics:</p>
1810     * <ul>
1811     * <li>JPEG streams act like processed YUV streams in requests for which
1812     * they are not included; in requests in which they are directly
1813     * referenced, they act as JPEG streams. This is because supporting a
1814     * JPEG stream requires the underlying YUV data to always be ready for
1815     * use by a JPEG encoder, but the encoder will only be used (and impact
1816     * frame duration) on requests that actually reference a JPEG stream.</li>
1817     * <li>The JPEG processor can run concurrently to the rest of the camera
1818     * pipeline, but cannot process more than 1 capture at a time.</li>
1819     * </ul>
1820     * <p>In other words, using a repeating YUV request would result
1821     * in a steady frame rate (let's say it's 30 FPS). If a single
1822     * JPEG request is submitted periodically, the frame rate will stay
1823     * at 30 FPS (as long as we wait for the previous JPEG to return each
1824     * time). If we try to submit a repeating YUV + JPEG request, then
1825     * the frame rate will drop from 30 FPS.</p>
1826     * <p>In general, submitting a new request with a non-0 stall time
1827     * stream will <em>not</em> cause a frame rate drop unless there are still
1828     * outstanding buffers for that stream from previous requests.</p>
1829     * <p>Submitting a repeating request with streams (call this <code>S</code>)
1830     * is the same as setting the minimum frame duration from
1831     * the normal minimum frame duration corresponding to <code>S</code>, added with
1832     * the maximum stall duration for <code>S</code>.</p>
1833     * <p>If interleaving requests with and without a stall duration,
1834     * a request will stall by the maximum of the remaining times
1835     * for each can-stall stream with outstanding buffers.</p>
1836     * <p>This means that a stalling request will not have an exposure start
1837     * until the stall has completed.</p>
1838     * <p>This should correspond to the stall duration when only that stream is
1839     * active, with all processing (typically in android.*.mode) set to FAST
1840     * or OFF. Setting any of the processing modes to HIGH_QUALITY
1841     * effectively results in an indeterminate stall duration for all
1842     * streams in a request (the regular stall calculation rules are
1843     * ignored).</p>
1844     * <p>The following formats may always have a stall duration:</p>
1845     * <ul>
1846     * <li>{@link android.graphics.ImageFormat#JPEG }</li>
1847     * <li>{@link android.graphics.ImageFormat#RAW_SENSOR }</li>
1848     * </ul>
1849     * <p>The following formats will never have a stall duration:</p>
1850     * <ul>
1851     * <li>{@link android.graphics.ImageFormat#YUV_420_888 }</li>
1852     * <li>{@link android.graphics.ImageFormat#RAW10 }</li>
1853     * </ul>
1854     * <p>All other formats may or may not have an allowed stall duration on
1855     * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}
1856     * for more details.</p>
1857     * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about
1858     * calculating the max frame rate (absent stalls).</p>
1859     * <p>(Keep up to date with
1860     * {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputStallDuration } )</p>
1861     * <p><b>Units</b>: (format, width, height, ns) x n</p>
1862     * <p>This key is available on all devices.</p>
1863     *
1864     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1865     * @see CaptureRequest#SENSOR_FRAME_DURATION
1866     * @hide
1867     */
1868    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> SCALER_AVAILABLE_STALL_DURATIONS =
1869            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.scaler.availableStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
1870
1871    /**
1872     * <p>The available stream configurations that this
1873     * camera device supports; also includes the minimum frame durations
1874     * and the stall durations for each format/size combination.</p>
1875     * <p>All camera devices will support sensor maximum resolution (defined by
1876     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.</p>
1877     * <p>For a given use case, the actual maximum supported resolution
1878     * may be lower than what is listed here, depending on the destination
1879     * Surface for the image data. For example, for recording video,
1880     * the video encoder chosen may have a maximum size limit (e.g. 1080p)
1881     * smaller than what the camera (e.g. maximum resolution is 3264x2448)
1882     * can provide.</p>
1883     * <p>Please reference the documentation for the image data destination to
1884     * check if it limits the maximum size for image data.</p>
1885     * <p>The following table describes the minimum required output stream
1886     * configurations based on the hardware level
1887     * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):</p>
1888     * <table>
1889     * <thead>
1890     * <tr>
1891     * <th align="center">Format</th>
1892     * <th align="center">Size</th>
1893     * <th align="center">Hardware Level</th>
1894     * <th align="center">Notes</th>
1895     * </tr>
1896     * </thead>
1897     * <tbody>
1898     * <tr>
1899     * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1900     * <td align="center">{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}</td>
1901     * <td align="center">Any</td>
1902     * <td align="center"></td>
1903     * </tr>
1904     * <tr>
1905     * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1906     * <td align="center">1920x1080 (1080p)</td>
1907     * <td align="center">Any</td>
1908     * <td align="center">if 1080p &lt;= activeArraySize</td>
1909     * </tr>
1910     * <tr>
1911     * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1912     * <td align="center">1280x720 (720)</td>
1913     * <td align="center">Any</td>
1914     * <td align="center">if 720p &lt;= activeArraySize</td>
1915     * </tr>
1916     * <tr>
1917     * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1918     * <td align="center">640x480 (480p)</td>
1919     * <td align="center">Any</td>
1920     * <td align="center">if 480p &lt;= activeArraySize</td>
1921     * </tr>
1922     * <tr>
1923     * <td align="center">{@link android.graphics.ImageFormat#JPEG }</td>
1924     * <td align="center">320x240 (240p)</td>
1925     * <td align="center">Any</td>
1926     * <td align="center">if 240p &lt;= activeArraySize</td>
1927     * </tr>
1928     * <tr>
1929     * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1930     * <td align="center">all output sizes available for JPEG</td>
1931     * <td align="center">FULL</td>
1932     * <td align="center"></td>
1933     * </tr>
1934     * <tr>
1935     * <td align="center">{@link android.graphics.ImageFormat#YUV_420_888 }</td>
1936     * <td align="center">all output sizes available for JPEG, up to the maximum video size</td>
1937     * <td align="center">LIMITED</td>
1938     * <td align="center"></td>
1939     * </tr>
1940     * <tr>
1941     * <td align="center">{@link android.graphics.ImageFormat#PRIVATE }</td>
1942     * <td align="center">same as YUV_420_888</td>
1943     * <td align="center">Any</td>
1944     * <td align="center"></td>
1945     * </tr>
1946     * </tbody>
1947     * </table>
1948     * <p>Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} and {@link android.hardware.camera2.CameraDevice#createCaptureSession } for additional mandatory
1949     * stream configurations on a per-capability basis.</p>
1950     * <p>This key is available on all devices.</p>
1951     *
1952     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
1953     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
1954     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1955     */
1956    @PublicKey
1957    @SyntheticKey
1958    public static final Key<android.hardware.camera2.params.StreamConfigurationMap> SCALER_STREAM_CONFIGURATION_MAP =
1959            new Key<android.hardware.camera2.params.StreamConfigurationMap>("android.scaler.streamConfigurationMap", android.hardware.camera2.params.StreamConfigurationMap.class);
1960
1961    /**
1962     * <p>The crop type that this camera device supports.</p>
1963     * <p>When passing a non-centered crop region ({@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}) to a camera
1964     * device that only supports CENTER_ONLY cropping, the camera device will move the
1965     * crop region to the center of the sensor active array ({@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize})
1966     * and keep the crop region width and height unchanged. The camera device will return the
1967     * final used crop region in metadata result {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
1968     * <p>Camera devices that support FREEFORM cropping will support any crop region that
1969     * is inside of the active array. The camera device will apply the same crop region and
1970     * return the final used crop region in capture result metadata {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}.</p>
1971     * <p>LEGACY capability devices will only support CENTER_ONLY cropping.</p>
1972     * <p><b>Possible values:</b>
1973     * <ul>
1974     *   <li>{@link #SCALER_CROPPING_TYPE_CENTER_ONLY CENTER_ONLY}</li>
1975     *   <li>{@link #SCALER_CROPPING_TYPE_FREEFORM FREEFORM}</li>
1976     * </ul></p>
1977     * <p>This key is available on all devices.</p>
1978     *
1979     * @see CaptureRequest#SCALER_CROP_REGION
1980     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
1981     * @see #SCALER_CROPPING_TYPE_CENTER_ONLY
1982     * @see #SCALER_CROPPING_TYPE_FREEFORM
1983     */
1984    @PublicKey
1985    public static final Key<Integer> SCALER_CROPPING_TYPE =
1986            new Key<Integer>("android.scaler.croppingType", int.class);
1987
1988    /**
1989     * <p>The area of the image sensor which corresponds to active pixels after any geometric
1990     * distortion correction has been applied.</p>
1991     * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
1992     * the region that actually receives light from the scene) after any geometric correction
1993     * has been applied, and should be treated as the maximum size in pixels of any of the
1994     * image output formats aside from the raw formats.</p>
1995     * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
1996     * the full pixel array, and the size of the full pixel array is given by
1997     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
1998     * <p>The coordinate system for most other keys that list pixel coordinates, including
1999     * {@link CaptureRequest#SCALER_CROP_REGION android.scaler.cropRegion}, is defined relative to the active array rectangle given in
2000     * this field, with <code>(0, 0)</code> being the top-left of this rectangle.</p>
2001     * <p>The active array may be smaller than the full pixel array, since the full array may
2002     * include black calibration pixels or other inactive regions, and geometric correction
2003     * resulting in scaling or cropping may have been applied.</p>
2004     * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
2005     * <p>This key is available on all devices.</p>
2006     *
2007     * @see CaptureRequest#SCALER_CROP_REGION
2008     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2009     */
2010    @PublicKey
2011    public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
2012            new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
2013
2014    /**
2015     * <p>Range of sensitivities for {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} supported by this
2016     * camera device.</p>
2017     * <p>The values are the standard ISO sensitivity values,
2018     * as defined in ISO 12232:2006.</p>
2019     * <p><b>Range of valid values:</b><br>
2020     * Min &lt;= 100, Max &gt;= 800</p>
2021     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2022     * <p><b>Full capability</b> -
2023     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2024     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2025     *
2026     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2027     * @see CaptureRequest#SENSOR_SENSITIVITY
2028     */
2029    @PublicKey
2030    public static final Key<android.util.Range<Integer>> SENSOR_INFO_SENSITIVITY_RANGE =
2031            new Key<android.util.Range<Integer>>("android.sensor.info.sensitivityRange", new TypeReference<android.util.Range<Integer>>() {{ }});
2032
2033    /**
2034     * <p>The arrangement of color filters on sensor;
2035     * represents the colors in the top-left 2x2 section of
2036     * the sensor, in reading order.</p>
2037     * <p><b>Possible values:</b>
2038     * <ul>
2039     *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB RGGB}</li>
2040     *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG GRBG}</li>
2041     *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG GBRG}</li>
2042     *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR BGGR}</li>
2043     *   <li>{@link #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB RGB}</li>
2044     * </ul></p>
2045     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2046     * <p><b>Full capability</b> -
2047     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2048     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2049     *
2050     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2051     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB
2052     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG
2053     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GBRG
2054     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_BGGR
2055     * @see #SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB
2056     */
2057    @PublicKey
2058    public static final Key<Integer> SENSOR_INFO_COLOR_FILTER_ARRANGEMENT =
2059            new Key<Integer>("android.sensor.info.colorFilterArrangement", int.class);
2060
2061    /**
2062     * <p>The range of image exposure times for {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime} supported
2063     * by this camera device.</p>
2064     * <p><b>Units</b>: Nanoseconds</p>
2065     * <p><b>Range of valid values:</b><br>
2066     * The minimum exposure time will be less than 100 us. For FULL
2067     * capability devices ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL),
2068     * the maximum exposure time will be greater than 100ms.</p>
2069     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2070     * <p><b>Full capability</b> -
2071     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2072     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2073     *
2074     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2075     * @see CaptureRequest#SENSOR_EXPOSURE_TIME
2076     */
2077    @PublicKey
2078    public static final Key<android.util.Range<Long>> SENSOR_INFO_EXPOSURE_TIME_RANGE =
2079            new Key<android.util.Range<Long>>("android.sensor.info.exposureTimeRange", new TypeReference<android.util.Range<Long>>() {{ }});
2080
2081    /**
2082     * <p>The maximum possible frame duration (minimum frame rate) for
2083     * {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} that is supported this camera device.</p>
2084     * <p>Attempting to use frame durations beyond the maximum will result in the frame
2085     * duration being clipped to the maximum. See that control for a full definition of frame
2086     * durations.</p>
2087     * <p>Refer to {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration }
2088     * for the minimum frame duration values.</p>
2089     * <p><b>Units</b>: Nanoseconds</p>
2090     * <p><b>Range of valid values:</b><br>
2091     * For FULL capability devices
2092     * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL), at least 100ms.</p>
2093     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2094     * <p><b>Full capability</b> -
2095     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2096     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2097     *
2098     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2099     * @see CaptureRequest#SENSOR_FRAME_DURATION
2100     */
2101    @PublicKey
2102    public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
2103            new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
2104
2105    /**
2106     * <p>The physical dimensions of the full pixel
2107     * array.</p>
2108     * <p>This is the physical size of the sensor pixel
2109     * array defined by {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2110     * <p><b>Units</b>: Millimeters</p>
2111     * <p>This key is available on all devices.</p>
2112     *
2113     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2114     */
2115    @PublicKey
2116    public static final Key<android.util.SizeF> SENSOR_INFO_PHYSICAL_SIZE =
2117            new Key<android.util.SizeF>("android.sensor.info.physicalSize", android.util.SizeF.class);
2118
2119    /**
2120     * <p>Dimensions of the full pixel array, possibly
2121     * including black calibration pixels.</p>
2122     * <p>The pixel count of the full pixel array of the image sensor, which covers
2123     * {@link CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE android.sensor.info.physicalSize} area.  This represents the full pixel dimensions of
2124     * the raw buffers produced by this sensor.</p>
2125     * <p>If a camera device supports raw sensor formats, either this or
2126     * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is the maximum dimensions for the raw
2127     * output formats listed in {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap} (this depends on
2128     * whether or not the image sensor returns buffers containing pixels that are not
2129     * part of the active array region for blacklevel calibration or other purposes).</p>
2130     * <p>Some parts of the full pixel array may not receive light from the scene,
2131     * or be otherwise inactive.  The {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} key
2132     * defines the rectangle of active pixels that will be included in processed image
2133     * formats.</p>
2134     * <p><b>Units</b>: Pixels</p>
2135     * <p>This key is available on all devices.</p>
2136     *
2137     * @see CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP
2138     * @see CameraCharacteristics#SENSOR_INFO_PHYSICAL_SIZE
2139     * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2140     */
2141    @PublicKey
2142    public static final Key<android.util.Size> SENSOR_INFO_PIXEL_ARRAY_SIZE =
2143            new Key<android.util.Size>("android.sensor.info.pixelArraySize", android.util.Size.class);
2144
2145    /**
2146     * <p>Maximum raw value output by sensor.</p>
2147     * <p>This specifies the fully-saturated encoding level for the raw
2148     * sample values from the sensor.  This is typically caused by the
2149     * sensor becoming highly non-linear or clipping. The minimum for
2150     * each channel is specified by the offset in the
2151     * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} key.</p>
2152     * <p>The white level is typically determined either by sensor bit depth
2153     * (8-14 bits is expected), or by the point where the sensor response
2154     * becomes too non-linear to be useful.  The default value for this is
2155     * maximum representable value for a 16-bit raw sample (2^16 - 1).</p>
2156     * <p><b>Range of valid values:</b><br>
2157     * &gt; 255 (8-bit output)</p>
2158     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2159     *
2160     * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN
2161     */
2162    @PublicKey
2163    public static final Key<Integer> SENSOR_INFO_WHITE_LEVEL =
2164            new Key<Integer>("android.sensor.info.whiteLevel", int.class);
2165
2166    /**
2167     * <p>The time base source for sensor capture start timestamps.</p>
2168     * <p>The timestamps provided for captures are always in nanoseconds and monotonic, but
2169     * may not based on a time source that can be compared to other system time sources.</p>
2170     * <p>This characteristic defines the source for the timestamps, and therefore whether they
2171     * can be compared against other system time sources/timestamps.</p>
2172     * <p><b>Possible values:</b>
2173     * <ul>
2174     *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN UNKNOWN}</li>
2175     *   <li>{@link #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME REALTIME}</li>
2176     * </ul></p>
2177     * <p>This key is available on all devices.</p>
2178     * @see #SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN
2179     * @see #SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME
2180     */
2181    @PublicKey
2182    public static final Key<Integer> SENSOR_INFO_TIMESTAMP_SOURCE =
2183            new Key<Integer>("android.sensor.info.timestampSource", int.class);
2184
2185    /**
2186     * <p>Whether the RAW images output from this camera device are subject to
2187     * lens shading correction.</p>
2188     * <p>If TRUE, all images produced by the camera device in the RAW image formats will
2189     * have lens shading correction already applied to it. If FALSE, the images will
2190     * not be adjusted for lens shading correction.
2191     * See {@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW android.request.maxNumOutputRaw} for a list of RAW image formats.</p>
2192     * <p>This key will be <code>null</code> for all devices do not report this information.
2193     * Devices with RAW capability will always report this information in this key.</p>
2194     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2195     *
2196     * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_RAW
2197     */
2198    @PublicKey
2199    public static final Key<Boolean> SENSOR_INFO_LENS_SHADING_APPLIED =
2200            new Key<Boolean>("android.sensor.info.lensShadingApplied", boolean.class);
2201
2202    /**
2203     * <p>The area of the image sensor which corresponds to active pixels prior to the
2204     * application of any geometric distortion correction.</p>
2205     * <p>This is the rectangle representing the size of the active region of the sensor (i.e.
2206     * the region that actually receives light from the scene) before any geometric correction
2207     * has been applied, and should be treated as the active region rectangle for any of the
2208     * raw formats.  All metadata associated with raw processing (e.g. the lens shading
2209     * correction map, and radial distortion fields) treats the top, left of this rectangle as
2210     * the origin, (0,0).</p>
2211     * <p>The size of this region determines the maximum field of view and the maximum number of
2212     * pixels that an image from this sensor can contain, prior to the application of
2213     * geometric distortion correction. The effective maximum pixel dimensions of a
2214     * post-distortion-corrected image is given by the {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}
2215     * field, and the effective maximum field of view for a post-distortion-corrected image
2216     * can be calculated by applying the geometric distortion correction fields to this
2217     * rectangle, and cropping to the rectangle given in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2218     * <p>E.g. to calculate position of a pixel, (x,y), in a processed YUV output image with the
2219     * dimensions in {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} given the position of a pixel,
2220     * (x', y'), in the raw pixel array with dimensions give in
2221     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}:</p>
2222     * <ol>
2223     * <li>Choose a pixel (x', y') within the active array region of the raw buffer given in
2224     * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize}, otherwise this pixel is considered
2225     * to be outside of the FOV, and will not be shown in the processed output image.</li>
2226     * <li>Apply geometric distortion correction to get the post-distortion pixel coordinate,
2227     * (x_i, y_i). When applying geometric correction metadata, note that metadata for raw
2228     * buffers is defined relative to the top, left of the
2229     * {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} rectangle.</li>
2230     * <li>If the resulting corrected pixel coordinate is within the region given in
2231     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}, then the position of this pixel in the
2232     * processed output image buffer is <code>(x_i - activeArray.left, y_i - activeArray.top)</code>,
2233     * when the top, left coordinate of that buffer is treated as (0, 0).</li>
2234     * </ol>
2235     * <p>Thus, for pixel x',y' = (25, 25) on a sensor where {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}
2236     * is (100,100), {@link CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE android.sensor.info.preCorrectionActiveArraySize} is (10, 10, 100, 100),
2237     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize} is (20, 20, 80, 80), and the geometric distortion
2238     * correction doesn't change the pixel coordinate, the resulting pixel selected in
2239     * pixel coordinates would be x,y = (25, 25) relative to the top,left of the raw buffer
2240     * with dimensions given in {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}, and would be (5, 5)
2241     * relative to the top,left of post-processed YUV output buffer with dimensions given in
2242     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2243     * <p>The currently supported fields that correct for geometric distortion are:</p>
2244     * <ol>
2245     * <li>android.lens.radialDistortion.</li>
2246     * </ol>
2247     * <p>If all of the geometric distortion fields are no-ops, this rectangle will be the same
2248     * as the post-distortion-corrected rectangle given in
2249     * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}.</p>
2250     * <p>This rectangle is defined relative to the full pixel array; (0,0) is the top-left of
2251     * the full pixel array, and the size of the full pixel array is given by
2252     * {@link CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE android.sensor.info.pixelArraySize}.</p>
2253     * <p>The pre-correction active array may be smaller than the full pixel array, since the
2254     * full array may include black calibration pixels or other inactive regions.</p>
2255     * <p><b>Units</b>: Pixel coordinates on the image sensor</p>
2256     * <p>This key is available on all devices.</p>
2257     *
2258     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
2259     * @see CameraCharacteristics#SENSOR_INFO_PIXEL_ARRAY_SIZE
2260     * @see CameraCharacteristics#SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE
2261     */
2262    @PublicKey
2263    public static final Key<android.graphics.Rect> SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE =
2264            new Key<android.graphics.Rect>("android.sensor.info.preCorrectionActiveArraySize", android.graphics.Rect.class);
2265
2266    /**
2267     * <p>The standard reference illuminant used as the scene light source when
2268     * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
2269     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2270     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} matrices.</p>
2271     * <p>The values in this key correspond to the values defined for the
2272     * EXIF LightSource tag. These illuminants are standard light sources
2273     * that are often used calibrating camera devices.</p>
2274     * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM1 android.sensor.colorTransform1},
2275     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1 android.sensor.calibrationTransform1}, and
2276     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX1 android.sensor.forwardMatrix1} will also be present.</p>
2277     * <p>Some devices may choose to provide a second set of calibration
2278     * information for improved quality, including
2279     * {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2} and its corresponding matrices.</p>
2280     * <p><b>Possible values:</b>
2281     * <ul>
2282     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT DAYLIGHT}</li>
2283     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT FLUORESCENT}</li>
2284     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN TUNGSTEN}</li>
2285     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FLASH FLASH}</li>
2286     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER FINE_WEATHER}</li>
2287     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER CLOUDY_WEATHER}</li>
2288     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_SHADE SHADE}</li>
2289     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT DAYLIGHT_FLUORESCENT}</li>
2290     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT DAY_WHITE_FLUORESCENT}</li>
2291     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT COOL_WHITE_FLUORESCENT}</li>
2292     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT WHITE_FLUORESCENT}</li>
2293     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A STANDARD_A}</li>
2294     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B STANDARD_B}</li>
2295     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C STANDARD_C}</li>
2296     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D55 D55}</li>
2297     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D65 D65}</li>
2298     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D75 D75}</li>
2299     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_D50 D50}</li>
2300     *   <li>{@link #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN ISO_STUDIO_TUNGSTEN}</li>
2301     * </ul></p>
2302     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2303     *
2304     * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM1
2305     * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM1
2306     * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX1
2307     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2308     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT
2309     * @see #SENSOR_REFERENCE_ILLUMINANT1_FLUORESCENT
2310     * @see #SENSOR_REFERENCE_ILLUMINANT1_TUNGSTEN
2311     * @see #SENSOR_REFERENCE_ILLUMINANT1_FLASH
2312     * @see #SENSOR_REFERENCE_ILLUMINANT1_FINE_WEATHER
2313     * @see #SENSOR_REFERENCE_ILLUMINANT1_CLOUDY_WEATHER
2314     * @see #SENSOR_REFERENCE_ILLUMINANT1_SHADE
2315     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAYLIGHT_FLUORESCENT
2316     * @see #SENSOR_REFERENCE_ILLUMINANT1_DAY_WHITE_FLUORESCENT
2317     * @see #SENSOR_REFERENCE_ILLUMINANT1_COOL_WHITE_FLUORESCENT
2318     * @see #SENSOR_REFERENCE_ILLUMINANT1_WHITE_FLUORESCENT
2319     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_A
2320     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_B
2321     * @see #SENSOR_REFERENCE_ILLUMINANT1_STANDARD_C
2322     * @see #SENSOR_REFERENCE_ILLUMINANT1_D55
2323     * @see #SENSOR_REFERENCE_ILLUMINANT1_D65
2324     * @see #SENSOR_REFERENCE_ILLUMINANT1_D75
2325     * @see #SENSOR_REFERENCE_ILLUMINANT1_D50
2326     * @see #SENSOR_REFERENCE_ILLUMINANT1_ISO_STUDIO_TUNGSTEN
2327     */
2328    @PublicKey
2329    public static final Key<Integer> SENSOR_REFERENCE_ILLUMINANT1 =
2330            new Key<Integer>("android.sensor.referenceIlluminant1", int.class);
2331
2332    /**
2333     * <p>The standard reference illuminant used as the scene light source when
2334     * calculating the {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
2335     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2336     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} matrices.</p>
2337     * <p>See {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1} for more details.</p>
2338     * <p>If this key is present, then {@link CameraCharacteristics#SENSOR_COLOR_TRANSFORM2 android.sensor.colorTransform2},
2339     * {@link CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2 android.sensor.calibrationTransform2}, and
2340     * {@link CameraCharacteristics#SENSOR_FORWARD_MATRIX2 android.sensor.forwardMatrix2} will also be present.</p>
2341     * <p><b>Range of valid values:</b><br>
2342     * Any value listed in {@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}</p>
2343     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2344     *
2345     * @see CameraCharacteristics#SENSOR_CALIBRATION_TRANSFORM2
2346     * @see CameraCharacteristics#SENSOR_COLOR_TRANSFORM2
2347     * @see CameraCharacteristics#SENSOR_FORWARD_MATRIX2
2348     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2349     */
2350    @PublicKey
2351    public static final Key<Byte> SENSOR_REFERENCE_ILLUMINANT2 =
2352            new Key<Byte>("android.sensor.referenceIlluminant2", byte.class);
2353
2354    /**
2355     * <p>A per-device calibration transform matrix that maps from the
2356     * reference sensor colorspace to the actual device sensor colorspace.</p>
2357     * <p>This matrix is used to correct for per-device variations in the
2358     * sensor colorspace, and is used for processing raw buffer data.</p>
2359     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2360     * contains a per-device calibration transform that maps colors
2361     * from reference sensor color space (i.e. the "golden module"
2362     * colorspace) into this camera device's native sensor color
2363     * space under the first reference illuminant
2364     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2365     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2366     *
2367     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2368     */
2369    @PublicKey
2370    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM1 =
2371            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
2372
2373    /**
2374     * <p>A per-device calibration transform matrix that maps from the
2375     * reference sensor colorspace to the actual device sensor colorspace
2376     * (this is the colorspace of the raw buffer data).</p>
2377     * <p>This matrix is used to correct for per-device variations in the
2378     * sensor colorspace, and is used for processing raw buffer data.</p>
2379     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2380     * contains a per-device calibration transform that maps colors
2381     * from reference sensor color space (i.e. the "golden module"
2382     * colorspace) into this camera device's native sensor color
2383     * space under the second reference illuminant
2384     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2385     * <p>This matrix will only be present if the second reference
2386     * illuminant is present.</p>
2387     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2388     *
2389     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2390     */
2391    @PublicKey
2392    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_CALIBRATION_TRANSFORM2 =
2393            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.calibrationTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
2394
2395    /**
2396     * <p>A matrix that transforms color values from CIE XYZ color space to
2397     * reference sensor color space.</p>
2398     * <p>This matrix is used to convert from the standard CIE XYZ color
2399     * space to the reference sensor colorspace, and is used when processing
2400     * raw buffer data.</p>
2401     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2402     * contains a color transform matrix that maps colors from the CIE
2403     * XYZ color space to the reference sensor color space (i.e. the
2404     * "golden module" colorspace) under the first reference illuminant
2405     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1}).</p>
2406     * <p>The white points chosen in both the reference sensor color space
2407     * and the CIE XYZ colorspace when calculating this transform will
2408     * match the standard white point for the first reference illuminant
2409     * (i.e. no chromatic adaptation will be applied by this transform).</p>
2410     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2411     *
2412     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2413     */
2414    @PublicKey
2415    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM1 =
2416            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform1", android.hardware.camera2.params.ColorSpaceTransform.class);
2417
2418    /**
2419     * <p>A matrix that transforms color values from CIE XYZ color space to
2420     * reference sensor color space.</p>
2421     * <p>This matrix is used to convert from the standard CIE XYZ color
2422     * space to the reference sensor colorspace, and is used when processing
2423     * raw buffer data.</p>
2424     * <p>The matrix is expressed as a 3x3 matrix in row-major-order, and
2425     * contains a color transform matrix that maps colors from the CIE
2426     * XYZ color space to the reference sensor color space (i.e. the
2427     * "golden module" colorspace) under the second reference illuminant
2428     * ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2}).</p>
2429     * <p>The white points chosen in both the reference sensor color space
2430     * and the CIE XYZ colorspace when calculating this transform will
2431     * match the standard white point for the second reference illuminant
2432     * (i.e. no chromatic adaptation will be applied by this transform).</p>
2433     * <p>This matrix will only be present if the second reference
2434     * illuminant is present.</p>
2435     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2436     *
2437     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2438     */
2439    @PublicKey
2440    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_COLOR_TRANSFORM2 =
2441            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.colorTransform2", android.hardware.camera2.params.ColorSpaceTransform.class);
2442
2443    /**
2444     * <p>A matrix that transforms white balanced camera colors from the reference
2445     * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2446     * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2447     * is used when processing raw buffer data.</p>
2448     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2449     * a color transform matrix that maps white balanced colors from the
2450     * reference sensor color space to the CIE XYZ color space with a D50 white
2451     * point.</p>
2452     * <p>Under the first reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1 android.sensor.referenceIlluminant1})
2453     * this matrix is chosen so that the standard white point for this reference
2454     * illuminant in the reference sensor colorspace is mapped to D50 in the
2455     * CIE XYZ colorspace.</p>
2456     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2457     *
2458     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT1
2459     */
2460    @PublicKey
2461    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX1 =
2462            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix1", android.hardware.camera2.params.ColorSpaceTransform.class);
2463
2464    /**
2465     * <p>A matrix that transforms white balanced camera colors from the reference
2466     * sensor colorspace to the CIE XYZ colorspace with a D50 whitepoint.</p>
2467     * <p>This matrix is used to convert to the standard CIE XYZ colorspace, and
2468     * is used when processing raw buffer data.</p>
2469     * <p>This matrix is expressed as a 3x3 matrix in row-major-order, and contains
2470     * a color transform matrix that maps white balanced colors from the
2471     * reference sensor color space to the CIE XYZ color space with a D50 white
2472     * point.</p>
2473     * <p>Under the second reference illuminant ({@link CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2 android.sensor.referenceIlluminant2})
2474     * this matrix is chosen so that the standard white point for this reference
2475     * illuminant in the reference sensor colorspace is mapped to D50 in the
2476     * CIE XYZ colorspace.</p>
2477     * <p>This matrix will only be present if the second reference
2478     * illuminant is present.</p>
2479     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2480     *
2481     * @see CameraCharacteristics#SENSOR_REFERENCE_ILLUMINANT2
2482     */
2483    @PublicKey
2484    public static final Key<android.hardware.camera2.params.ColorSpaceTransform> SENSOR_FORWARD_MATRIX2 =
2485            new Key<android.hardware.camera2.params.ColorSpaceTransform>("android.sensor.forwardMatrix2", android.hardware.camera2.params.ColorSpaceTransform.class);
2486
2487    /**
2488     * <p>A fixed black level offset for each of the color filter arrangement
2489     * (CFA) mosaic channels.</p>
2490     * <p>This key specifies the zero light value for each of the CFA mosaic
2491     * channels in the camera sensor.  The maximal value output by the
2492     * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.</p>
2493     * <p>The values are given in the same order as channels listed for the CFA
2494     * layout key (see {@link CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT android.sensor.info.colorFilterArrangement}), i.e. the
2495     * nth value given corresponds to the black level offset for the nth
2496     * color channel listed in the CFA.</p>
2497     * <p><b>Range of valid values:</b><br>
2498     * &gt;= 0 for each.</p>
2499     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2500     *
2501     * @see CameraCharacteristics#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
2502     * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL
2503     */
2504    @PublicKey
2505    public static final Key<android.hardware.camera2.params.BlackLevelPattern> SENSOR_BLACK_LEVEL_PATTERN =
2506            new Key<android.hardware.camera2.params.BlackLevelPattern>("android.sensor.blackLevelPattern", android.hardware.camera2.params.BlackLevelPattern.class);
2507
2508    /**
2509     * <p>Maximum sensitivity that is implemented
2510     * purely through analog gain.</p>
2511     * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
2512     * equal to this, all applied gain must be analog. For
2513     * values above this, the gain applied can be a mix of analog and
2514     * digital.</p>
2515     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2516     * <p><b>Full capability</b> -
2517     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2518     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2519     *
2520     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2521     * @see CaptureRequest#SENSOR_SENSITIVITY
2522     */
2523    @PublicKey
2524    public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
2525            new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
2526
2527    /**
2528     * <p>Clockwise angle through which the output image needs to be rotated to be
2529     * upright on the device screen in its native orientation.</p>
2530     * <p>Also defines the direction of rolling shutter readout, which is from top to bottom in
2531     * the sensor's coordinate system.</p>
2532     * <p><b>Units</b>: Degrees of clockwise rotation; always a multiple of
2533     * 90</p>
2534     * <p><b>Range of valid values:</b><br>
2535     * 0, 90, 180, 270</p>
2536     * <p>This key is available on all devices.</p>
2537     */
2538    @PublicKey
2539    public static final Key<Integer> SENSOR_ORIENTATION =
2540            new Key<Integer>("android.sensor.orientation", int.class);
2541
2542    /**
2543     * <p>List of sensor test pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}
2544     * supported by this camera device.</p>
2545     * <p>Defaults to OFF, and always includes OFF if defined.</p>
2546     * <p><b>Range of valid values:</b><br>
2547     * Any value listed in {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}</p>
2548     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2549     *
2550     * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE
2551     */
2552    @PublicKey
2553    public static final Key<int[]> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
2554            new Key<int[]>("android.sensor.availableTestPatternModes", int[].class);
2555
2556    /**
2557     * <p>List of lens shading modes for {@link CaptureRequest#SHADING_MODE android.shading.mode} that are supported by this camera device.</p>
2558     * <p>This list contains lens shading modes that can be set for the camera device.
2559     * Camera devices that support the MANUAL_POST_PROCESSING capability will always
2560     * list OFF and FAST mode. This includes all FULL level devices.
2561     * LEGACY devices will always only support FAST mode.</p>
2562     * <p><b>Range of valid values:</b><br>
2563     * Any value listed in {@link CaptureRequest#SHADING_MODE android.shading.mode}</p>
2564     * <p>This key is available on all devices.</p>
2565     *
2566     * @see CaptureRequest#SHADING_MODE
2567     */
2568    @PublicKey
2569    public static final Key<int[]> SHADING_AVAILABLE_MODES =
2570            new Key<int[]>("android.shading.availableModes", int[].class);
2571
2572    /**
2573     * <p>List of face detection modes for {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode} that are
2574     * supported by this camera device.</p>
2575     * <p>OFF is always supported.</p>
2576     * <p><b>Range of valid values:</b><br>
2577     * Any value listed in {@link CaptureRequest#STATISTICS_FACE_DETECT_MODE android.statistics.faceDetectMode}</p>
2578     * <p>This key is available on all devices.</p>
2579     *
2580     * @see CaptureRequest#STATISTICS_FACE_DETECT_MODE
2581     */
2582    @PublicKey
2583    public static final Key<int[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
2584            new Key<int[]>("android.statistics.info.availableFaceDetectModes", int[].class);
2585
2586    /**
2587     * <p>The maximum number of simultaneously detectable
2588     * faces.</p>
2589     * <p><b>Range of valid values:</b><br>
2590     * 0 for cameras without available face detection; otherwise:
2591     * <code>&gt;=4</code> for LIMITED or FULL hwlevel devices or
2592     * <code>&gt;0</code> for LEGACY devices.</p>
2593     * <p>This key is available on all devices.</p>
2594     */
2595    @PublicKey
2596    public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
2597            new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
2598
2599    /**
2600     * <p>List of hot pixel map output modes for {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode} that are
2601     * supported by this camera device.</p>
2602     * <p>If no hotpixel map output is available for this camera device, this will contain only
2603     * <code>false</code>.</p>
2604     * <p>ON is always supported on devices with the RAW capability.</p>
2605     * <p><b>Range of valid values:</b><br>
2606     * Any value listed in {@link CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE android.statistics.hotPixelMapMode}</p>
2607     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2608     *
2609     * @see CaptureRequest#STATISTICS_HOT_PIXEL_MAP_MODE
2610     */
2611    @PublicKey
2612    public static final Key<boolean[]> STATISTICS_INFO_AVAILABLE_HOT_PIXEL_MAP_MODES =
2613            new Key<boolean[]>("android.statistics.info.availableHotPixelMapModes", boolean[].class);
2614
2615    /**
2616     * <p>List of lens shading map output modes for {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} that
2617     * are supported by this camera device.</p>
2618     * <p>If no lens shading map output is available for this camera device, this key will
2619     * contain only OFF.</p>
2620     * <p>ON is always supported on devices with the RAW capability.
2621     * LEGACY mode devices will always only support OFF.</p>
2622     * <p><b>Range of valid values:</b><br>
2623     * Any value listed in {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode}</p>
2624     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2625     *
2626     * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE
2627     */
2628    @PublicKey
2629    public static final Key<int[]> STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES =
2630            new Key<int[]>("android.statistics.info.availableLensShadingMapModes", int[].class);
2631
2632    /**
2633     * <p>Maximum number of supported points in the
2634     * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}.</p>
2635     * <p>If the actual number of points provided by the application (in {@link CaptureRequest#TONEMAP_CURVE android.tonemap.curve}*) is
2636     * less than this maximum, the camera device will resample the curve to its internal
2637     * representation, using linear interpolation.</p>
2638     * <p>The output curves in the result metadata may have a different number
2639     * of points than the input curves, and will represent the actual
2640     * hardware curves used as closely as possible when linearly interpolated.</p>
2641     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2642     * <p><b>Full capability</b> -
2643     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2644     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2645     *
2646     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2647     * @see CaptureRequest#TONEMAP_CURVE
2648     */
2649    @PublicKey
2650    public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
2651            new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
2652
2653    /**
2654     * <p>List of tonemapping modes for {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode} that are supported by this camera
2655     * device.</p>
2656     * <p>Camera devices that support the MANUAL_POST_PROCESSING capability will always contain
2657     * at least one of below mode combinations:</p>
2658     * <ul>
2659     * <li>CONTRAST_CURVE, FAST and HIGH_QUALITY</li>
2660     * <li>GAMMA_VALUE, PRESET_CURVE, FAST and HIGH_QUALITY</li>
2661     * </ul>
2662     * <p>This includes all FULL level devices.</p>
2663     * <p><b>Range of valid values:</b><br>
2664     * Any value listed in {@link CaptureRequest#TONEMAP_MODE android.tonemap.mode}</p>
2665     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2666     * <p><b>Full capability</b> -
2667     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
2668     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2669     *
2670     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2671     * @see CaptureRequest#TONEMAP_MODE
2672     */
2673    @PublicKey
2674    public static final Key<int[]> TONEMAP_AVAILABLE_TONE_MAP_MODES =
2675            new Key<int[]>("android.tonemap.availableToneMapModes", int[].class);
2676
2677    /**
2678     * <p>A list of camera LEDs that are available on this system.</p>
2679     * <p><b>Possible values:</b>
2680     * <ul>
2681     *   <li>{@link #LED_AVAILABLE_LEDS_TRANSMIT TRANSMIT}</li>
2682     * </ul></p>
2683     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2684     * @see #LED_AVAILABLE_LEDS_TRANSMIT
2685     * @hide
2686     */
2687    public static final Key<int[]> LED_AVAILABLE_LEDS =
2688            new Key<int[]>("android.led.availableLeds", int[].class);
2689
2690    /**
2691     * <p>Generally classifies the overall set of the camera device functionality.</p>
2692     * <p>Camera devices will come in three flavors: LEGACY, LIMITED and FULL.</p>
2693     * <p>A FULL device will support below capabilities:</p>
2694     * <ul>
2695     * <li>BURST_CAPTURE capability ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains BURST_CAPTURE)</li>
2696     * <li>Per frame control ({@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} <code>==</code> PER_FRAME_CONTROL)</li>
2697     * <li>Manual sensor control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains MANUAL_SENSOR)</li>
2698     * <li>Manual post-processing control ({@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains
2699     *   MANUAL_POST_PROCESSING)</li>
2700     * <li>At least 3 processed (but not stalling) format output streams
2701     *   ({@link CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_PROC android.request.maxNumOutputProc} <code>&gt;=</code> 3)</li>
2702     * <li>The required stream configurations defined in android.scaler.availableStreamConfigurations</li>
2703     * <li>The required exposure time range defined in {@link CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE android.sensor.info.exposureTimeRange}</li>
2704     * <li>The required maxFrameDuration defined in {@link CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION android.sensor.info.maxFrameDuration}</li>
2705     * </ul>
2706     * <p>A LIMITED device may have some or none of the above characteristics.
2707     * To find out more refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.</p>
2708     * <p>Some features are not part of any particular hardware level or capability and must be
2709     * queried separately. These include:</p>
2710     * <ul>
2711     * <li>Calibrated timestamps ({@link CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE android.sensor.info.timestampSource} <code>==</code> REALTIME)</li>
2712     * <li>Precision lens control ({@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} <code>==</code> CALIBRATED)</li>
2713     * <li>Face detection ({@link CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes})</li>
2714     * <li>Optical or electrical image stabilization
2715     *   ({@link CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION android.lens.info.availableOpticalStabilization},
2716     *    {@link CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES android.control.availableVideoStabilizationModes})</li>
2717     * </ul>
2718     * <p>A LEGACY device does not support per-frame control, manual sensor control, manual
2719     * post-processing, arbitrary cropping regions, and has relaxed performance constraints.</p>
2720     * <p>Each higher level supports everything the lower level supports
2721     * in this order: FULL <code>&gt;</code> LIMITED <code>&gt;</code> LEGACY.</p>
2722     * <p>Note:
2723     * Pre-API level 23, FULL devices also supported arbitrary cropping region
2724     * ({@link CameraCharacteristics#SCALER_CROPPING_TYPE android.scaler.croppingType} <code>==</code> FREEFORM); this requirement was relaxed in API level 23,
2725     * and FULL devices may only support CENTERED cropping.</p>
2726     * <p><b>Possible values:</b>
2727     * <ul>
2728     *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED}</li>
2729     *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL}</li>
2730     *   <li>{@link #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY}</li>
2731     * </ul></p>
2732     * <p>This key is available on all devices.</p>
2733     *
2734     * @see CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES
2735     * @see CameraCharacteristics#LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION
2736     * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION
2737     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2738     * @see CameraCharacteristics#REQUEST_MAX_NUM_OUTPUT_PROC
2739     * @see CameraCharacteristics#SCALER_CROPPING_TYPE
2740     * @see CameraCharacteristics#SENSOR_INFO_EXPOSURE_TIME_RANGE
2741     * @see CameraCharacteristics#SENSOR_INFO_MAX_FRAME_DURATION
2742     * @see CameraCharacteristics#SENSOR_INFO_TIMESTAMP_SOURCE
2743     * @see CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES
2744     * @see CameraCharacteristics#SYNC_MAX_LATENCY
2745     * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
2746     * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
2747     * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY
2748     */
2749    @PublicKey
2750    public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
2751            new Key<Integer>("android.info.supportedHardwareLevel", int.class);
2752
2753    /**
2754     * <p>The maximum number of frames that can occur after a request
2755     * (different than the previous) has been submitted, and before the
2756     * result's state becomes synchronized.</p>
2757     * <p>This defines the maximum distance (in number of metadata results),
2758     * between the frame number of the request that has new controls to apply
2759     * and the frame number of the result that has all the controls applied.</p>
2760     * <p>In other words this acts as an upper boundary for how many frames
2761     * must occur before the camera device knows for a fact that the new
2762     * submitted camera settings have been applied in outgoing frames.</p>
2763     * <p><b>Units</b>: Frame counts</p>
2764     * <p><b>Possible values:</b>
2765     * <ul>
2766     *   <li>{@link #SYNC_MAX_LATENCY_PER_FRAME_CONTROL PER_FRAME_CONTROL}</li>
2767     *   <li>{@link #SYNC_MAX_LATENCY_UNKNOWN UNKNOWN}</li>
2768     * </ul></p>
2769     * <p><b>Available values for this device:</b><br>
2770     * A positive value, PER_FRAME_CONTROL, or UNKNOWN.</p>
2771     * <p>This key is available on all devices.</p>
2772     * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
2773     * @see #SYNC_MAX_LATENCY_UNKNOWN
2774     */
2775    @PublicKey
2776    public static final Key<Integer> SYNC_MAX_LATENCY =
2777            new Key<Integer>("android.sync.maxLatency", int.class);
2778
2779    /**
2780     * <p>The maximal camera capture pipeline stall (in unit of frame count) introduced by a
2781     * reprocess capture request.</p>
2782     * <p>The key describes the maximal interference that one reprocess (input) request
2783     * can introduce to the camera simultaneous streaming of regular (output) capture
2784     * requests, including repeating requests.</p>
2785     * <p>When a reprocessing capture request is submitted while a camera output repeating request
2786     * (e.g. preview) is being served by the camera device, it may preempt the camera capture
2787     * pipeline for at least one frame duration so that the camera device is unable to process
2788     * the following capture request in time for the next sensor start of exposure boundary.
2789     * When this happens, the application may observe a capture time gap (longer than one frame
2790     * duration) between adjacent capture output frames, which usually exhibits as preview
2791     * glitch if the repeating request output targets include a preview surface. This key gives
2792     * the worst-case number of frame stall introduced by one reprocess request with any kind of
2793     * formats/sizes combination.</p>
2794     * <p>If this key reports 0, it means a reprocess request doesn't introduce any glitch to the
2795     * ongoing camera repeating request outputs, as if this reprocess request is never issued.</p>
2796     * <p>This key is supported if the camera device supports PRIVATE or YUV reprocessing (
2797     * i.e. {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} contains PRIVATE_REPROCESSING or
2798     * YUV_REPROCESSING).</p>
2799     * <p><b>Units</b>: Number of frames.</p>
2800     * <p><b>Range of valid values:</b><br>
2801     * &lt;= 4</p>
2802     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2803     * <p><b>Limited capability</b> -
2804     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2805     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2806     *
2807     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2808     * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES
2809     */
2810    @PublicKey
2811    public static final Key<Integer> REPROCESS_MAX_CAPTURE_STALL =
2812            new Key<Integer>("android.reprocess.maxCaptureStall", int.class);
2813
2814    /**
2815     * <p>The available depth dataspace stream
2816     * configurations that this camera device supports
2817     * (i.e. format, width, height, output/input stream).</p>
2818     * <p>These are output stream configurations for use with
2819     * dataSpace HAL_DATASPACE_DEPTH. The configurations are
2820     * listed as <code>(format, width, height, input?)</code> tuples.</p>
2821     * <p>Only devices that support depth output for at least
2822     * the HAL_PIXEL_FORMAT_Y16 dense depth map may include
2823     * this entry.</p>
2824     * <p>A device that also supports the HAL_PIXEL_FORMAT_BLOB
2825     * sparse depth point cloud must report a single entry for
2826     * the format in this list as <code>(HAL_PIXEL_FORMAT_BLOB,
2827     * android.depth.maxDepthSamples, 1, OUTPUT)</code> in addition to
2828     * the entries for HAL_PIXEL_FORMAT_Y16.</p>
2829     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2830     * <p><b>Limited capability</b> -
2831     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2832     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2833     *
2834     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2835     * @hide
2836     */
2837    public static final Key<android.hardware.camera2.params.StreamConfiguration[]> DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS =
2838            new Key<android.hardware.camera2.params.StreamConfiguration[]>("android.depth.availableDepthStreamConfigurations", android.hardware.camera2.params.StreamConfiguration[].class);
2839
2840    /**
2841     * <p>This lists the minimum frame duration for each
2842     * format/size combination for depth output formats.</p>
2843     * <p>This should correspond to the frame duration when only that
2844     * stream is active, with all processing (typically in android.*.mode)
2845     * set to either OFF or FAST.</p>
2846     * <p>When multiple streams are used in a request, the minimum frame
2847     * duration will be max(individual stream min durations).</p>
2848     * <p>The minimum frame duration of a stream (of a particular format, size)
2849     * is the same regardless of whether the stream is input or output.</p>
2850     * <p>See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and
2851     * android.scaler.availableStallDurations for more details about
2852     * calculating the max frame rate.</p>
2853     * <p>(Keep in sync with {@link android.hardware.camera2.params.StreamConfigurationMap#getOutputMinFrameDuration })</p>
2854     * <p><b>Units</b>: (format, width, height, ns) x n</p>
2855     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2856     * <p><b>Limited capability</b> -
2857     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2858     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2859     *
2860     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2861     * @see CaptureRequest#SENSOR_FRAME_DURATION
2862     * @hide
2863     */
2864    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS =
2865            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthMinFrameDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2866
2867    /**
2868     * <p>This lists the maximum stall duration for each
2869     * output format/size combination for depth streams.</p>
2870     * <p>A stall duration is how much extra time would get added
2871     * to the normal minimum frame duration for a repeating request
2872     * that has streams with non-zero stall.</p>
2873     * <p>This functions similarly to
2874     * android.scaler.availableStallDurations for depth
2875     * streams.</p>
2876     * <p>All depth output stream formats may have a nonzero stall
2877     * duration.</p>
2878     * <p><b>Units</b>: (format, width, height, ns) x n</p>
2879     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2880     * <p><b>Limited capability</b> -
2881     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2882     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2883     *
2884     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2885     * @hide
2886     */
2887    public static final Key<android.hardware.camera2.params.StreamConfigurationDuration[]> DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS =
2888            new Key<android.hardware.camera2.params.StreamConfigurationDuration[]>("android.depth.availableDepthStallDurations", android.hardware.camera2.params.StreamConfigurationDuration[].class);
2889
2890    /**
2891     * <p>Indicates whether a capture request may target both a
2892     * DEPTH16 / DEPTH_POINT_CLOUD output, and normal color outputs (such as
2893     * YUV_420_888, JPEG, or RAW) simultaneously.</p>
2894     * <p>If TRUE, including both depth and color outputs in a single
2895     * capture request is not supported. An application must interleave color
2896     * and depth requests.  If FALSE, a single request can target both types
2897     * of output.</p>
2898     * <p>Typically, this restriction exists on camera devices that
2899     * need to emit a specific pattern or wavelength of light to
2900     * measure depth values, which causes the color image to be
2901     * corrupted during depth measurement.</p>
2902     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
2903     * <p><b>Limited capability</b> -
2904     * Present on all camera devices that report being at least {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED HARDWARE_LEVEL_LIMITED} devices in the
2905     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
2906     *
2907     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
2908     */
2909    @PublicKey
2910    public static final Key<Boolean> DEPTH_DEPTH_IS_EXCLUSIVE =
2911            new Key<Boolean>("android.depth.depthIsExclusive", boolean.class);
2912
2913    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
2914     * End generated code
2915     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
2916
2917
2918
2919}
2920