StillCaptureInterop


interface StillCaptureInterop<T : StillCaptureInterop<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 functions

open T

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

T

Sets the callback to receive still capture updates.

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

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

T

Sets the template type for still capture requests.

Public properties

open CameraCaptureSession.CaptureCallback

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

open StillCaptureRequestOptionTarget

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

open Int

Sets the template type for still capture requests.

Public functions

setStillCaptureCallback

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

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

still capture callback

Returns
T

this StillCaptureInterop instance

setStillCaptureCallback

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

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

executor to run the callback on

callback: CameraCaptureSession.CaptureCallback

still capture callback

Returns
T

this StillCaptureInterop instance

setStillCaptureRequestOption

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

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
key: CaptureRequest.Key<V>

capture request option key

value: V

option value

Returns
T

this StillCaptureInterop instance

setStillCaptureRequestTemplateType

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

Sets the template type for still capture requests.

Parameters
templateType: Int

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

Returns
T

this StillCaptureInterop instance

Public properties

stillCaptureCallback

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

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

stillCaptureRequest

Added in 1.7.0-alpha03
open val stillCaptureRequestStillCaptureRequestOptionTarget

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

stillCaptureRequestTemplateType

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

Sets the template type for still capture requests.