CameraCaptureSessionInterop


interface CameraCaptureSessionInterop<T : CameraCaptureSessionInterop<T>>


Configures Camera2 android.hardware.camera2.CameraCaptureSession options.

Summary

Public functions

T

Clears all CaptureRequest.Keys previously set on this target.

T

Clears a CaptureRequest.Key previously set on this target.

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

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

open T

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

T

Sets the callback to receive repeating capture updates.

T

Sets the repeating capture request template type.

Public properties

open CaptureRequestOptionTarget

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

open CameraCaptureSession.CaptureCallback

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

open Int

Sets the repeating capture request template type.

Public functions

clearAllCaptureRequestOptions

Added in 1.7.0-alpha03
fun clearAllCaptureRequestOptions(): T

Clears all CaptureRequest.Keys previously set on this target.

Returns
T

this CameraCaptureSessionInterop instance

clearCaptureRequestOption

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

Clears a CaptureRequest.Key previously set on this target.

Parameters
key: CaptureRequest.Key<*>

capture request option key

Returns
T

this CameraCaptureSessionInterop instance

setCaptureRequestOption

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

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

Returns
T

this CameraCaptureSessionInterop instance

setRepeatingCaptureCallback

Added in 1.7.0-alpha03
open fun setRepeatingCaptureCallback(
    callback: CameraCaptureSession.CaptureCallback
): T

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
callback: CameraCaptureSession.CaptureCallback

repeating capture callback

Returns
T

this CameraCaptureSessionInterop instance

setRepeatingCaptureCallback

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

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

executor to run the callback on

callback: CameraCaptureSession.CaptureCallback

repeating capture callback

Returns
T

this CameraCaptureSessionInterop instance

setRepeatingCaptureRequestTemplate

Added in 1.7.0-alpha03
fun setRepeatingCaptureRequestTemplate(templateType: Int): T

Sets the repeating capture request template type.

Parameters
templateType: Int

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

Returns
T

this CameraCaptureSessionInterop instance

Public properties

captureRequest

Added in 1.7.0-alpha03
open val captureRequestCaptureRequestOptionTarget

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

repeatingCaptureCallback

Added in 1.7.0-alpha03
Deprecated in 1.7.0-alpha03
open var repeatingCaptureCallbackCameraCaptureSession.CaptureCallback

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

repeatingCaptureRequestTemplate

Added in 1.7.0-alpha03
Deprecated in 1.7.0-alpha03
open var repeatingCaptureRequestTemplateInt

Sets the repeating capture request template type.