# SessionConfigScope

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

*** ** * ** ***


```
@CameraXDsl
class SessionConfigScope
```

<br />

*** ** * ** ***

Scope class for `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig` configuration DSL.

## Summary

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/camera/core/CameraEffect>` | `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope#effects()` The list of `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraEffect` to be applied on the camera session. |
| `https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope#frameRateRange()` The desired frame rate range for the camera session. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope#isAutoRotationEnabled()` Whether to use auto rotation. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/camera/core/featuregroup/GroupableFeature>` | `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope#preferredFeatureGroup()` The list of preferred `https://developer.android.com/reference/kotlin/androidx/camera/core/featuregroup/GroupableFeature`, ordered by priority in descending order. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/camera/core/featuregroup/GroupableFeature>` | `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope#requiredFeatureGroup()` The set of `https://developer.android.com/reference/kotlin/androidx/camera/core/featuregroup/GroupableFeature` that are mandatory for the camera configuration. |
| `https://developer.android.com/reference/kotlin/androidx/camera/core/ViewPort?` | `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope#viewPort()` The `https://developer.android.com/reference/kotlin/androidx/camera/core/ViewPort` to be applied on the camera session. |

| ### Extension functions |
|---|---|
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope.https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope#(androidx.camera.core.SessionConfigScope).camera2Interop(kotlin.Function1)(crossinline block: https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigCamera2Interop.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Applies Camera2 options inside a `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope` DSL block. |

## Public properties

### effects

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
var effects: List<CameraEffect>
```

The list of `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraEffect` to be applied on the camera session.

### frameRateRange

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
var frameRateRange: Range<Int>
```

The desired frame rate range for the camera session.

### isAutoRotationEnabled

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
var isAutoRotationEnabled: Boolean
```

Whether to use auto rotation.

### preferredFeatureGroup

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
var preferredFeatureGroup: List<GroupableFeature>
```

The list of preferred `https://developer.android.com/reference/kotlin/androidx/camera/core/featuregroup/GroupableFeature`, ordered by priority in descending order.

### requiredFeatureGroup

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
var requiredFeatureGroup: Set<GroupableFeature>
```

The set of `https://developer.android.com/reference/kotlin/androidx/camera/core/featuregroup/GroupableFeature` that are mandatory for the camera configuration.

### viewPort

Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

```
var viewPort: ViewPort?
```

The `https://developer.android.com/reference/kotlin/androidx/camera/core/ViewPort` to be applied on the camera session.

Note: Setting this property to `null` is a no-op on the underlying `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig.Builder` because `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig.Builder#setViewPort(androidx.camera.core.ViewPort)` requires a non-null `https://developer.android.com/reference/kotlin/androidx/camera/core/ViewPort`.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig.Builder#setViewPort(androidx.camera.core.ViewPort)` |   |

## Extension functions

### SessionConfigScope.camera2Interop

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/Camera2InteropEx.kt+function:camera2Interop)

```
inline fun SessionConfigScope.camera2Interop(crossinline block: SessionConfigCamera2Interop.() -> Unit): Unit
```

Applies Camera2 options inside a `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfigScope` DSL block.

Configures Camera2 options on the underlying `https://developer.android.com/reference/kotlin/androidx/camera/core/SessionConfig.Builder` within a `sessionConfig { ... }` DSL block.

```kotlin
import androidx.camera.camera2.interop.camera2Interop
import androidx.camera.core.preview
import androidx.camera.core.sessionConfig

val sessionConfig =
    sessionConfig(listOf(preview)) {
        camera2Interop {
            colorSpace = ColorSpace.Named.DISPLAY_P3
            sessionParameter[CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE] = Range(60, 60)
            captureRequest[CaptureRequest.CONTROL_AE_TARGET_FPS_RANGE] = Range(60, 60)
            repeatingCaptureRequestTemplate = CameraDevice.TEMPLATE_PREVIEW
            repeatingCaptureCallback = object : CameraCaptureSession.CaptureCallback() {}
        }
    }
```

| Parameters |
|---|---|
| `crossinline block: https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigCamera2Interop.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | configuration block setting Camera2 options on `https://developer.android.com/reference/kotlin/androidx/camera/camera2/interop/SessionConfigCamera2Interop` |