# 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
public final class AsyncFrame
```

<br />

*** ** * ** ***

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

## Summary

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

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

## Public fields

### acquireFence

```
public final @Nullable SyncFenceWrapper acquireFence
```

A sync fence which signals when the `https://developer.android.com/reference/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/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/androidx/media3/common/video/AsyncFrame` is responsible for closing the fence after it has been waited on.

### frame

```
public final Frame frame
```

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

## Public constructors

### AsyncFrame

```
public AsyncFrame(Frame frame, @Nullable SyncFenceWrapper acquireFence)
```

Creates a new instance.