# Print output for @column tags ?> CameraExtensionCharacteristics - Android SDK | Android Developers

Most visited

Recently visited

CameraExtensionCharacteristics

public final class CameraExtensionCharacteristics
extends Object

java.lang.Object
   ↳ android.hardware.camera2.CameraExtensionCharacteristics


Allows clients to query availability and supported resolutions of camera extensions.

Camera extensions give camera clients access to device-specific algorithms and sequences that can improve the overall image quality of snapshots in various cases such as low light, selfies, portraits, and scenes that can benefit from enhanced dynamic range. Often such sophisticated processing sequences will rely on multiple camera frames as input and will produce a single output.

Camera extensions are not guaranteed to be present on all devices so camera clients must query for their availability via CameraExtensionCharacteristics#getSupportedExtensions().

In order to use any available camera extension, camera clients must create a corresponding CameraExtensionSession via CameraDevice#createExtensionSession(ExtensionSessionConfiguration)

Camera clients must be aware that device-specific camera extensions may support only a subset of the available camera resolutions and must first query CameraExtensionCharacteristics#getExtensionSupportedSizes(int, int) for supported single high-quality request output sizes and CameraExtensionCharacteristics#getExtensionSupportedSizes(int, Class) for supported repeating request output sizes.

The extension characteristics for a given device are expected to remain static under normal operating conditions.

See also:

Summary

Constants

int EXTENSION_AUTOMATIC

Device-specific extension implementation for automatic selection of particular extension such as HDR or NIGHT depending on the current lighting and environment conditions.

int EXTENSION_BEAUTY

Device-specific extension implementation which tends to smooth the skin and apply other cosmetic effects to people's faces.

int EXTENSION_BOKEH

Device-specific extension implementation which can blur certain regions of the final image thereby "enhancing" focus for all remaining non-blurred parts.

int EXTENSION_HDR

Device-specific extension implementation for enhancing the dynamic range of the final image.

int EXTENSION_NIGHT

Device-specific extension implementation that aims to suppress noise and improve the overall image quality under low light conditions.

Public methods

Range<Long> getEstimatedCaptureLatencyRangeMillis(int extension, Size captureOutputSize, int format)

Returns the estimated capture latency range in milliseconds for the target capture resolution during the calls to CameraExtensionSession#capture.

List<Size> getExtensionSupportedSizes(int extension, int format)

Check whether a given extension is available and return the supported output surface resolutions that can be used for high-quality capture requests via CameraExtensionSession#capture.

<T> List<Size> getExtensionSupportedSizes(int extension, Class<T> klass)

Get a list of sizes compatible with klass to use as an output for the repeating request CameraExtensionSession#setRepeatingRequest.

List<Integer> getSupportedExtensions()

Return a list of supported device-specific extensions for a given camera device.

Inherited methods

Constants

EXTENSION_AUTOMATIC

public static final int EXTENSION_AUTOMATIC

Device-specific extension implementation for automatic selection of particular extension such as HDR or NIGHT depending on the current lighting and environment conditions.

Constant Value: 0 (0x00000000)

EXTENSION_BEAUTY

public static final int EXTENSION_BEAUTY

Device-specific extension implementation which tends to smooth the skin and apply other cosmetic effects to people's faces.

Constant Value: 1 (0x00000001)

EXTENSION_BOKEH

public static final int EXTENSION_BOKEH

Device-specific extension implementation which can blur certain regions of the final image thereby "enhancing" focus for all remaining non-blurred parts.

Constant Value: 2 (0x00000002)

EXTENSION_HDR

public static final int EXTENSION_HDR

Device-specific extension implementation for enhancing the dynamic range of the final image.

Constant Value: 3 (0x00000003)

EXTENSION_NIGHT

public static final int EXTENSION_NIGHT

Device-specific extension implementation that aims to suppress noise and improve the overall image quality under low light conditions.

Constant Value: 4 (0x00000004)

Public methods

getEstimatedCaptureLatencyRangeMillis

public Range<Long> getEstimatedCaptureLatencyRangeMillis (int extension, 
                Size captureOutputSize, 
                int format)

