/* * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.hardware.camera2; import android.hardware.camera2.impl.CameraMetadataNative; import java.util.Collections; import java.util.List; /** *

The properties describing a * {@link CameraDevice CameraDevice}.

* *

These properties are fixed for a given CameraDevice, and can be queried * through the {@link CameraManager CameraManager} * interface in addition to through the CameraDevice interface.

* * @see CameraDevice * @see CameraManager */ public final class CameraCharacteristics extends CameraMetadata { private final CameraMetadataNative mProperties; private List> mAvailableRequestKeys; private List> mAvailableResultKeys; /** * Takes ownership of the passed-in properties object * @hide */ public CameraCharacteristics(CameraMetadataNative properties) { mProperties = properties; } @Override public T get(Key key) { return mProperties.get(key); } /** * Returns the list of keys supported by this {@link CameraDevice} for querying * with a {@link CaptureRequest}. * *

The list returned is not modifiable, so any attempts to modify it will throw * a {@code UnsupportedOperationException}.

* *

Each key is only listed once in the list. The order of the keys is undefined.

* *

Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use * {@link #getKeys()} instead.

* * @return List of keys supported by this CameraDevice for CaptureRequests. */ public List> getAvailableCaptureRequestKeys() { if (mAvailableRequestKeys == null) { mAvailableRequestKeys = getAvailableKeyList(CaptureRequest.class); } return mAvailableRequestKeys; } /** * Returns the list of keys supported by this {@link CameraDevice} for querying * with a {@link CaptureResult}. * *

The list returned is not modifiable, so any attempts to modify it will throw * a {@code UnsupportedOperationException}.

* *

Each key is only listed once in the list. The order of the keys is undefined.

* *

Note that there is no {@code getAvailableCameraCharacteristicsKeys()} -- use * {@link #getKeys()} instead.

* * @return List of keys supported by this CameraDevice for CaptureResults. */ public List> getAvailableCaptureResultKeys() { if (mAvailableResultKeys == null) { mAvailableResultKeys = getAvailableKeyList(CaptureResult.class); } return mAvailableResultKeys; } /** * Returns the list of keys supported by this {@link CameraDevice} by metadataClass. * *

The list returned is not modifiable, so any attempts to modify it will throw * a {@code UnsupportedOperationException}.

* *

Each key is only listed once in the list. The order of the keys is undefined.

* * @param metadataClass The subclass of CameraMetadata that you want to get the keys for. * * @return List of keys supported by this CameraDevice for metadataClass. * * @throws IllegalArgumentException if metadataClass is not a subclass of CameraMetadata */ private List> getAvailableKeyList(Class metadataClass) { if (metadataClass.equals(CameraMetadata.class)) { throw new AssertionError( "metadataClass must be a strict subclass of CameraMetadata"); } else if (!CameraMetadata.class.isAssignableFrom(metadataClass)) { throw new AssertionError( "metadataClass must be a subclass of CameraMetadata"); } return Collections.unmodifiableList(getKeysStatic(metadataClass, /*instance*/null)); } /*@O~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * The key entries below this point are generated from metadata * definitions in /system/media/camera/docs. Do not modify by hand or * modify the comment blocks at the start or end. *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~*/ /** *

The set of auto-exposure antibanding modes that are * supported by this camera device.

*

Not all of the auto-exposure anti-banding modes may be * supported by a given camera device. This field lists the * valid anti-banding modes that the application may request * for this camera device; they must include AUTO.

*/ public static final Key CONTROL_AE_AVAILABLE_ANTIBANDING_MODES = new Key("android.control.aeAvailableAntibandingModes", byte[].class); /** *

The set of auto-exposure modes that are supported by this * camera device.

*

Not all the auto-exposure modes may be supported by a * given camera device, especially if no flash unit is * available. This entry lists the valid modes for * {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} for this camera device.

*

All camera devices support ON, and all camera devices with * flash units support ON_AUTO_FLASH and * ON_ALWAYS_FLASH.

*

Full-capability camera devices always support OFF mode, * which enables application control of camera exposure time, * sensitivity, and frame duration.

* * @see CaptureRequest#CONTROL_AE_MODE */ public static final Key CONTROL_AE_AVAILABLE_MODES = new Key("android.control.aeAvailableModes", byte[].class); /** *

List of frame rate ranges supported by the * AE algorithm/hardware

*/ public static final Key CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES = new Key("android.control.aeAvailableTargetFpsRanges", int[].class); /** *

Maximum and minimum exposure compensation * setting, in counts of * {@link CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP android.control.aeCompensationStep}.

* * @see CameraCharacteristics#CONTROL_AE_COMPENSATION_STEP */ public static final Key CONTROL_AE_COMPENSATION_RANGE = new Key("android.control.aeCompensationRange", int[].class); /** *

Smallest step by which exposure compensation * can be changed

*/ public static final Key CONTROL_AE_COMPENSATION_STEP = new Key("android.control.aeCompensationStep", Rational.class); /** *

List of AF modes that can be * selected with {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode}.

*

Not all the auto-focus modes may be supported by a * given camera device. This entry lists the valid modes for * {@link CaptureRequest#CONTROL_AF_MODE android.control.afMode} for this camera device.

*

All camera devices will support OFF mode, and all camera devices with * adjustable focuser units ({@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance} > 0) * will support AUTO mode.

* * @see CaptureRequest#CONTROL_AF_MODE * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE */ public static final Key CONTROL_AF_AVAILABLE_MODES = new Key("android.control.afAvailableModes", byte[].class); /** *

List containing the subset of color effects * specified in {@link CaptureRequest#CONTROL_EFFECT_MODE android.control.effectMode} that is supported by * this device.

*

This list contains the color effect modes that can be applied to * images produced by the camera device. Only modes that have * been fully implemented for the current device may be included here. * Implementations are not expected to be consistent across all devices. * If no color effect modes are available for a device, this should * simply be set to OFF.

*

A color effect will only be applied if * {@link CaptureRequest#CONTROL_MODE android.control.mode} != OFF.

* * @see CaptureRequest#CONTROL_EFFECT_MODE * @see CaptureRequest#CONTROL_MODE */ public static final Key CONTROL_AVAILABLE_EFFECTS = new Key("android.control.availableEffects", byte[].class); /** *

List containing a subset of scene modes * specified in {@link CaptureRequest#CONTROL_SCENE_MODE android.control.sceneMode}.

*

This list contains scene modes that can be set for the camera device. * Only scene modes that have been fully implemented for the * camera device may be included here. Implementations are not expected * to be consistent across all devices. If no scene modes are supported * by the camera device, this will be set to [DISABLED].

* * @see CaptureRequest#CONTROL_SCENE_MODE */ public static final Key CONTROL_AVAILABLE_SCENE_MODES = new Key("android.control.availableSceneModes", byte[].class); /** *

List of video stabilization modes that can * be supported

*/ public static final Key CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES = new Key("android.control.availableVideoStabilizationModes", byte[].class); /** *

The set of auto-white-balance modes ({@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode}) * that are supported by this camera device.

*

Not all the auto-white-balance modes may be supported by a * given camera device. This entry lists the valid modes for * {@link CaptureRequest#CONTROL_AWB_MODE android.control.awbMode} for this camera device.

*

All camera devices will support ON mode.

*

Full-capability camera devices will always support OFF mode, * which enables application control of white balance, by using * {@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).

* * @see CaptureRequest#COLOR_CORRECTION_GAINS * @see CaptureRequest#COLOR_CORRECTION_MODE * @see CaptureRequest#COLOR_CORRECTION_TRANSFORM * @see CaptureRequest#CONTROL_AWB_MODE */ public static final Key CONTROL_AWB_AVAILABLE_MODES = new Key("android.control.awbAvailableModes", byte[].class); /** *

List of the maximum number of regions that can be used for metering in * auto-exposure (AE), auto-white balance (AWB), and auto-focus (AF); * this corresponds to the the maximum number of elements in * {@link CaptureRequest#CONTROL_AE_REGIONS android.control.aeRegions}, {@link CaptureRequest#CONTROL_AWB_REGIONS android.control.awbRegions}, * and {@link CaptureRequest#CONTROL_AF_REGIONS android.control.afRegions}.

* * @see CaptureRequest#CONTROL_AE_REGIONS * @see CaptureRequest#CONTROL_AF_REGIONS * @see CaptureRequest#CONTROL_AWB_REGIONS */ public static final Key CONTROL_MAX_REGIONS = new Key("android.control.maxRegions", int[].class); /** *

Whether this camera device has a * flash.

*

If no flash, none of the flash controls do * anything. All other metadata should return 0.

*/ public static final Key FLASH_INFO_AVAILABLE = new Key("android.flash.info.available", boolean.class); /** *

Supported resolutions for the JPEG thumbnail

*

Below condiditions will be satisfied for this size list:

*
    *
  • The sizes will be sorted by increasing pixel area (width x height). * If several resolutions have the same area, they will be sorted by increasing width.
  • *
  • The aspect ratio of the largest thumbnail size will be same as the * aspect ratio of largest JPEG output size in {@link CameraCharacteristics#SCALER_AVAILABLE_STREAM_CONFIGURATIONS android.scaler.availableStreamConfigurations}. * The largest size is defined as the size that has the largest pixel area * in a given size list.
  • *
  • Each output JPEG size in {@link CameraCharacteristics#SCALER_AVAILABLE_STREAM_CONFIGURATIONS android.scaler.availableStreamConfigurations} will have at least * one corresponding size that has the same aspect ratio in availableThumbnailSizes, * and vice versa.
  • *
  • All non (0, 0) sizes will have non-zero widths and heights.
  • *
* * @see CameraCharacteristics#SCALER_AVAILABLE_STREAM_CONFIGURATIONS */ public static final Key JPEG_AVAILABLE_THUMBNAIL_SIZES = new Key("android.jpeg.availableThumbnailSizes", android.hardware.camera2.Size[].class); /** *

List of supported aperture * values.

*

If the camera device doesn't support variable apertures, * listed value will be the fixed aperture.

*

If the camera device supports variable apertures, the aperture value * in this list will be sorted in ascending order.

*/ public static final Key LENS_INFO_AVAILABLE_APERTURES = new Key("android.lens.info.availableApertures", float[].class); /** *

List of supported neutral density filter values for * {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity}.

*

If changing {@link CaptureRequest#LENS_FILTER_DENSITY android.lens.filterDensity} is not supported, * availableFilterDensities must contain only 0. Otherwise, this * list contains only the exact filter density values available on * this camera device.

* * @see CaptureRequest#LENS_FILTER_DENSITY */ public static final Key LENS_INFO_AVAILABLE_FILTER_DENSITIES = new Key("android.lens.info.availableFilterDensities", float[].class); /** *

The available focal lengths for this device for use with * {@link CaptureRequest#LENS_FOCAL_LENGTH android.lens.focalLength}.

*

If optical zoom is not supported, this will only report * a single value corresponding to the static focal length of the * device. Otherwise, this will report every focal length supported * by the device.

* * @see CaptureRequest#LENS_FOCAL_LENGTH */ public static final Key LENS_INFO_AVAILABLE_FOCAL_LENGTHS = new Key("android.lens.info.availableFocalLengths", float[].class); /** *

List containing a subset of the optical image * stabilization (OIS) modes specified in * {@link CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE android.lens.opticalStabilizationMode}.

*

If OIS is not implemented for a given camera device, this should * contain only OFF.

* * @see CaptureRequest#LENS_OPTICAL_STABILIZATION_MODE */ public static final Key LENS_INFO_AVAILABLE_OPTICAL_STABILIZATION = new Key("android.lens.info.availableOpticalStabilization", byte[].class); /** *

Optional. Hyperfocal distance for this lens.

*

If the lens is fixed focus, the camera device will report 0.

*

If the lens is not fixed focus, the camera device will report this * field when {@link CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION android.lens.info.focusDistanceCalibration} is APPROXIMATE or CALIBRATED.

*

Optional - This value may be {@code null} on some devices.

* * @see CameraCharacteristics#LENS_INFO_FOCUS_DISTANCE_CALIBRATION */ public static final Key LENS_INFO_HYPERFOCAL_DISTANCE = new Key("android.lens.info.hyperfocalDistance", float.class); /** *

Shortest distance from frontmost surface * of the lens that can be focused correctly.

*

If the lens is fixed-focus, this should be * 0.

*/ public static final Key LENS_INFO_MINIMUM_FOCUS_DISTANCE = new Key("android.lens.info.minimumFocusDistance", float.class); /** *

Dimensions of lens shading map.

*

The map should be on the order of 30-40 rows and columns, and * must be smaller than 64x64.

*/ public static final Key LENS_INFO_SHADING_MAP_SIZE = new Key("android.lens.info.shadingMapSize", android.hardware.camera2.Size.class); /** *

The lens focus distance calibration quality.

*

The lens focus distance calibration quality determines the reliability of * focus related metadata entries, i.e. {@link CaptureRequest#LENS_FOCUS_DISTANCE android.lens.focusDistance}, * {@link CaptureResult#LENS_FOCUS_RANGE android.lens.focusRange}, {@link CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE android.lens.info.hyperfocalDistance}, and * {@link CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE android.lens.info.minimumFocusDistance}.

* * @see CaptureRequest#LENS_FOCUS_DISTANCE * @see CaptureResult#LENS_FOCUS_RANGE * @see CameraCharacteristics#LENS_INFO_HYPERFOCAL_DISTANCE * @see CameraCharacteristics#LENS_INFO_MINIMUM_FOCUS_DISTANCE * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_UNCALIBRATED * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_APPROXIMATE * @see #LENS_INFO_FOCUS_DISTANCE_CALIBRATION_CALIBRATED */ public static final Key LENS_INFO_FOCUS_DISTANCE_CALIBRATION = new Key("android.lens.info.focusDistanceCalibration", int.class); /** *

Direction the camera faces relative to * device screen

* @see #LENS_FACING_FRONT * @see #LENS_FACING_BACK */ public static final Key LENS_FACING = new Key("android.lens.facing", int.class); /** *

If set to 1, the HAL will always split result * metadata for a single capture into multiple buffers, * returned using multiple process_capture_result calls.

*

Does not need to be listed in static * metadata. Support for partial results will be reworked in * future versions of camera service. This quirk will stop * working at that point; DO NOT USE without careful * consideration of future support.

*

Optional - This value may be {@code null} on some devices.

* @hide */ public static final Key QUIRKS_USE_PARTIAL_RESULT = new Key("android.quirks.usePartialResult", byte.class); /** *

The maximum numbers of different types of output streams * that can be configured and used simultaneously by a camera device.

*

This is a 3 element tuple that contains the max number of output simultaneous * streams for raw sensor, processed (and uncompressed), and JPEG formats respectively. * For example, if max raw sensor format output stream number is 1, max YUV streams * number is 3, and max JPEG stream number is 2, then this tuple should be (1, 3, 2).

*

This lists the upper bound of the number of output streams supported by * the camera device. Using more streams simultaneously may require more hardware and * CPU resources that will consume more power. The image format for a output stream can * be any supported format provided by {@link CameraCharacteristics#SCALER_AVAILABLE_FORMATS android.scaler.availableFormats}. The formats * defined in {@link CameraCharacteristics#SCALER_AVAILABLE_FORMATS android.scaler.availableFormats} can be catergorized into the 3 stream types * as below:

*
    *
  • JPEG-compressed format: BLOB.
  • *
  • Raw formats: RAW_SENSOR and RAW_OPAQUE.
  • *
  • processed, uncompressed formats: YCbCr_420_888, YCrCb_420_SP, YV12.
  • *
* * @see CameraCharacteristics#SCALER_AVAILABLE_FORMATS */ public static final Key REQUEST_MAX_NUM_OUTPUT_STREAMS = new Key("android.request.maxNumOutputStreams", int[].class); /** *

The maximum numbers of any type of input streams * that can be configured and used simultaneously by a camera device.

*

When set to 0, it means no input stream is supported.

*

The image format for a input stream can be any supported * format provided by * {@link CameraCharacteristics#SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP android.scaler.availableInputOutputFormatsMap}. When using an * input stream, there must be at least one output stream * configured to to receive the reprocessed images.

*

For example, for Zero Shutter Lag (ZSL) still capture use case, the input * stream image format will be RAW_OPAQUE, the associated output stream image format * should be JPEG.

* * @see CameraCharacteristics#SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP */ public static final Key REQUEST_MAX_NUM_INPUT_STREAMS = new Key("android.request.maxNumInputStreams", int.class); /** *

Specifies the number of maximum pipeline stages a frame * has to go through from when it's exposed to when it's available * to the framework.

*

A typical minimum value for this is 2 (one stage to expose, * one stage to readout) from the sensor. The ISP then usually adds * its own stages to do custom HW processing. Further stages may be * added by SW processing.

*

Depending on what settings are used (e.g. YUV, JPEG) and what * processing is enabled (e.g. face detection), the actual pipeline * depth (specified by {@link CaptureResult#REQUEST_PIPELINE_DEPTH android.request.pipelineDepth}) may be less than * the max pipeline depth.

*

A pipeline depth of X stages is equivalent to a pipeline latency of * X frame intervals.

*

This value will be 8 or less.

* * @see CaptureResult#REQUEST_PIPELINE_DEPTH */ public static final Key REQUEST_PIPELINE_MAX_DEPTH = new Key("android.request.pipelineMaxDepth", byte.class); /** *

Optional. Defaults to 1. Defines how many sub-components * a result will be composed of.

*

In order to combat the pipeline latency, partial results * may be delivered to the application layer from the camera device as * soon as they are available.

*

A value of 1 means that partial results are not supported.

*

A typical use case for this might be: after requesting an AF lock the * new AF state might be available 50% of the way through the pipeline. * The camera device could then immediately dispatch this state via a * partial result to the framework/application layer, and the rest of * the metadata via later partial results.

*/ public static final Key REQUEST_PARTIAL_RESULT_COUNT = new Key("android.request.partialResultCount", int.class); /** *

List of capabilities that the camera device * advertises as fully supporting.

*

A capability is a contract that the camera device makes in order * to be able to satisfy one or more use cases.

*

Listing a capability guarantees that the whole set of features * required to support a common use will all be available.

*

Using a subset of the functionality provided by an unsupported * capability may be possible on a specific camera device implementation; * to do this query each of android.request.availableRequestKeys, * android.request.availableResultKeys, * android.request.availableCharacteristicsKeys.

*

XX: Maybe these should go into {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} * as a table instead?

*

The following capabilities are guaranteed to be available on * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} == FULL devices:

*
    *
  • MANUAL_SENSOR
  • *
  • ZSL
  • *
*

Other capabilities may be available on either FULL or LIMITED * devices, but the app. should query this field to be sure.

* * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see #REQUEST_AVAILABLE_CAPABILITIES_BACKWARD_COMPATIBLE * @see #REQUEST_AVAILABLE_CAPABILITIES_OPTIONAL * @see #REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR * @see #REQUEST_AVAILABLE_CAPABILITIES_GCAM * @see #REQUEST_AVAILABLE_CAPABILITIES_ZSL * @see #REQUEST_AVAILABLE_CAPABILITIES_DNG */ public static final Key REQUEST_AVAILABLE_CAPABILITIES = new Key("android.request.availableCapabilities", int.class); /** *

A list of all keys that the camera device has available * to use with CaptureRequest.

*

Attempting to set a key into a CaptureRequest that is not * listed here will result in an invalid request and will be rejected * by the camera device.

*

This field can be used to query the feature set of a camera device * at a more granular level than capabilities. This is especially * important for optional keys that are not listed under any capability * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.

*

TODO: This should be used by #getAvailableCaptureRequestKeys.

* * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES * @hide */ public static final Key REQUEST_AVAILABLE_REQUEST_KEYS = new Key("android.request.availableRequestKeys", int[].class); /** *

A list of all keys that the camera device has available * to use with CaptureResult.

*

Attempting to get a key from a CaptureResult that is not * listed here will always return a null value. Getting a key from * a CaptureResult that is listed here must never return a null * value.

*

The following keys may return null unless they are enabled:

*
    *
  • {@link CaptureResult#STATISTICS_LENS_SHADING_MAP android.statistics.lensShadingMap} (non-null iff {@link CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE android.statistics.lensShadingMapMode} == ON)
  • *
*

(Those sometimes-null keys should nevertheless be listed here * if they are available.)

*

This field can be used to query the feature set of a camera device * at a more granular level than capabilities. This is especially * important for optional keys that are not listed under any capability * in {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.

*

TODO: This should be used by #getAvailableCaptureResultKeys.

* * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES * @see CaptureResult#STATISTICS_LENS_SHADING_MAP * @see CaptureRequest#STATISTICS_LENS_SHADING_MAP_MODE * @hide */ public static final Key REQUEST_AVAILABLE_RESULT_KEYS = new Key("android.request.availableResultKeys", int[].class); /** *

A list of all keys that the camera device has available * to use with CameraCharacteristics.

*

This entry follows the same rules as * android.request.availableResultKeys (except that it applies for * CameraCharacteristics instead of CaptureResult). See above for more * details.

*

TODO: This should be used by CameraCharacteristics#getKeys.

* @hide */ public static final Key REQUEST_AVAILABLE_CHARACTERISTICS_KEYS = new Key("android.request.availableCharacteristicsKeys", int[].class); /** *

The list of image formats that are supported by this * camera device for output streams.

*

All camera devices will support JPEG and YUV_420_888 formats.

*

When set to YUV_420_888, application can access the YUV420 data directly.

*/ public static final Key SCALER_AVAILABLE_FORMATS = new Key("android.scaler.availableFormats", int[].class); /** *

The minimum frame duration that is supported * for each resolution in {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES android.scaler.availableJpegSizes}.

*

This corresponds to the minimum steady-state frame duration when only * that JPEG stream is active and captured in a burst, with all * processing (typically in android.*.mode) set to FAST.

*

When multiple streams are configured, the minimum * frame duration will be >= max(individual stream min * durations)

* * @see CameraCharacteristics#SCALER_AVAILABLE_JPEG_SIZES */ public static final Key SCALER_AVAILABLE_JPEG_MIN_DURATIONS = new Key("android.scaler.availableJpegMinDurations", long[].class); /** *

The JPEG resolutions that are supported by this camera device.

*

The resolutions are listed as (width, height) pairs. All camera devices will support * sensor maximum resolution (defined by {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}).

* * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE */ public static final Key SCALER_AVAILABLE_JPEG_SIZES = new Key("android.scaler.availableJpegSizes", android.hardware.camera2.Size[].class); /** *

The maximum ratio between active area width * and crop region width, or between active area height and * crop region height, if the crop region height is larger * than width

*/ public static final Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM = new Key("android.scaler.availableMaxDigitalZoom", float.class); /** *

For each available processed output size (defined in * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES android.scaler.availableProcessedSizes}), this property lists the * minimum supportable frame duration for that size.

*

This should correspond to the frame duration when only that processed * stream is active, with all processing (typically in android.*.mode) * set to FAST.

*

When multiple streams are configured, the minimum frame duration will * be >= max(individual stream min durations).

* * @see CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_SIZES */ public static final Key SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS = new Key("android.scaler.availableProcessedMinDurations", long[].class); /** *

The resolutions available for use with * processed output streams, such as YV12, NV12, and * platform opaque YUV/RGB streams to the GPU or video * encoders.

*

The resolutions are listed as (width, height) pairs.

*

For a given use case, the actual maximum supported resolution * may be lower than what is listed here, depending on the destination * Surface for the image data. For example, for recording video, * the video encoder chosen may have a maximum size limit (e.g. 1080p) * smaller than what the camera (e.g. maximum resolution is 3264x2448) * can provide.

*

Please reference the documentation for the image data destination to * check if it limits the maximum size for image data.

*/ public static final Key SCALER_AVAILABLE_PROCESSED_SIZES = new Key("android.scaler.availableProcessedSizes", android.hardware.camera2.Size[].class); /** *

The mapping of image formats that are supported by this * camera device for input streams, to their corresponding output formats.

*

All camera devices with at least 1 * {@link CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS android.request.maxNumInputStreams} will have at least one * available input format.

*

The camera device will support the following map of formats, * if its dependent capability is supported:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Input FormatOutput FormatCapability
RAW_OPAQUEJPEGZSL
RAW_OPAQUEYUV_420_888ZSL
RAW_OPAQUERAW16DNG
RAW16YUV_420_888DNG
RAW16JPEGDNG
*

For ZSL-capable camera devices, using the RAW_OPAQUE format * as either input or output will never hurt maximum frame rate (i.e. * {@link CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS android.scaler.availableStallDurations} will not have RAW_OPAQUE).

*

Attempting to configure an input stream with output streams not * listed as available in this map is not valid.

*

TODO: Add java type mapping for this property.

* * @see CameraCharacteristics#REQUEST_MAX_NUM_INPUT_STREAMS * @see CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS */ public static final Key SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP = new Key("android.scaler.availableInputOutputFormatsMap", int[].class); /** *

The available stream configurations that this * camera device supports * (i.e. format, width, height, output/input stream).

*

The configurations are listed as (format, width, height, input?) * tuples.

*

All camera devices will support sensor maximum resolution (defined by * {@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}) for the JPEG format.

*

For a given use case, the actual maximum supported resolution * may be lower than what is listed here, depending on the destination * Surface for the image data. For example, for recording video, * the video encoder chosen may have a maximum size limit (e.g. 1080p) * smaller than what the camera (e.g. maximum resolution is 3264x2448) * can provide.

*

Please reference the documentation for the image data destination to * check if it limits the maximum size for image data.

*

Not all output formats may be supported in a configuration with * an input stream of a particular format. For more details, see * {@link CameraCharacteristics#SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP android.scaler.availableInputOutputFormatsMap}.

*

The following table describes the minimum required output stream * configurations based on the hardware level * ({@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel}):

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
FormatSizeHardware LevelNotes
JPEG{@link CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE android.sensor.info.activeArraySize}Any
JPEG1920x1080 (1080p)Anyif 1080p <= activeArraySize
JPEG1280x720 (720)Anyif 720p <= activeArraySize
JPEG640x480 (480p)Anyif 480p <= activeArraySize
JPEG320x240 (240p)Anyif 240p <= activeArraySize
YUV_420_888all output sizes available for JPEGFULL
YUV_420_888all output sizes available for JPEG, up to the maximum video sizeLIMITED
IMPLEMENTATION_DEFINEDsame as YUV_420_888Any
*

Refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} for additional * mandatory stream configurations on a per-capability basis.

* * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES * @see CameraCharacteristics#SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP * @see CameraCharacteristics#SENSOR_INFO_ACTIVE_ARRAY_SIZE * @see #SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT * @see #SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT */ public static final Key SCALER_AVAILABLE_STREAM_CONFIGURATIONS = new Key("android.scaler.availableStreamConfigurations", int[].class); /** *

This lists the minimum frame duration for each * format/size combination.

*

This should correspond to the frame duration when only that * stream is active, with all processing (typically in android.*.mode) * set to either OFF or FAST.

*

When multiple streams are used in a request, the minimum frame * duration will be max(individual stream min durations).

*

The minimum frame duration of a stream (of a particular format, size) * is the same regardless of whether the stream is input or output.

*

See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} and * {@link CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS android.scaler.availableStallDurations} for more details about * calculating the max frame rate.

* * @see CameraCharacteristics#SCALER_AVAILABLE_STALL_DURATIONS * @see CaptureRequest#SENSOR_FRAME_DURATION */ public static final Key SCALER_AVAILABLE_MIN_FRAME_DURATIONS = new Key("android.scaler.availableMinFrameDurations", long[].class); /** *

This lists the maximum stall duration for each * format/size combination.

*

A stall duration is how much extra time would get added * to the normal minimum frame duration for a repeating request * that has streams with non-zero stall.

*

For example, consider JPEG captures which have the following * characteristics:

*
    *
  • JPEG streams act like processed YUV streams in requests for which * they are not included; in requests in which they are directly * referenced, they act as JPEG streams. This is because supporting a * JPEG stream requires the underlying YUV data to always be ready for * use by a JPEG encoder, but the encoder will only be used (and impact * frame duration) on requests that actually reference a JPEG stream.
  • *
  • The JPEG processor can run concurrently to the rest of the camera * pipeline, but cannot process more than 1 capture at a time.
  • *
*

In other words, using a repeating YUV request would result * in a steady frame rate (let's say it's 30 FPS). If a single * JPEG request is submitted periodically, the frame rate will stay * at 30 FPS (as long as we wait for the previous JPEG to return each * time). If we try to submit a repeating YUV + JPEG request, then * the frame rate will drop from 30 FPS.

*

In general, submitting a new request with a non-0 stall time * stream will not cause a frame rate drop unless there are still * outstanding buffers for that stream from previous requests.

*

Submitting a repeating request with streams (call this S) * is the same as setting the minimum frame duration from * the normal minimum frame duration corresponding to S, added with * the maximum stall duration for S.

*

If interleaving requests with and without a stall duration, * a request will stall by the maximum of the remaining times * for each can-stall stream with outstanding buffers.

*

This means that a stalling request will not have an exposure start * until the stall has completed.

*

This should correspond to the stall duration when only that stream is * active, with all processing (typically in android.*.mode) set to FAST * or OFF. Setting any of the processing modes to HIGH_QUALITY * effectively results in an indeterminate stall duration for all * streams in a request (the regular stall calculation rules are * ignored).

*

The following formats may always have a stall duration:

*
    *
  • JPEG
  • *
  • RAW16
  • *
*

The following formats will never have a stall duration:

*
    *
  • YUV_420_888
  • *
  • IMPLEMENTATION_DEFINED
  • *
*

All other formats may or may not have an allowed stall duration on * a per-capability basis; refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities} * for more details.

*

See {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} for more information about * calculating the max frame rate (absent stalls).

* * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES * @see CaptureRequest#SENSOR_FRAME_DURATION */ public static final Key SCALER_AVAILABLE_STALL_DURATIONS = new Key("android.scaler.availableStallDurations", long[].class); /** *

Area of raw data which corresponds to only * active pixels.

*

It is smaller or equal to * sensor full pixel array, which could include the black calibration pixels.

*/ public static final Key SENSOR_INFO_ACTIVE_ARRAY_SIZE = new Key("android.sensor.info.activeArraySize", android.graphics.Rect.class); /** *

Range of valid sensitivities

*/ public static final Key SENSOR_INFO_SENSITIVITY_RANGE = new Key("android.sensor.info.sensitivityRange", int[].class); /** *

Range of valid exposure * times used by {@link CaptureRequest#SENSOR_EXPOSURE_TIME android.sensor.exposureTime}.

* * @see CaptureRequest#SENSOR_EXPOSURE_TIME */ public static final Key SENSOR_INFO_EXPOSURE_TIME_RANGE = new Key("android.sensor.info.exposureTimeRange", long[].class); /** *

Maximum possible frame duration (minimum frame * rate).

*

The largest possible {@link CaptureRequest#SENSOR_FRAME_DURATION android.sensor.frameDuration} * that will be accepted by the camera device. Attempting to use * frame durations beyond the maximum will result in the frame duration * being clipped to the maximum. See that control * for a full definition of frame durations.

*

Refer to * {@link CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS android.scaler.availableProcessedMinDurations}, * {@link CameraCharacteristics#SCALER_AVAILABLE_JPEG_MIN_DURATIONS android.scaler.availableJpegMinDurations}, and * android.scaler.availableRawMinDurations for the minimum * frame duration values.

* * @see CameraCharacteristics#SCALER_AVAILABLE_JPEG_MIN_DURATIONS * @see CameraCharacteristics#SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS * @see CaptureRequest#SENSOR_FRAME_DURATION */ public static final Key SENSOR_INFO_MAX_FRAME_DURATION = new Key("android.sensor.info.maxFrameDuration", long.class); /** *

The physical dimensions of the full pixel * array

*

Needed for FOV calculation for old API

*/ public static final Key SENSOR_INFO_PHYSICAL_SIZE = new Key("android.sensor.info.physicalSize", float[].class); /** *

Dimensions of full pixel array, possibly * including black calibration pixels.

*

Maximum output resolution for raw format must * match this in * {@link CameraCharacteristics#SCALER_AVAILABLE_STREAM_CONFIGURATIONS android.scaler.availableStreamConfigurations}.

* * @see CameraCharacteristics#SCALER_AVAILABLE_STREAM_CONFIGURATIONS */ public static final Key SENSOR_INFO_PIXEL_ARRAY_SIZE = new Key("android.sensor.info.pixelArraySize", android.hardware.camera2.Size.class); /** *

Maximum raw value output by sensor.

*

This specifies the fully-saturated encoding level for the raw * sample values from the sensor. This is typically caused by the * sensor becoming highly non-linear or clipping. The minimum for * each channel is specified by the offset in the * {@link CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN android.sensor.blackLevelPattern} tag.

*

The white level is typically determined either by sensor bit depth * (10-14 bits is expected), or by the point where the sensor response * becomes too non-linear to be useful. The default value for this is * maximum representable value for a 16-bit raw sample (2^16 - 1).

* * @see CameraCharacteristics#SENSOR_BLACK_LEVEL_PATTERN */ public static final Key SENSOR_INFO_WHITE_LEVEL = new Key("android.sensor.info.whiteLevel", int.class); /** *

Gain factor from electrons to raw units when * ISO=100

*

Optional - This value may be {@code null} on some devices.

*

Full capability - * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key

* * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL */ public static final Key SENSOR_BASE_GAIN_FACTOR = new Key("android.sensor.baseGainFactor", Rational.class); /** *

A fixed black level offset for each of the color filter arrangement * (CFA) mosaic channels.

*

This tag specifies the zero light value for each of the CFA mosaic * channels in the camera sensor. The maximal value output by the * sensor is represented by the value in {@link CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL android.sensor.info.whiteLevel}.

*

The values are given in row-column scan order, with the first value * corresponding to the element of the CFA in row=0, column=0.

*

Optional - This value may be {@code null} on some devices.

* * @see CameraCharacteristics#SENSOR_INFO_WHITE_LEVEL */ public static final Key SENSOR_BLACK_LEVEL_PATTERN = new Key("android.sensor.blackLevelPattern", int[].class); /** *

Maximum sensitivity that is implemented * purely through analog gain.

*

For {@link CaptureRequest#SENSOR_SENSITIVITY android.sensor.sensitivity} values less than or * equal to this, all applied gain must be analog. For * values above this, the gain applied can be a mix of analog and * digital.

*

Optional - This value may be {@code null} on some devices.

*

Full capability - * Present on all camera devices that report being {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL_FULL HARDWARE_LEVEL_FULL} devices in the * {@link CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL android.info.supportedHardwareLevel} key

* * @see CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL * @see CaptureRequest#SENSOR_SENSITIVITY */ public static final Key SENSOR_MAX_ANALOG_SENSITIVITY = new Key("android.sensor.maxAnalogSensitivity", int.class); /** *

Clockwise angle through which the output * image needs to be rotated to be upright on the device * screen in its native orientation. Also defines the * direction of rolling shutter readout, which is from top * to bottom in the sensor's coordinate system

*/ public static final Key SENSOR_ORIENTATION = new Key("android.sensor.orientation", int.class); /** *

The number of input samples for each dimension of * {@link CaptureResult#SENSOR_PROFILE_HUE_SAT_MAP android.sensor.profileHueSatMap}.

*

The number of input samples for the hue, saturation, and value * dimension of {@link CaptureResult#SENSOR_PROFILE_HUE_SAT_MAP android.sensor.profileHueSatMap}. The order of the * dimensions given is hue, saturation, value; where hue is the 0th * element.

*

Optional - This value may be {@code null} on some devices.

* * @see CaptureResult#SENSOR_PROFILE_HUE_SAT_MAP */ public static final Key SENSOR_PROFILE_HUE_SAT_MAP_DIMENSIONS = new Key("android.sensor.profileHueSatMapDimensions", int[].class); /** *

Optional. Defaults to [OFF]. Lists the supported test * pattern modes for {@link CaptureRequest#SENSOR_TEST_PATTERN_MODE android.sensor.testPatternMode}.

*

Optional - This value may be {@code null} on some devices.

* * @see CaptureRequest#SENSOR_TEST_PATTERN_MODE */ public static final Key SENSOR_AVAILABLE_TEST_PATTERN_MODES = new Key("android.sensor.availableTestPatternModes", byte.class); /** *

Which face detection modes are available, * if any

*

OFF means face detection is disabled, it must * be included in the list.

*

SIMPLE means the device supports the * android.statistics.faceRectangles and * android.statistics.faceScores outputs.

*

FULL means the device additionally supports the * android.statistics.faceIds and * android.statistics.faceLandmarks outputs.

*/ public static final Key STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = new Key("android.statistics.info.availableFaceDetectModes", byte[].class); /** *

Maximum number of simultaneously detectable * faces

*/ public static final Key STATISTICS_INFO_MAX_FACE_COUNT = new Key("android.statistics.info.maxFaceCount", int.class); /** *

Maximum number of supported points in the * tonemap curve that can be used for {@link CaptureRequest#TONEMAP_CURVE_RED android.tonemap.curveRed}, or * {@link CaptureRequest#TONEMAP_CURVE_GREEN android.tonemap.curveGreen}, or {@link CaptureRequest#TONEMAP_CURVE_BLUE android.tonemap.curveBlue}.

*

If the actual number of points provided by the application (in * android.tonemap.curve*) is less than max, the camera device will * resample the curve to its internal representation, using linear * interpolation.

*

The output curves in the result metadata may have a different number * of points than the input curves, and will represent the actual * hardware curves used as closely as possible when linearly interpolated.

* * @see CaptureRequest#TONEMAP_CURVE_BLUE * @see CaptureRequest#TONEMAP_CURVE_GREEN * @see CaptureRequest#TONEMAP_CURVE_RED */ public static final Key TONEMAP_MAX_CURVE_POINTS = new Key("android.tonemap.maxCurvePoints", int.class); /** *

A list of camera LEDs that are available on this system.

* @see #LED_AVAILABLE_LEDS_TRANSMIT * @hide */ public static final Key LED_AVAILABLE_LEDS = new Key("android.led.availableLeds", int[].class); /** *

Generally classifies the overall set of the camera device functionality.

*

Camera devices will come in two flavors: LIMITED and FULL.

*

A FULL device has the most support possible and will enable the * widest range of use cases such as:

*
    *
  • 30 FPS at maximum resolution (== sensor resolution)
  • *
  • Per frame control
  • *
  • Manual sensor control
  • *
  • Zero Shutter Lag (ZSL)
  • *
*

A LIMITED device may have some or none of the above characteristics. * To find out more refer to {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES android.request.availableCapabilities}.

* * @see CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES * @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL */ public static final Key INFO_SUPPORTED_HARDWARE_LEVEL = new Key("android.info.supportedHardwareLevel", int.class); /** *

The maximum number of frames that can occur after a request * (different than the previous) has been submitted, and before the * result's state becomes synchronized (by setting * android.sync.frameNumber to a non-negative value).

*

This defines the maximum distance (in number of metadata results), * between android.sync.frameNumber and the equivalent * android.request.frameCount.

*

In other words this acts as an upper boundary for how many frames * must occur before the camera device knows for a fact that the new * submitted camera settings have been applied in outgoing frames.

*

For example if the distance was 2,

*
initial request = X (repeating)
     * request1 = X
     * request2 = Y
     * request3 = Y
     * request4 = Y
     *
     * where requestN has frameNumber N, and the first of the repeating
     * initial request's has frameNumber F (and F < 1).
     *
     * initial result = X' + { android.sync.frameNumber == F }
     * result1 = X' + { android.sync.frameNumber == F }
     * result2 = X' + { android.sync.frameNumber == CONVERGING }
     * result3 = X' + { android.sync.frameNumber == CONVERGING }
     * result4 = X' + { android.sync.frameNumber == 2 }
     *
     * where resultN has frameNumber N.
     * 
*

Since result4 has a frameNumber == 4 and * android.sync.frameNumber == 2, the distance is clearly * 4 - 2 = 2.

* @see #SYNC_MAX_LATENCY_PER_FRAME_CONTROL * @see #SYNC_MAX_LATENCY_UNKNOWN */ public static final Key SYNC_MAX_LATENCY = new Key("android.sync.maxLatency", int.class); /*~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~ * End generated code *~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~@~O@*/ }