StillCaptureInterop


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

Known direct subclasses
ImageCaptureCamera2Interop

Configures Camera2 options on an androidx.camera.core.ImageCapture use case.


Configures Camera2 options for still capture requests.

Keys configured for still capture requests override corresponding keys set in repeating requests.

Summary

Public methods

default @NonNull T

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

abstract @NonNull T

Sets the callback to receive still capture updates.

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

Sets a CaptureRequest.Key and value for still capture requests.

abstract @NonNull T

Sets the template type for still capture requests.

Public methods

setStillCaptureCallback

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

Sets the callback to receive still 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

still capture callback

Returns
@NonNull T

this StillCaptureInterop instance

setStillCaptureCallback

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

Sets the callback to receive still 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

still capture callback

Returns
@NonNull T

this StillCaptureInterop instance

setStillCaptureRequestOption

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

Sets a CaptureRequest.Key and value for still capture requests.

The capture request keys for one-shot still captures (such as androidx.camera.core.ImageCapture.takePicture) are determined by copying all repeating request keys (which may include keys added via androidx.camera.core.SessionConfig.Builder.setInterop or androidx.camera.core.CameraControl.applyInteropAsync) and then overriding them with the still capture request key set here.

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

capture request option key

@NonNull V value

option value

Returns
@NonNull T

this StillCaptureInterop instance

setStillCaptureRequestTemplateType

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

Sets the template type for still capture requests.

Parameters
int templateType

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

Returns
@NonNull T

this StillCaptureInterop instance