# SessionConfigCamera2Interop

Artifact: [androidx.camera:camera-camera2](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/camera2/interop/InteropTargetInterfaces.kt+class:androidx.camera.camera2.interop.SessionConfigCamera2Interop) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

*** ** * ** ***


```
@CameraXDsl
abstract class SessionConfigCamera2Interop : CameraDeviceInterop, SessionConfigurationInterop, CameraCaptureSessionInterop
```

<br />

*** ** * ** ***

Configures Camera2 options on a `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig`.

Provides setters for session parameters, operating mode session type, session color space, device and session state callbacks, capture request keys, and repeating capture callbacks.

**Warning:** Callbacks configured on this target receive raw `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html` and `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html` 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:

- On `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html`: `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#close()` or session creation methods (`https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createCaptureSession(android.hardware.camera2.params.SessionConfiguration)`, `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createCaptureSessionByOutputConfigurations(java.util.List&lt;android.hardware.camera2.params.OutputConfiguration&gt;, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler)`, `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createReprocessableCaptureSession(android.hardware.camera2.params.InputConfiguration, java.util.List&lt;android.view.Surface&gt;, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler)`, `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createExtensionSession(android.hardware.camera2.params.ExtensionSessionConfiguration)`)

- On `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html`: lifecycle methods (`https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#close()`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#abortCaptures()`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#stopRepeating()`), request submission methods (`https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#setRepeatingRequest(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#setRepeatingBurst(java.util.List&lt;android.hardware.camera2.CaptureRequest&gt;, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#capture(android.hardware.camera2.CaptureRequest, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#captureBurst(java.util.List&lt;android.hardware.camera2.CaptureRequest&gt;, android.hardware.camera2.CameraCaptureSession.CaptureCallback, android.os.Handler)`), or surface configuration methods (`https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#updateOutputConfiguration(android.hardware.camera2.params.OutputConfiguration)`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#finalizeOutputConfigurations(java.util.List&lt;android.hardware.camera2.params.OutputConfiguration&gt;)`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#prepare(android.view.Surface)`, `https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#switchToOffline(java.util.Collection&lt;android.view.Surface&gt;, java.util.concurrent.Executor, android.hardware.camera2.CameraOfflineSession.CameraOfflineSessionCallback)`)

## Summary

### Inherited functions

From [androidx.camera.camera2.interop.CameraCaptureSessionInterop](https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop) `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop#clearAllCaptureRequestOptions()()`

Clears all `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s previously set on this target.
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop#clearCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key)(key: https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>)`

Clears a `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html` previously set on this target.
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `<V : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop#setCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key,kotlin.Any)(key: https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<V>, value: V)`

Sets a `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html` and value on repeating and one-shot requests.
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop#setRepeatingCaptureCallback(java.util.concurrent.Executor,android.hardware.camera2.CameraCaptureSession.CaptureCallback)(
executor: https://developer.android.com/reference/java/util/concurrent/Executor.html,
callback: https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.CaptureCallback.html
)`

Sets the callback to receive repeating capture updates with an executor.
From [androidx.camera.camera2.interop.CameraDeviceInterop](https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraDeviceInterop) `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraDeviceInterop#setDeviceStateCallback(java.util.concurrent.Executor,android.hardware.camera2.CameraDevice.StateCallback)(
executor: https://developer.android.com/reference/java/util/concurrent/Executor.html,
callback: https://developer.android.com/reference/android/hardware/camera2/CameraDevice.StateCallback.html
)`

Sets the callback to receive camera device state updates with an executor.
From [androidx.camera.camera2.interop.SessionConfigurationInterop](https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop) `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 28)
<V : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop#setSessionParameter(android.hardware.camera2.CaptureRequest.Key,kotlin.Any)(key: https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<V>, value: V)`

Sets a session parameter used during session creation.
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop#setSessionStateCallback(java.util.concurrent.Executor,android.hardware.camera2.CameraCaptureSession.StateCallback)(
executor: https://developer.android.com/reference/java/util/concurrent/Executor.html,
callback: https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback.html
)`

Sets the callback to receive session state updates with an executor.

### Inherited properties

From [androidx.camera.camera2.interop.CameraCaptureSessionInterop](https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop) `open https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CaptureRequestOptionTarget` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop#captureRequest()`

Helper target property supporting `captureRequest[key] = value` indexing operator syntax.
`abstract https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.CaptureCallback.html?` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop#repeatingCaptureCallback()`

The callback to receive repeating capture updates on a direct executor.
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraCaptureSessionInterop#repeatingCaptureRequestTemplate()`

The repeating capture request template type (e.g., `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#TEMPLATE_PREVIEW`).
From [androidx.camera.camera2.interop.CameraDeviceInterop](https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraDeviceInterop) `abstract https://developer.android.com/reference/android/hardware/camera2/CameraDevice.StateCallback.html?` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/CameraDeviceInterop#deviceStateCallback()`

The callback to receive camera device state updates on a direct executor.
From [androidx.camera.camera2.interop.SessionConfigurationInterop](https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop) `abstract https://developer.android.com/reference/android/graphics/ColorSpace.Named.html?` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop#colorSpace()`

The session color space.
`open https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionParameterTarget` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop#sessionParameter()`

Helper target property supporting `sessionParameter[key] = value` indexing operator syntax.
`abstract https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.StateCallback.html?` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop#sessionStateCallback()`

The callback to receive session state updates on a direct executor.
`abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigurationInterop#sessionType()`

The operating mode session type.