CameraCaptureSessionInterop


public interface CameraCaptureSessionInterop<T extends CameraCaptureSessionInterop<@NonNull T>>


Configures Camera2 android.hardware.camera2.CameraCaptureSession options.

Summary

Public methods

abstract @NonNull T

Clears all CaptureRequest.Keys previously set on this target.

abstract @NonNull T

Clears a CaptureRequest.Key previously set on this target.

abstract @NonNull T
<V extends Object> setCaptureRequestOption(
    @NonNull CaptureRequest.Key<@NonNull V> key,
    @NonNull V value
)

Sets a CaptureRequest.Key and value on repeating and one-shot requests.

default @NonNull T

Sets the callback to receive repeating capture updates on a direct executor.

abstract @NonNull T

Sets the callback to receive repeating capture updates.

abstract @NonNull T

Sets the repeating capture request template type.

Public methods

clearAllCaptureRequestOptions

Added in 1.7.0-alpha03
abstract @NonNullclearAllCaptureRequestOptions()

Clears all CaptureRequest.Keys previously set on this target.

Returns
@NonNull T

this CameraCaptureSessionInterop instance

clearCaptureRequestOption

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

Clears a CaptureRequest.Key previously set on this target.

Parameters
@NonNull CaptureRequest.Key<@NonNull ?> key

capture request option key

Returns
@NonNull T

this CameraCaptureSessionInterop instance

setCaptureRequestOption

Added in 1.7.0-alpha03
abstract @NonNull T <V extends Object> setCaptureRequestOption(
    @NonNull CaptureRequest.Key<@NonNull V> key,
    @NonNull V value
)

Sets a CaptureRequest.Key and value on repeating and one-shot requests.

Parameters
@NonNull CaptureRequest.Key<@NonNull V> key

capture request option key

@NonNull V value

option value

Returns
@NonNull T

this CameraCaptureSessionInterop instance

setRepeatingCaptureCallback

Added in 1.7.0-alpha03
default @NonNullsetRepeatingCaptureCallback(
    @NonNull CameraCaptureSession.CaptureCallback callback
)

Sets the callback to receive repeating capture updates on a direct executor.

Warning: The callback receives raw android.hardware.camera2.CameraCaptureSession instances. Calling state-altering methods on the session (such as android.hardware.camera2.CameraCaptureSession.close or android.hardware.camera2.CameraCaptureSession.abortCaptures) bypasses CameraX pipeline management and may cause state desynchronization or application crashes.

Parameters
@NonNull CameraCaptureSession.CaptureCallback callback

repeating capture callback

Returns
@NonNull T

this CameraCaptureSessionInterop instance

setRepeatingCaptureCallback

Added in 1.7.0-alpha03
abstract @NonNullsetRepeatingCaptureCallback(
    @NonNull Executor executor,
    @NonNull CameraCaptureSession.CaptureCallback callback
)

Sets the callback to receive repeating capture updates.

Warning: The callback receives raw android.hardware.camera2.CameraCaptureSession instances. Calling state-altering methods on the session (such as android.hardware.camera2.CameraCaptureSession.close or android.hardware.camera2.CameraCaptureSession.abortCaptures) bypasses CameraX pipeline management and may cause state desynchronization or application crashes.

Parameters
@NonNull Executor executor

executor to run the callback on

@NonNull CameraCaptureSession.CaptureCallback callback

repeating capture callback

Returns
@NonNull T

this CameraCaptureSessionInterop instance

setRepeatingCaptureRequestTemplate

Added in 1.7.0-alpha03
abstract @NonNullsetRepeatingCaptureRequestTemplate(int templateType)

Sets the repeating capture request template type.

Parameters
int templateType

template type (e.g., android.hardware.camera2.CameraDevice.TEMPLATE_PREVIEW)

Returns
@NonNull T

this CameraCaptureSessionInterop instance