CameraCharacteristics.java revision ca1b73a5f4e8ae4a7cef2cb2127024d0ddb9e0e0
1/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.camera2;
18
19import android.hardware.camera2.impl.CameraMetadataNative;
20
21import java.util.Collections;
22import java.util.List;
23
24/**
25 * <p>The properties describing a
26 * {@link CameraDevice CameraDevice}.</p>
27 *
28 * <p>These properties are fixed for a given CameraDevice, and can be queried
29 * through the {@link CameraManager CameraManager}
30 * interface in addition to through the CameraDevice interface.</p>
31 *
32 * @see CameraDevice
33 * @see CameraManager
34 */
35public final class CameraCharacteristics extends CameraMetadata {
36
37    private final CameraMetadataNative mProperties;
38    private List<Key<?>> mAvailableRequestKeys;
39    private List<Key<?>> mAvailableResultKeys;
40
41    /**
42     * Takes ownership of the passed-in properties object
43     * @hide
44     */
45    public CameraCharacteristics(CameraMetadataNative properties) {
46        mProperties = properties;
47    }
48
49    @Override
50    public <T> T get(Key<T> key) {
51        return mProperties.get(key);
52    }
53
54    /**
55     * Returns the list of keys supported by this {@link CameraDevice} for querying
56     * with a {@link CaptureRequest}.
57     *
58     * <p>The list returned is not modifiable, so any attempts to modify it will throw
59     * a {@code UnsupportedOperationException}.</p>
60     *
61     * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
62     *
63     * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
64     * {@link #getKeys()} instead.</p>
65     *
66     * @return List of keys supported by this CameraDevice for CaptureRequests.
67     */
68    public List<Key<?>> getAvailableCaptureRequestKeys() {
69        if (mAvailableRequestKeys == null) {
70            mAvailableRequestKeys = getAvailableKeyList(CaptureRequest.class);
71        }
72        return mAvailableRequestKeys;
73    }
74
75    /**
76     * Returns the list of keys supported by this {@link CameraDevice} for querying
77     * with a {@link CaptureResult}.
78     *
79     * <p>The list returned is not modifiable, so any attempts to modify it will throw
80     * a {@code UnsupportedOperationException}.</p>
81     *
82     * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
83     *
84     * <p>Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use
85     * {@link #getKeys()} instead.</p>
86     *
87     * @return List of keys supported by this CameraDevice for CaptureResults.
88     */
89    public List<Key<?>> getAvailableCaptureResultKeys() {
90        if (mAvailableResultKeys == null) {
91            mAvailableResultKeys = getAvailableKeyList(CaptureResult.class);
92        }
93        return mAvailableResultKeys;
94    }
95
96    /**
97     * Returns the list of keys supported by this {@link CameraDevice} by metadataClass.
98     *
99     * <p>The list returned is not modifiable, so any attempts to modify it will throw
100     * a {@code UnsupportedOperationException}.</p>
101     *
102     * <p>Each key is only listed once in the list. The order of the keys is undefined.</p>
103     *
104     * @param metadataClass The subclass of CameraMetadata that you want to get the keys for.
105     *
106     * @return List of keys supported by this CameraDevice for metadataClass.
107     *
108     * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata
109     */
110    private <T extends CameraMetadata> List<Key<?>> getAvailableKeyList(Class<T> metadataClass) {
111
112        if (metadataClass.equals(CameraMetadata.class)) {
113            throw new AssertionError(
114                    "metadataClass must be a strict subclass of CameraMetadata");
115        } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) {
116            throw new AssertionError(
117                    "metadataClass must be a subclass of CameraMetadata");
118        }
119
120        return Collections.unmodifiableList(getKeysStatic(metadataClass, /*instance*/null));
121    }
122
123    /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
124     * The key entries below this point are generated from metadata
125     * definitions in /system/media/camera/docs. Do not modify by hand or
126     * modify the comment blocks at the start or end.
127     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/
128
129
130    /**
131     * <p>The set of auto-exposure antibanding modes that are
132     * supported by this camera device.</p>
133     * <p>Not all of the auto-exposure anti-banding modes may be
134     * supported by a given camera device. This field lists the
135     * valid anti-banding modes that the application may request
136     * for this camera device; they must include AUTO.</p>
137     */
138    public static final Key<byte[]> CONTROL_AE_AVAILABLE_ANTIBANDING_MODES =
139            new Key<byte[]>("android.control.aeAvailableAntibandingModes", byte[].class);
140
141    /**
142     * <p>The set of auto-exposure modes that are supported by this
143     * camera device.</p>
144     * <p>Not all the auto-exposure modes may be supported by a
145     * given camera device, especially if no flash unit is
146     * available. This entry lists the valid modes for
147     * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.</p>
148     * <p>All camera devices support ON, and all camera devices with
149     * flash units support ON_AUTO_FLASH and
150     * ON_ALWAYS_FLASH.</p>
151     * <p>Full-capability camera devices always support OFF mode,
152     * which enables application control of camera exposure time,
153     * sensitivity, and frame duration.</p>
154     *
155     * @see CaptureRequest#CONTROL_AE_MODE
156     */
157    public static final Key<byte[]> CONTROL_AE_AVAILABLE_MODES =
158            new Key<byte[]>("android.control.aeAvailableModes", byte[].class);
159
160    /**
161     * <p>List of frame rate ranges supported by the
162     * AE algorithm/hardware</p>
163     */
164    public static final Key<int[]> CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES =
165            new Key<int[]>("android.control.aeAvailableTargetFpsRanges", int[].class);
166
167    /**
168     * <p>Maximum and minimum exposure compensation
169     * setting, in counts of
170     * android.control.aeCompensationStepSize</p>
171     */
172    public static final Key<int[]> CONTROL_AE_COMPENSATION_RANGE =
173            new Key<int[]>("android.control.aeCompensationRange", int[].class);
174
175    /**
176     * <p>Smallest step by which exposure compensation
177     * can be changed</p>
178     */
179    public static final Key<Rational> CONTROL_AE_COMPENSATION_STEP =
180            new Key<Rational>("android.control.aeCompensationStep", Rational.class);
181
182    /**
183     * <p>List of AF modes that can be
184     * selected with {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.</p>
185     * <p>Not all the auto-focus modes may be supported by a
186     * given camera device. This entry lists the valid modes for
187     * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.</p>
188     * <p>All camera devices will support OFF mode, and all camera devices with
189     * adjustable focuser units (<code>{@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} &gt; 0</code>)
190     * will support AUTO mode.</p>
191     *
192     * @see CaptureRequest#CONTROL_AF_MODE
193     * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE
194     */
195    public static final Key<byte[]> CONTROL_AF_AVAILABLE_MODES =
196            new Key<byte[]>("android.control.afAvailableModes", byte[].class);
197
198    /**
199     * <p>List containing the subset of color effects
200     * specified in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that is supported by
201     * this device.</p>
202     * <p>This list contains the color effect modes that can be applied to
203     * images produced by the camera device. Only modes that have
204     * been fully implemented for the current device may be included here.
205     * Implementations are not expected to be consistent across all devices.
206     * If no color effect modes are available for a device, this should
207     * simply be set to OFF.</p>
208     * <p>A color effect will only be applied if
209     * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.</p>
210     *
211     * @see CaptureRequest#CONTROL_EFFECT_MODE
212     * @see CaptureRequest#CONTROL_MODE
213     */
214    public static final Key<byte[]> CONTROL_AVAILABLE_EFFECTS =
215            new Key<byte[]>("android.control.availableEffects", byte[].class);
216
217    /**
218     * <p>List containing a subset of scene modes
219     * specified in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}.</p>
220     * <p>This list contains scene modes that can be set for the camera device.
221     * Only scene modes that have been fully implemented for the
222     * camera device may be included here. Implementations are not expected
223     * to be consistent across all devices. If no scene modes are supported
224     * by the camera device, this will be set to <code>[DISABLED]</code>.</p>
225     *
226     * @see CaptureRequest#CONTROL_SCENE_MODE
227     */
228    public static final Key<byte[]> CONTROL_AVAILABLE_SCENE_MODES =
229            new Key<byte[]>("android.control.availableSceneModes", byte[].class);
230
231    /**
232     * <p>List of video stabilization modes that can
233     * be supported</p>
234     */
235    public static final Key<byte[]> CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES =
236            new Key<byte[]>("android.control.availableVideoStabilizationModes", byte[].class);
237
238    /**
239     * <p>The set of auto-white-balance modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode})
240     * that are supported by this camera device.</p>
241     * <p>Not all the auto-white-balance modes may be supported by a
242     * given camera device. This entry lists the valid modes for
243     * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.</p>
244     * <p>All camera devices will support ON mode.</p>
245     * <p>Full-capability camera devices will always support OFF mode,
246     * which enables application control of white balance, by using
247     * {@link CaptureRequest#COLOR_CORRECTION_TRANSFORM android.colorCorrection.transform} and {@link CaptureRequest#COLOR_CORRECTION_GAINS android.colorCorrection.gains}({@link CaptureRequest#COLOR_CORRECTION_MODE android.colorCorrection.mode} must be set to TRANSFORM_MATRIX).</p>
248     *
249     * @see CaptureRequest#COLOR_CORRECTION_GAINS
250     * @see CaptureRequest#COLOR_CORRECTION_MODE
251     * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM
252     * @see CaptureRequest#CONTROL_AWB_MODE
253     */
254    public static final Key<byte[]> CONTROL_AWB_AVAILABLE_MODES =
255            new Key<byte[]>("android.control.awbAvailableModes", byte[].class);
256
257    /**
258     * <p>For AE, AWB, and AF, how many individual
259     * regions can be listed for metering?</p>
260     */
261    public static final Key<Integer> CONTROL_MAX_REGIONS =
262            new Key<Integer>("android.control.maxRegions", int.class);
263
264    /**
265     * <p>Whether this camera device has a
266     * flash.</p>
267     * <p>If no flash, none of the flash controls do
268     * anything. All other metadata should return 0.</p>
269     */
270    public static final Key<Boolean> FLASH_INFO_AVAILABLE =
271            new Key<Boolean>("android.flash.info.available", boolean.class);
272
273    /**
274     * <p>Supported resolutions for the JPEG thumbnail</p>
275     * <p>Below condiditions will be satisfied for this size list:</p>
276     * <ul>
277     * <li>The sizes will be sorted by increasing pixel area (width x height).
278     * If several resolutions have the same area, they will be sorted by increasing width.</li>
279     * <li>The aspect ratio of the largest thumbnail size will be same as the
280     * aspect ratio of largest size in {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES android.scaler.availableJpegSizes}.
281     * The largest size is defined as the size that has the largest pixel area
282     * in a given size list.</li>
283     * <li>Each size in {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES android.scaler.availableJpegSizes} will have at least
284     * one corresponding size that has the same aspect ratio in availableThumbnailSizes,
285     * and vice versa.</li>
286     * <li>All non (0, 0) sizes will have non-zero widths and heights.</li>
287     * </ul>
288     *
289     * @see CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES
290     */
291    public static final Key<android.hardware.camera2.Size[]> JPEG_AVAILABLE_THUMBNAIL_SIZES =
292            new Key<android.hardware.camera2.Size[]>("android.jpeg.availableThumbnailSizes", android.hardware.camera2.Size[].class);
293
294    /**
295     * <p>List of supported aperture
296     * values.</p>
297     * <p>If the camera device doesn't support variable apertures,
298     * listed value will be the fixed aperture.</p>
299     * <p>If the camera device supports variable apertures, the aperture value
300     * in this list will be sorted in ascending order.</p>
301     */
302    public static final Key<float[]> LENS_INFO_AVAILABLE_APERTURES =
303            new Key<float[]>("android.lens.info.availableApertures", float[].class);
304
305    /**
306     * <p>List of supported neutral density filter values for
307     * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity}.</p>
308     * <p>If changing {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} is not supported,
309     * availableFilterDensities must contain only 0. Otherwise, this
310     * list contains only the exact filter density values available on
311     * this camera device.</p>
312     *
313     * @see CaptureRequest#LENS_FILTER_DENSITY
314     */
315    public static final Key<float[]> LENS_INFO_AVAILABLE_FILTER_DENSITIES =
316            new Key<float[]>("android.lens.info.availableFilterDensities", float[].class);
317
318    /**
319     * <p>The available focal lengths for this device for use with
320     * {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}.</p>
321     * <p>If optical zoom is not supported, this will only report
322     * a single value corresponding to the static focal length of the
323     * device. Otherwise, this will report every focal length supported
324     * by the device.</p>
325     *
326     * @see CaptureRequest#LENS_FOCAL_LENGTH
327     */
328    public static final Key<float[]> LENS_INFO_AVAILABLE_FOCAL_LENGTHS =
329            new Key<float[]>("android.lens.info.availableFocalLengths", float[].class);
330
331    /**
332     * <p>List containing a subset of the optical image
333     * stabilization (OIS) modes specified in
334     * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}.</p>
335     * <p>If OIS is not implemented for a given camera device, this should
336     * contain only OFF.</p>
337     *
338     * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE
339     */
340    public static final Key<byte[]> LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION =
341            new Key<byte[]>("android.lens.info.availableOpticalStabilization", byte[].class);
342
343    /**
344     * <p>Hyperfocal distance for this lens; set to
345     * 0 if fixed focus</p>
346     * <p>The hyperfocal distance is used for the old
347     * API's 'fixed' setting</p>
348     */
349    public static final Key<Float> LENS_INFO_HYPERFOCAL_DISTANCE =
350            new Key<Float>("android.lens.info.hyperfocalDistance", float.class);
351
352    /**
353     * <p>Shortest distance from frontmost surface
354     * of the lens that can be focused correctly</p>
355     * <p>If the lens is fixed-focus, this should be
356     * 0</p>
357     */
358    public static final Key<Float> LENS_INFO_MINIMUM_FOCUS_DISTANCE =
359            new Key<Float>("android.lens.info.minimumFocusDistance", float.class);
360
361    /**
362     * <p>Dimensions of lens shading map.</p>
363     * <p>The map should be on the order of 30-40 rows and columns, and
364     * must be smaller than 64x64.</p>
365     */
366    public static final Key<android.hardware.camera2.Size> LENS_INFO_SHADING_MAP_SIZE =
367            new Key<android.hardware.camera2.Size>("android.lens.info.shadingMapSize", android.hardware.camera2.Size.class);
368
369    /**
370     * <p>Direction the camera faces relative to
371     * device screen</p>
372     * @see #LENS_FACING_FRONT
373     * @see #LENS_FACING_BACK
374     */
375    public static final Key<Integer> LENS_FACING =
376            new Key<Integer>("android.lens.facing", int.class);
377
378    /**
379     * <p>If set to 1, the HAL will always split result
380     * metadata for a single capture into multiple buffers,
381     * returned using multiple process_capture_result calls.</p>
382     * <p>Does not need to be listed in static
383     * metadata. Support for partial results will be reworked in
384     * future versions of camera service. This quirk will stop
385     * working at that point; DO NOT USE without careful
386     * consideration of future support.</p>
387     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
388     * @hide
389     */
390    public static final Key<Byte> QUIRKS_USE_PARTIAL_RESULT =
391            new Key<Byte>("android.quirks.usePartialResult", byte.class);
392
393    /**
394     * <p>How many output streams can be allocated at
395     * the same time for each type of stream</p>
396     * <p>Video snapshot with preview callbacks requires 3
397     * processed streams (preview, record, app callbacks) and
398     * one JPEG stream (snapshot)</p>
399     */
400    public static final Key<int[]> REQUEST_MAX_NUM_OUTPUT_STREAMS =
401            new Key<int[]>("android.request.maxNumOutputStreams", int[].class);
402
403    /**
404     * <p>Specifies the number of maximum pipeline stages a frame
405     * has to go through from when it's exposed to when it's available
406     * to the framework.</p>
407     * <p>A typical minimum value for this is 2 (one stage to expose,
408     * one stage to readout) from the sensor. The ISP then usually adds
409     * its own stages to do custom HW processing. Further stages may be
410     * added by SW processing.</p>
411     * <p>Depending on what settings are used (e.g. YUV, JPEG) and what
412     * processing is enabled (e.g. face detection), the actual pipeline
413     * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than
414     * the max pipeline depth.</p>
415     * <p>A pipeline depth of X stages is equivalent to a pipeline latency of
416     * X frame intervals.</p>
417     * <p>This value will be 8 or less.</p>
418     *
419     * @see CaptureResult#REQUEST_PIPELINE_DEPTH
420     */
421    public static final Key<Byte> REQUEST_PIPELINE_MAX_DEPTH =
422            new Key<Byte>("android.request.pipelineMaxDepth", byte.class);
423
424    /**
425     * <p>Optional. Defaults to 1. Defines how many sub-components
426     * a result will be composed of.</p>
427     * <p>In order to combat the pipeline latency, partial results
428     * may be delivered to the application layer from the camera device as
429     * soon as they are available.</p>
430     * <p>A value of 1 means that partial results are not supported.</p>
431     * <p>A typical use case for this might be: after requesting an AF lock the
432     * new AF state might be available 50% of the way through the pipeline.
433     * The camera device could then immediately dispatch this state via a
434     * partial result to the framework/application layer, and the rest of
435     * the metadata via later partial results.</p>
436     */
437    public static final Key<Integer> REQUEST_PARTIAL_RESULT_COUNT =
438            new Key<Integer>("android.request.partialResultCount", int.class);
439
440    /**
441     * <p>The list of image formats that are supported by this
442     * camera device.</p>
443     * <p>All camera devices will support JPEG and YUV_420_888 formats.</p>
444     * <p>When set to YUV_420_888, application can access the YUV420 data directly.</p>
445     */
446    public static final Key<int[]> SCALER_AVAILABLE_FORMATS =
447            new Key<int[]>("android.scaler.availableFormats", int[].class);
448
449    /**
450     * <p>The minimum frame duration that is supported
451     * for each resolution in {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES android.scaler.availableJpegSizes}.</p>
452     * <p>This corresponds to the minimum steady-state frame duration when only
453     * that JPEG stream is active and captured in a burst, with all
454     * processing (typically in android.*.mode) set to FAST.</p>
455     * <p>When multiple streams are configured, the minimum
456     * frame duration will be &gt;= max(individual stream min
457     * durations)</p>
458     *
459     * @see CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES
460     */
461    public static final Key<long[]> SCALER_AVAILABLE_JPEG_MIN_DURATIONS =
462            new Key<long[]>("android.scaler.availableJpegMinDurations", long[].class);
463
464    /**
465     * <p>The JPEG resolutions that are supported by this camera device.</p>
466     * <p>The resolutions are listed as <code>(width, height)</code> pairs. All camera devices will support
467     * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).</p>
468     *
469     * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE
470     */
471    public static final Key<android.hardware.camera2.Size[]> SCALER_AVAILABLE_JPEG_SIZES =
472            new Key<android.hardware.camera2.Size[]>("android.scaler.availableJpegSizes", android.hardware.camera2.Size[].class);
473
474    /**
475     * <p>The maximum ratio between active area width
476     * and crop region width, or between active area height and
477     * crop region height, if the crop region height is larger
478     * than width</p>
479     */
480    public static final Key<Float> SCALER_AVAILABLE_MAX_DIGITAL_ZOOM =
481            new Key<Float>("android.scaler.availableMaxDigitalZoom", float.class);
482
483    /**
484     * <p>For each available processed output size (defined in
485     * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES android.scaler.availableProcessedSizes}), this property lists the
486     * minimum supportable frame duration for that size.</p>
487     * <p>This should correspond to the frame duration when only that processed
488     * stream is active, with all processing (typically in android.*.mode)
489     * set to FAST.</p>
490     * <p>When multiple streams are configured, the minimum frame duration will
491     * be &gt;= max(individual stream min durations).</p>
492     *
493     * @see CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES
494     */
495    public static final Key<long[]> SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS =
496            new Key<long[]>("android.scaler.availableProcessedMinDurations", long[].class);
497
498    /**
499     * <p>The resolutions available for use with
500     * processed output streams, such as YV12, NV12, and
501     * platform opaque YUV/RGB streams to the GPU or video
502     * encoders.</p>
503     * <p>The resolutions are listed as <code>(width, height)</code> pairs.</p>
504     * <p>For a given use case, the actual maximum supported resolution
505     * may be lower than what is listed here, depending on the destination
506     * Surface for the image data. For example, for recording video,
507     * the video encoder chosen may have a maximum size limit (e.g. 1080p)
508     * smaller than what the camera (e.g. maximum resolution is 3264x2448)
509     * can provide.</p>
510     * <p>Please reference the documentation for the image data destination to
511     * check if it limits the maximum size for image data.</p>
512     */
513    public static final Key<android.hardware.camera2.Size[]> SCALER_AVAILABLE_PROCESSED_SIZES =
514            new Key<android.hardware.camera2.Size[]>("android.scaler.availableProcessedSizes", android.hardware.camera2.Size[].class);
515
516    /**
517     * <p>Area of raw data which corresponds to only
518     * active pixels.</p>
519     * <p>It is smaller or equal to
520     * sensor full pixel array, which could include the black calibration pixels.</p>
521     */
522    public static final Key<android.graphics.Rect> SENSOR_INFO_ACTIVE_ARRAY_SIZE =
523            new Key<android.graphics.Rect>("android.sensor.info.activeArraySize", android.graphics.Rect.class);
524
525    /**
526     * <p>Range of valid sensitivities</p>
527     */
528    public static final Key<int[]> SENSOR_INFO_SENSITIVITY_RANGE =
529            new Key<int[]>("android.sensor.info.sensitivityRange", int[].class);
530
531    /**
532     * <p>Range of valid exposure
533     * times</p>
534     */
535    public static final Key<long[]> SENSOR_INFO_EXPOSURE_TIME_RANGE =
536            new Key<long[]>("android.sensor.info.exposureTimeRange", long[].class);
537
538    /**
539     * <p>Maximum possible frame duration (minimum frame
540     * rate)</p>
541     * <p>Minimum duration is a function of resolution,
542     * processing settings. See
543     * android.scaler.availableProcessedMinDurations
544     * android.scaler.availableJpegMinDurations
545     * android.scaler.availableRawMinDurations</p>
546     */
547    public static final Key<Long> SENSOR_INFO_MAX_FRAME_DURATION =
548            new Key<Long>("android.sensor.info.maxFrameDuration", long.class);
549
550    /**
551     * <p>The physical dimensions of the full pixel
552     * array</p>
553     * <p>Needed for FOV calculation for old API</p>
554     */
555    public static final Key<float[]> SENSOR_INFO_PHYSICAL_SIZE =
556            new Key<float[]>("android.sensor.info.physicalSize", float[].class);
557
558    /**
559     * <p>Gain factor from electrons to raw units when
560     * ISO=100</p>
561     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
562     * <p><b>Full capability</b> -
563     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
564     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
565     *
566     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
567     */
568    public static final Key<Rational> SENSOR_BASE_GAIN_FACTOR =
569            new Key<Rational>("android.sensor.baseGainFactor", Rational.class);
570
571    /**
572     * <p>Maximum sensitivity that is implemented
573     * purely through analog gain.</p>
574     * <p>For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or
575     * equal to this, all applied gain must be analog. For
576     * values above this, the gain applied can be a mix of analog and
577     * digital.</p>
578     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
579     * <p><b>Full capability</b> -
580     * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the
581     * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key</p>
582     *
583     * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL
584     * @see CaptureRequest#SENSOR_SENSITIVITY
585     */
586    public static final Key<Integer> SENSOR_MAX_ANALOG_SENSITIVITY =
587            new Key<Integer>("android.sensor.maxAnalogSensitivity", int.class);
588
589    /**
590     * <p>Clockwise angle through which the output
591     * image needs to be rotated to be upright on the device
592     * screen in its native orientation. Also defines the
593     * direction of rolling shutter readout, which is from top
594     * to bottom in the sensor's coordinate system</p>
595     */
596    public static final Key<Integer> SENSOR_ORIENTATION =
597            new Key<Integer>("android.sensor.orientation", int.class);
598
599    /**
600     * <p>Optional. Defaults to [OFF]. Lists the supported test
601     * pattern modes for android.test.patternMode.</p>
602     * <p><b>Optional</b> - This value may be {@code null} on some devices.</p>
603     */
604    public static final Key<Byte> SENSOR_AVAILABLE_TEST_PATTERN_MODES =
605            new Key<Byte>("android.sensor.availableTestPatternModes", byte.class);
606
607    /**
608     * <p>Which face detection modes are available,
609     * if any</p>
610     * <p>OFF means face detection is disabled, it must
611     * be included in the list.</p>
612     * <p>SIMPLE means the device supports the
613     * android.statistics.faceRectangles and
614     * android.statistics.faceScores outputs.</p>
615     * <p>FULL means the device additionally supports the
616     * android.statistics.faceIds and
617     * android.statistics.faceLandmarks outputs.</p>
618     */
619    public static final Key<byte[]> STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES =
620            new Key<byte[]>("android.statistics.info.availableFaceDetectModes", byte[].class);
621
622    /**
623     * <p>Maximum number of simultaneously detectable
624     * faces</p>
625     */
626    public static final Key<Integer> STATISTICS_INFO_MAX_FACE_COUNT =
627            new Key<Integer>("android.statistics.info.maxFaceCount", int.class);
628
629    /**
630     * <p>Maximum number of supported points in the
631     * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed}, or
632     * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, or {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}.</p>
633     * <p>If the actual number of points provided by the application (in
634     * android.tonemap.curve*)  is less than max, the camera device will
635     * resample the curve to its internal representation, using linear
636     * interpolation.</p>
637     * <p>The output curves in the result metadata may have a different number
638     * of points than the input curves, and will represent the actual
639     * hardware curves used as closely as possible when linearly interpolated.</p>
640     *
641     * @see CaptureRequest#TONEMAP_CURVE_BLUE
642     * @see CaptureRequest#TONEMAP_CURVE_GREEN
643     * @see CaptureRequest#TONEMAP_CURVE_RED
644     */
645    public static final Key<Integer> TONEMAP_MAX_CURVE_POINTS =
646            new Key<Integer>("android.tonemap.maxCurvePoints", int.class);
647
648    /**
649     * <p>A list of camera LEDs that are available on this system.</p>
650     * @see #LED_AVAILABLE_LEDS_TRANSMIT
651     * @hide
652     */
653    public static final Key<int[]> LED_AVAILABLE_LEDS =
654            new Key<int[]>("android.led.availableLeds", int[].class);
655
656    /**
657     * <p>The camera 3 HAL device can implement one of two possible
658     * operational modes; limited and full. Full support is
659     * expected from new higher-end devices. Limited mode has
660     * hardware requirements roughly in line with those for a
661     * camera HAL device v1 implementation, and is expected from
662     * older or inexpensive devices. Full is a strict superset of
663     * limited, and they share the same essential operational flow.</p>
664     * <p>For full details refer to "S3. Operational Modes" in camera3.h</p>
665     * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
666     * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL
667     */
668    public static final Key<Integer> INFO_SUPPORTED_HARDWARE_LEVEL =
669            new Key<Integer>("android.info.supportedHardwareLevel", int.class);
670
671    /**
672     * <p>The maximum number of frames that can occur after a request
673     * (different than the previous) has been submitted, and before the
674     * result's state becomes synchronized (by setting
675     * android.sync.frameNumber to a non-negative value).</p>
676     * <p>This defines the maximum distance (in number of metadata results),
677     * between android.sync.frameNumber and the equivalent
678     * android.request.frameCount.</p>
679     * <p>In other words this acts as an upper boundary for how many frames
680     * must occur before the camera device knows for a fact that the new
681     * submitted camera settings have been applied in outgoing frames.</p>
682     * <p>For example if the distance was 2,</p>
683     * <pre><code>initial request = X (repeating)
684     * request1 = X
685     * request2 = Y
686     * request3 = Y
687     * request4 = Y
688     *
689     * where requestN has frameNumber N, and the first of the repeating
690     * initial request's has frameNumber F (and F &lt; 1).
691     *
692     * initial result = X' + { android.sync.frameNumber == F }
693     * result1 = X' + { android.sync.frameNumber == F }
694     * result2 = X' + { android.sync.frameNumber == CONVERGING }
695     * result3 = X' + { android.sync.frameNumber == CONVERGING }
696     * result4 = X' + { android.sync.frameNumber == 2 }
697     *
698     * where resultN has frameNumber N.
699     * </code></pre>
700     * <p>Since <code>result4</code> has a <code>frameNumber == 4</code> and
701     * <code>android.sync.frameNumber == 2</code>, the distance is clearly
702     * <code>4 - 2 = 2</code>.</p>
703     * @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL
704     * @see #SYNC_MAX_LATENCY_UNKNOWN
705     */
706    public static final Key<Integer> SYNC_MAX_LATENCY =
707            new Key<Integer>("android.sync.maxLatency", int.class);
708
709    /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~
710     * End generated code
711     *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/
712}
713