CameraCaptureSessionInterop


interface CameraCaptureSessionInterop


Configures Camera2 android.hardware.camera2.CameraCaptureSession options.

Summary

Public functions

Unit

Clears all CaptureRequest.Keys previously set on this target.

Unit

Clears a CaptureRequest.Key previously set on this target.

Unit
<V : Any?> setCaptureRequestOption(key: CaptureRequest.Key<V>, value: V)

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

Unit

Sets the callback to receive repeating capture updates with an executor.

Public properties

open CaptureRequestOptionTarget

Helper target property supporting captureRequest[key] = value indexing operator syntax.

CameraCaptureSession.CaptureCallback?

The callback to receive repeating capture updates on a direct executor.

Int

The repeating capture request template type (e.g., android.hardware.camera2.CameraDevice.TEMPLATE_PREVIEW).

Public functions

clearAllCaptureRequestOptions

Added in 1.7.0-rc01
fun clearAllCaptureRequestOptions(): Unit

Clears all CaptureRequest.Keys previously set on this target.

clearCaptureRequestOption

Added in 1.7.0-rc01
fun clearCaptureRequestOption(key: CaptureRequest.Key<*>): Unit

Clears a CaptureRequest.Key previously set on this target.

Parameters
key: CaptureRequest.Key<*>

capture request option key

setCaptureRequestOption

Added in 1.7.0-rc01
fun <V : Any?> setCaptureRequestOption(key: CaptureRequest.Key<V>, value: V): Unit

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

Parameters
key: CaptureRequest.Key<V>

capture request option key

value: V

option value

setRepeatingCaptureCallback

Added in 1.7.0-rc01
fun setRepeatingCaptureCallback(
    executor: Executor,
    callback: CameraCaptureSession.CaptureCallback
): Unit

Sets the callback to receive repeating capture updates with an executor.

Warning: The callback receives raw android.hardware.camera2.CameraCaptureSession instances. Directly invoking state-altering, lifecycle, or request-submitting methods on these raw objects bypasses CameraX pipeline management and causes state desynchronization, stream freezing, or crashes. Do not invoke:

Parameters
executor: Executor

executor to run the callback on

callback: CameraCaptureSession.CaptureCallback

repeating capture callback

Public properties

captureRequest

Added in 1.7.0-rc01
open val captureRequest: CaptureRequestOptionTarget

Helper target property supporting captureRequest[key] = value indexing operator syntax.

repeatingCaptureRequestTemplate

Added in 1.7.0-rc01
var repeatingCaptureRequestTemplate: Int

The repeating capture request template type (e.g., android.hardware.camera2.CameraDevice.TEMPLATE_PREVIEW).