# ViewfinderSurfaceSessionScope

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

*** ** * ** ***


```
interface ViewfinderSurfaceSessionScope : CoroutineScope
```

<br />

*** ** * ** ***

A coroutine variant of a `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceSession`.

The scope will generally be active for as long as the surface needs to be written into, so `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceSessionScope#surface()` should not be used outside of this scope.

## Summary

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceSessionScope#request()` The `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest` responsible for this session. |
| `https://developer.android.com/reference/android/view/Surface.html` | `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceSessionScope#surface()` The `https://developer.android.com/reference/android/view/Surface.html` available for this session. |

| ### Inherited properties |
|---|
| From [kotlinx.coroutines.CoroutineScope](https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html) |---|---| | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` | `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/coroutine-context.html` | |

## Public properties

### request

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

```
val request: ViewfinderSurfaceRequest
```

The `https://developer.android.com/reference/kotlin/androidx/camera/viewfinder/core/ViewfinderSurfaceRequest` responsible for this session.

### surface

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

```
val surface: Surface
```

The `https://developer.android.com/reference/android/view/Surface.html` available for this session. Users of this surface should not call `https://developer.android.com/reference/android/view/Surface.html#release()`. It will automatically be closed at some time after this scope has exited.