/* * 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 ListThe 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 ListThe 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 ListThe 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 */ privateThe 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 KeyThe 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 KeyList of frame rate ranges supported by the * AE algorithm/hardware
*/ public static final KeyMaximum and minimum exposure compensation * setting, in counts of * android.control.aeCompensationStepSize
*/ public static final KeySmallest step by which exposure compensation * can be changed
*/ public static final KeyList 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.
what subset of the full color effect enum * list is supported
*/ public static final Keywhat subset of the scene mode enum list is * supported.
*/ public static final KeyList of video stabilization modes that can * be supported
*/ public static final KeyThe 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 KeyFor AE, AWB, and AF, how many individual * regions can be listed for metering?
*/ public static final KeyWhether this camera has a * flash
*If no flash, none of the flash controls do * anything. All other metadata should return 0
*/ public static final KeySupported resolutions for the JPEG thumbnail
*Below condiditions will be satisfied for this size list:
*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 KeyList 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 KeyThe 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 KeyList of supported optical image * stabilization modes
*/ public static final KeyHyperfocal distance for this lens; set to * 0 if fixed focus
*The hyperfocal distance is used for the old * API's 'fixed' setting
*/ public static final KeyShortest 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 KeyDimensions 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 KeyDirection the camera faces relative to * device screen
* @see #LENS_FACING_FRONT * @see #LENS_FACING_BACK */ public static final KeyIf 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 KeyHow many output streams can be allocated at * the same time for each type of stream
*Video snapshot with preview callbacks requires 3 * processed streams (preview, record, app callbacks) and * one JPEG stream (snapshot)
*/ public static final KeyThe list of image formats that are supported by this * camera device.
*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 KeyThe 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 KeyThe 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}).
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 KeyFor 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 KeyThe 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 KeyArea of raw data which corresponds to only * active pixels; smaller or equal to * pixelArraySize.
*/ public static final KeyRange of valid sensitivities
*/ public static final KeyRange of valid exposure * times
*/ public static final KeyMaximum possible frame duration (minimum frame * rate)
*Minimum duration is a function of resolution, * processing settings. See * android.scaler.availableProcessedMinDurations * android.scaler.availableJpegMinDurations * android.scaler.availableRawMinDurations
*/ public static final KeyThe physical dimensions of the full pixel * array
*Needed for FOV calculation for old API
*/ public static final KeyGain 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 KeyMaximum 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, it 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 KeyClockwise 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 KeyWhich 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 KeyMaximum number of simultaneously detectable * faces
*/ public static final KeyMaximum number of supported points in the * tonemap curve
*/ public static final KeyA list of camera LEDs that are available on this system.
* @see #LED_AVAILABLE_LEDS_TRANSMIT * @hide */ public static final KeyThe camera 3 HAL device can implement one of two possible * operational modes; limited and full. Full support is * expected from new higher-end devices. Limited mode has * hardware requirements roughly in line with those for a * camera HAL device v1 implementation, and is expected from * older or inexpensive devices. Full is a strict superset of * limited, and they share the same essential operational flow.
*For full details refer to "S3. Operational Modes" in camera3.h
* @see #INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED * @see #INFO_SUPPORTED_HARDWARE_LEVEL_FULL */ public static final Key