CameraDeviceInterop


interface CameraDeviceInterop<T : CameraDeviceInterop<T>>

Known direct subclasses

Configures Camera2 android.hardware.camera2.CameraDevice options.

Summary

Public functions

open T

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

T
setDeviceStateCallback(
    executor: Executor,
    callback: CameraDevice.StateCallback
)

Sets the callback to receive camera device state updates.

Public properties

open CameraDevice.StateCallback

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

Public functions

setDeviceStateCallback

Added in 1.7.0-alpha03
open fun setDeviceStateCallback(callback: CameraDevice.StateCallback): T

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
callback: CameraDevice.StateCallback

device state callback

Returns
T

this CameraDeviceInterop instance

setDeviceStateCallback

Added in 1.7.0-alpha03
fun setDeviceStateCallback(
    executor: Executor,
    callback: CameraDevice.StateCallback
): T

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
executor: Executor

executor to run the callback on

callback: CameraDevice.StateCallback

device state callback

Returns
T

this CameraDeviceInterop instance

Public properties

deviceStateCallback

Added in 1.7.0-alpha03
Deprecated in 1.7.0-alpha03
open var deviceStateCallbackCameraDevice.StateCallback

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