CameraDeviceInterop


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

Known direct subclasses

Configures Camera2 android.hardware.camera2.CameraDevice options.

Summary

Public methods

default @NonNull T

Sets the callback to receive camera device state updates on a direct executor.

abstract @NonNull T

Sets the callback to receive camera device state updates.

Public methods

setDeviceStateCallback

Added in 1.7.0-alpha03
default @NonNullsetDeviceStateCallback(@NonNull CameraDevice.StateCallback callback)

Sets the callback to receive camera device state updates on a direct executor.

Warning: The callback receives raw android.hardware.camera2.CameraDevice instances. Calling android.hardware.camera2.CameraDevice.close directly on the device bypasses CameraX pipeline management and may cause state desynchronization or application crashes.

Parameters
@NonNull CameraDevice.StateCallback callback

device state callback

Returns
@NonNull T

this CameraDeviceInterop instance

setDeviceStateCallback

Added in 1.7.0-alpha03
abstract @NonNullsetDeviceStateCallback(
    @NonNull Executor executor,
    @NonNull CameraDevice.StateCallback callback
)

Sets the callback to receive camera device state updates.

Warning: The callback receives raw android.hardware.camera2.CameraDevice instances. Calling android.hardware.camera2.CameraDevice.close directly on the device bypasses CameraX pipeline management and may cause state desynchronization or application crashes.

Parameters
@NonNull Executor executor

executor to run the callback on

@NonNull CameraDevice.StateCallback callback

device state callback

Returns
@NonNull T

this CameraDeviceInterop instance