# PacketConsumerUtil

Artifact: [androidx.media3:media3-effect](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/effect/PacketConsumerUtil.kt+class:androidx.media3.effect.PacketConsumerUtil)

*** ** * ** ***

<br />

```
@ExperimentalApi
public static class PacketConsumerUtil
```

<br />

*** ** * ** ***

## Summary

| ### Public fields |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/media3/effect/PacketConsumerUtil` | `https://developer.android.com/reference/androidx/media3/effect/PacketConsumerUtil#INSTANCE()` |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/java/lang/Void.html>` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/media3/effect/PacketConsumerUtil#release(androidx.media3.effect.PacketConsumer,java.util.concurrent.Executor)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/media3/effect/PacketConsumer<@https://developer.android.com/reference/androidx/annotation/NonNull T> consumer, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor )` Releases the `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer` from Java by wrapping the suspend call in a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html`. |

## Public fields

### INSTANCE

```
public static @NonNull PacketConsumerUtil INSTANCE
```

## Public methods

### release

```
public static final @NonNull ListenableFuture<Void> <T extends Object> release(
    @NonNull PacketConsumer<@NonNull T> consumer,
    @NonNull Executor executor
)
```

Releases the `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer` from Java by wrapping the suspend call in a `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/media3/effect/PacketConsumer<@https://developer.android.com/reference/androidx/annotation/NonNull T> consumer` | The `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer` to release. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html executor` | The `https://developer.android.com/reference/java/util/concurrent/Executor.html` to launch the coroutine on. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html<https://developer.android.com/reference/java/lang/Void.html>` | A `https://guava.dev/releases/snapshot-android/api/docs/com/google/common/util/concurrent/ListenableFuture.html` that completes when the consumer has been released. |