# PacketProcessor

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/PacketProcessor.kt+class:androidx.media3.effect.PacketProcessor)

*** ** * ** ***


```
@ExperimentalApi
public interface PacketProcessor<I extends Object, O extends Object> extends PacketConsumer<@NonNull I>
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer` that processes `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer.Packet`s and forwards them to a downstream `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer`.

This interface is experimental and will be renamed or removed in a future release.

| Parameters |
|---|---|
| `<I extends https://developer.android.com/reference/java/lang/Object.html>` | The type of the input packets. |
| `<O extends https://developer.android.com/reference/java/lang/Object.html>` | The type of the output packets. |

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `https://developer.android.com/reference/androidx/media3/effect/PacketProcessor#setOutput(androidx.media3.effect.PacketConsumer)(@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 O> output)` Sets the output `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer` that will receive the processed packets. |

### Inherited methods

From [androidx.media3.effect.PacketConsumer](https://developer.android.com/reference/androidx/media3/effect/PacketConsumer) `abstract void` `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer#queuePacket(androidx.media3.effect.PacketConsumer.Packet)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/media3/effect/PacketConsumer.Packet<@https://developer.android.com/reference/androidx/annotation/NonNull I> packet)`

Queues a `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer.Packet` for processing, suspending the caller if the consumer is at capacity.
`abstract void` `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer#release()()`

Releases all resources.

## Public methods

### setOutput

```
abstract void setOutput(@NonNull PacketConsumer<@NonNull O> output)
```

Sets the output `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer` that will receive the processed packets.

| 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 O> output` | The `https://developer.android.com/reference/androidx/media3/effect/PacketConsumer` for the output packets. |