CameraExtensionCharacteristicsWrapper


public interface CameraExtensionCharacteristicsWrapper extends CameraCharacteristicsMetadata, UnsafeWrapper


Compatibility wrapper around CameraExtensionCharacteristics.

This wrapper provides type-safe, version-compatible access to the characteristics and capabilities of camera extension modes on a device. It extends CameraCharacteristicsMetadata to support querying characteristics keys and UnsafeWrapper to allow accessing the underlying native characteristics object.

Summary

Public methods

abstract int

The camera extension mode represented by this characteristics instance.

abstract @NonNull CameraId

The ID of the camera device associated with these extension characteristics.

abstract @NonNull Set<@NonNull CaptureRequest.Key<@NonNull ?>>

The set of capture request keys supported by this camera extension.

abstract @NonNull Set<@NonNull CaptureResult.Key<@NonNull ?>>

The set of capture result keys supported by this camera extension.

abstract @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>>

The set of camera characteristics keys that are dynamically updated for this extension.

abstract Range<@NonNull Long>
getEstimatedCaptureLatencyRangeMillis(
    @NonNull Size captureSize,
    int imageFormat
)

Returns the estimated capture latency range in milliseconds for the given capture size and format.

abstract @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>>

The set of camera characteristics keys supported by this camera extension.

abstract @NonNull Set<@NonNull Size>
getOutputSizes(int imageFormat)

Returns the output sizes supported for the given image format.

abstract @NonNull Set<@NonNull Size>

Returns the output sizes supported for the given class (e.g., android.graphics.SurfaceTexture).

abstract @NonNull Set<@NonNull Size>
getPostviewSizes(@NonNull Size captureSize, int format)

Returns the supported postview sizes for a given capture size and format.

abstract @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>>

The set of camera characteristics keys that require specific permissions to be accessed.

abstract boolean

Whether capture progress callbacks are supported for this extension mode.

abstract boolean

Whether postview is supported for this extension mode.

abstract boolean

Whether access to some camera characteristics keys is restricted due to camera permissions.

Inherited methods

From androidx.camera.common.CameraCharacteristicsMetadata
abstract T

Retrieves the value of the specified CameraCharacteristics.Key.

default @NonNull T
<T extends Object> getOrDefault(
    @NonNull CameraCharacteristics.Key<@NonNull T> key,
    @NonNull T default
)

Retrieves the value of the specified CameraCharacteristics.Key, or returns default if the value is null or the key is unsupported.

From androidx.camera.common.Metadata
abstract T
<T extends Object> get(@NonNull Metadata.Key<@NonNull T> key)

Retrieves the value associated with the specified Metadata.Key.

abstract @NonNull Set<@NonNull Metadata.Key<@NonNull ?>>

The set of all custom Metadata.Keys currently available in this container.

default @NonNull T
<T extends Object> getOrDefault(
    @NonNull Metadata.Key<@NonNull T> key,
    @NonNull T default
)

Retrieves the value associated with the specified Metadata.Key, or returns default if the key is not present.

From androidx.camera.common.UnsafeWrapper
abstract T
<T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)

Attempts to unwrap this object into the specified underlying type.

Public methods

getCameraExtension

Added in 1.7.0-alpha03
abstract int getCameraExtension()

The camera extension mode represented by this characteristics instance.

Value is one of the native camera extension constants defined in CameraExtensionCharacteristics (e.g., CameraExtensionCharacteristics.EXTENSION_BOKEH, CameraExtensionCharacteristics.EXTENSION_HDR, CameraExtensionCharacteristics.EXTENSION_NIGHT, CameraExtensionCharacteristics.EXTENSION_FACE_RETOUCH, or CameraExtensionCharacteristics.EXTENSION_AUTOMATIC).

getCameraId

Added in 1.7.0-alpha03
abstract @NonNull CameraId getCameraId()

The ID of the camera device associated with these extension characteristics.

getCaptureRequestKeys

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull CaptureRequest.Key<@NonNull ?>> getCaptureRequestKeys()

The set of capture request keys supported by this camera extension.

See also
CameraExtensionCharacteristics

#getAvailableCaptureRequestKeys

getCaptureResultKeys

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull CaptureResult.Key<@NonNull ?>> getCaptureResultKeys()

The set of capture result keys supported by this camera extension.

See also
CameraExtensionCharacteristics

#getAvailableCaptureResultKeys

getDynamicKeys

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> getDynamicKeys()

The set of camera characteristics keys that are dynamically updated for this extension.

getEstimatedCaptureLatencyRangeMillis

Added in 1.7.0-alpha03
abstract Range<@NonNull LonggetEstimatedCaptureLatencyRangeMillis(
    @NonNull Size captureSize,
    int imageFormat
)

Returns the estimated capture latency range in milliseconds for the given capture size and format.

Parameters
@NonNull Size captureSize

the size of the capture.

int imageFormat

the format of the captured image.

Returns
Range<@NonNull Long>

the range of estimated capture latency, or null if the latency is not available.

See also
CameraExtensionCharacteristics

#getEstimatedCaptureLatencyRangeMillis

getKeys

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> getKeys()

The set of camera characteristics keys supported by this camera extension.

See also
CameraExtensionCharacteristics

#getKeys

getOutputSizes

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull SizegetOutputSizes(int imageFormat)

Returns the output sizes supported for the given image format.

Parameters
int imageFormat

the image format (e.g., android.graphics.ImageFormat.JPEG, android.graphics.ImageFormat.YUV_420_888).

Returns
@NonNull Set<@NonNull Size>

the set of supported sizes for the image format.

See also
CameraExtensionCharacteristics

#getExtensionSupportedSizes

getOutputSizes

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull SizegetOutputSizes(@NonNull Class<@NonNull ?> klass)

Returns the output sizes supported for the given class (e.g., android.graphics.SurfaceTexture).

Parameters
@NonNull Class<@NonNull ?> klass

the class of the output target.

Returns
@NonNull Set<@NonNull Size>

the set of supported sizes for the output class.

See also
CameraExtensionCharacteristics

#getExtensionSupportedSizes

getPostviewSizes

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull SizegetPostviewSizes(@NonNull Size captureSize, int format)

Returns the supported postview sizes for a given capture size and format.

Parameters
@NonNull Size captureSize

the size of the final high-quality capture.

int format

the image format of the postview.

Returns
@NonNull Set<@NonNull Size>

the set of supported postview sizes, or an empty set if postview is not supported.

See also
CameraExtensionCharacteristics

#getPostviewSupportedSizes

getRestrictedKeys

Added in 1.7.0-alpha03
abstract @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> getRestrictedKeys()

The set of camera characteristics keys that require specific permissions to be accessed.

isCaptureProgressSupported

Added in 1.7.0-alpha03
abstract boolean isCaptureProgressSupported()

Whether capture progress callbacks are supported for this extension mode.

If true, capture requests can report progress updates during the extension processing.

See also
CameraExtensionCharacteristics

#isCaptureProcessProgressSupported

isPostviewSupported

Added in 1.7.0-alpha03
abstract boolean isPostviewSupported()

Whether postview is supported for this extension mode.

A postview is a quickly available, lower-resolution preview of the captured image that can be displayed while the final high-quality capture is processing.

See also
CameraExtensionCharacteristics

#isPostviewSupported

isRestricted

Added in 1.7.0-alpha03
abstract boolean isRestricted()

Whether access to some camera characteristics keys is restricted due to camera permissions.

If true, querying restricted keys via get or getOrDefault may return null or default values, matching the behavior of restricted extension modes when CAMERA permission is not granted.