VendorExtender

@RequiresApi(value = 21) interface VendorExtender

Known direct subclasses
AdvancedVendorExtender

Advanced vendor interface implementation

BasicVendorExtender

Basic vendor interface implementation


A unified vendor extensions interface which interacts with both basic and advanced extender vendor implementation.

Summary

Public methods

abstract @Nullable SessionProcessor

Creates a SessionProcessor that is responsible for (1) determining the stream configuration based on given output surfaces (2) Requesting OEM implementation to start repeating request and performing a still image capture.

abstract @Nullable Range<@NonNull Long>

Gets the estimated latency range of image capture.

abstract @NonNull List<@NonNull Pair<@NonNull Integer, @NonNull Size[]>>

Gets the supported output resolutions for image capture.

abstract @NonNull List<@NonNull Pair<@NonNull Integer, @NonNull Size[]>>

Gets the supported output resolutions for preview.

abstract @NonNull Size[]

Gets the supported output resolutions for image analysis (YUV_420_888).

abstract @NonNull void
init(@NonNull CameraInfo cameraInfo)

Initializes the extender to be used with the specified camera.

abstract @NonNull boolean
isExtensionAvailable(
    @NonNull String cameraId,
    @NonNull Map<@NonNull String, @NonNull CameraCharacteristics> characteristicsMap
)

Indicates whether the extension is supported on the device.

Public methods

createSessionProcessor

@Nullable
@NonNull
abstract SessionProcessor createSessionProcessor(@NonNull Context context)

Creates a SessionProcessor that is responsible for (1) determining the stream configuration based on given output surfaces (2) Requesting OEM implementation to start repeating request and performing a still image capture.

getEstimatedCaptureLatencyRange

@Nullable
@NonNull
abstract Range<@NonNull LonggetEstimatedCaptureLatencyRange(@Nullable Size size)

Gets the estimated latency range of image capture.

It must be called after init() is called.

getSupportedCaptureOutputResolutions

@NonNull
abstract List<@NonNull Pair<@NonNull Integer, @NonNull Size[]>> getSupportedCaptureOutputResolutions()

Gets the supported output resolutions for image capture.

Pair list composed with ImageFormat and Size array will be returned.

The returned resolutions should be subset of the supported sizes retrieved from android.hardware.camera2.params.StreamConfigurationMap for the camera device.

The returned size array must contain all supported resolutions. It cannot be null.

It must be called after init() is called.

getSupportedPreviewOutputResolutions

@NonNull
abstract List<@NonNull Pair<@NonNull Integer, @NonNull Size[]>> getSupportedPreviewOutputResolutions()

Gets the supported output resolutions for preview.

Pair list composed with ImageFormat and Size array will be returned.

The returned resolutions should be subset of the supported sizes retrieved from android.hardware.camera2.params.StreamConfigurationMap for the camera device.

The returned size array must contain all supported resolutions. It cannot be null.

It must be called after init() is called.

getSupportedYuvAnalysisResolutions

@NonNull
abstract Size[] getSupportedYuvAnalysisResolutions()

Gets the supported output resolutions for image analysis (YUV_420_888).

The returned resolutions should be subset of the supported sizes retrieved from android.hardware.camera2.params.StreamConfigurationMap for the camera device.

The returned size array must contain all supported resolutions. It cannot be null.

It must be called after init() is called.

init

@NonNull
abstract void init(@NonNull CameraInfo cameraInfo)

Initializes the extender to be used with the specified camera.

isExtensionAvailable

@NonNull
abstract boolean isExtensionAvailable(
    @NonNull String cameraId,
    @NonNull Map<@NonNull String, @NonNull CameraCharacteristics> characteristicsMap
)

Indicates whether the extension is supported on the device.

isExtensionAvailable is the only method that can be called ahead of init().

Parameters
@NonNull String cameraId

The camera2 id string of the camera.

@NonNull Map<@NonNull String, @NonNull CameraCharacteristics> characteristicsMap

A map consisting of the camera ids and the CameraCharacteristicss. For every camera, the map contains at least the CameraCharacteristics for the camera id. If the camera is logical camera, it will also contain associated physical camera ids and their CameraCharacteristics.

Returns
boolean

true if the extension is supported, otherwise false