# AsyncFrame

Artifact: [androidx.media3:media3-common](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/common/video/AsyncFrame.java+class:androidx.media3.common.video.AsyncFrame)

*** ** * ** ***


```
@ExperimentalApi
class AsyncFrame
```

<br />

*** ** * ** ***

A data class storing a `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame` and a `https://developer.android.com/reference/kotlin/androidx/media3/common/video/SyncFenceWrapper` that must be waited on before accessing the frame's data.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#AsyncFrame(androidx.media3.common.video.Frame,androidx.media3.common.video.SyncFenceWrapper)(frame: https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame!, acquireFence: https://developer.android.com/reference/kotlin/androidx/media3/common/video/SyncFenceWrapper?)` Creates a new instance. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/video/SyncFenceWrapper?` | `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#acquireFence()` A sync fence which signals when the `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#frame()` can be used. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame!` | `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#frame()` The underlying `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame`. |

## Public constructors

### AsyncFrame

```
AsyncFrame(frame: Frame!, acquireFence: SyncFenceWrapper?)
```

Creates a new instance.

## Public properties

### acquireFence

```
val acquireFence: SyncFenceWrapper?
```

A sync fence which signals when the `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#frame()` can be used.

If this fence is set, the consumer must wait on the fence before reading or writing from the `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame#frame()` underlying data.

See [SyncFence](https://developer.android.com/reference/android/hardware/SyncFence).

The consumer of this `https://developer.android.com/reference/kotlin/androidx/media3/common/video/AsyncFrame` is responsible for closing the fence after it has been waited on.

### frame

```
val frame: Frame!
```

The underlying `https://developer.android.com/reference/kotlin/androidx/media3/common/video/Frame`.