AdvancedVendorExtender

@RequiresApi(value = 21) public class AdvancedVendorExtender implements VendorExtender


Advanced vendor interface implementation

Summary

Public constructors

Public methods

@Nullable @Override 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.

@Nullable @Override Range<@NonNull Long>

Gets the estimated latency range of image capture.

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

Gets the supported output resolutions for image capture.

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

Gets the supported output resolutions for preview.

@NonNull @Override Size[]

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

@Override @NonNull void
init(@NonNull CameraInfo cameraInfo)

Initializes the extender to be used with the specified camera.

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

Indicates whether the extension is supported on the device.

Public constructors

AdvancedVendorExtender

public AdvancedVendorExtender(@ExtensionMode.Mode @NonNull int mode)

Public methods

createSessionProcessor

@Nullable
@Override
@NonNull
public @Override 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
@Override
@NonNull
public @Override Range<@NonNull LonggetEstimatedCaptureLatencyRange(@Nullable Size size)

Gets the estimated latency range of image capture.

It must be called after init() is called.

getSupportedCaptureOutputResolutions

@NonNull
@Override
public @Override 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
@Override
public @Override 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
@Override
public @Override 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

@Override
@NonNull
public @Override void init(@NonNull CameraInfo cameraInfo)

Initializes the extender to be used with the specified camera.

isExtensionAvailable

@Override
@NonNull
public @Override 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 le