Returns the estimated capture latency range in milliseconds for the target capture resolution during the calls to CameraExtensionSession#capture. This includes the time spent processing the multi-frame capture request along with any additional time for encoding of the processed buffer if necessary.

Parameters
extension int: the extension type Value is either 0 or a combination of EXTENSION_AUTOMATIC, EXTENSION_BEAUTY, EXTENSION_BOKEH, EXTENSION_HDR, and EXTENSION_NIGHT

captureOutputSize Size: size of the capture output surface. If it is not in the supported output sizes, maximum capture output size is used for the estimation This value cannot be null.

format int: device-specific extension output format Value is ImageFormat.UNKNOWN, ImageFormat.RGB_565, ImageFormat.YV12, ImageFormat.Y8, android.graphics.ImageFormat.Y16, ImageFormat.NV16, ImageFormat.NV21, ImageFormat.YUY2, ImageFormat.JPEG, ImageFormat.DEPTH_JPEG, ImageFormat.YUV_420_888, ImageFormat.YUV_422_888, ImageFormat.YUV_444_888, ImageFormat.FLEX_RGB_888, ImageFormat.FLEX_RGBA_8888, ImageFormat.RAW_SENSOR, ImageFormat.RAW_PRIVATE, ImageFormat.RAW10, ImageFormat.RAW12, ImageFormat.DEPTH16, ImageFormat.DEPTH_POINT_CLOUD, android.graphics.ImageFormat.RAW_DEPTH, android.graphics.ImageFormat.RAW_DEPTH10, ImageFormat.PRIVATE, or ImageFormat.HEIC

Returns
Range<Long> the range of estimated minimal and maximal capture latency in milliseconds or null if no capture latency info can be provided

Throws
IllegalArgumentException in case of format different from ImageFormat#JPEG / ImageFormat#YUV_420_888; or unsupported extension.

getExtensionSupportedSizes

public List<Size> getExtensionSupportedSizes (int extension, 
                int format)

Check whether a given extension is available and return the supported output surface resolutions that can be used for high-quality capture requests via CameraExtensionSession#capture.

Note that device-specific extensions are allowed to support only a subset of the camera resolutions advertised by StreamConfigurationMap#getOutputSizes.

Device-specific extensions currently support at most two multi-frame capture surface formats. ImageFormat.JPEG will be supported by all extensions and ImageFormat.YUV_420_888 may or may not be supported.

Parameters
extension int: the extension type Value is either 0 or a combination of EXTENSION_AUTOMATIC, EXTENSION_BEAUTY, EXTENSION_BOKEH, EXTENSION_HDR, and EXTENSION_NIGHT

format int: device-specific extension output format

Returns
List<Size> non-modifiable list of available sizes or an empty list if the format is not supported. This value cannot be null.

Throws
IllegalArgumentException in case of format different from ImageFormat.JPEG / ImageFormat.YUV_420_888; or unsupported extension.

getExtensionSupportedSizes

public List<Size> getExtensionSupportedSizes (int extension, 
                Class<T> klass)

Get a list of sizes compatible with klass to use as an output for the repeating request CameraExtensionSession#setRepeatingRequest.

Note that device-specific extensions are allowed to support only a subset of the camera output surfaces and resolutions. The SurfaceTexture class is guaranteed at least one size for backward compatible cameras whereas other output classes are not guaranteed to be supported.

Parameters
extension int: the extension type Value is either 0 or a combination of EXTENSION_AUTOMATIC, EXTENSION_BEAUTY, EXTENSION_BOKEH, EXTENSION_HDR, and EXTENSION_NIGHT

klass Class: a non-null Class object reference This value cannot be null.

Returns
List<Size> non-modifiable list of available sizes or an empty list if the Surface output is not supported

Throws
NullPointerException if klass was null
IllegalArgumentException in case of unsupported extension.

getSupportedExtensions

public List<Integer> getSupportedExtensions ()

Return a list of supported device-specific extensions for a given camera device.

Returns
List<Integer> non-modifiable list of available extensions This value cannot be null.