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