# MediaCodecAdapter

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

*** ** * ** ***


```
@UnstableApi
interface MediaCodecAdapter
```

<br />

Known direct subclasses [ForwardingMediaCodecAdapter](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/ForwardingMediaCodecAdapter), [SynchronousMediaCodecAdapter](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/SynchronousMediaCodecAdapter)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/ForwardingMediaCodecAdapter` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter` instance that forwards all calls to its delegate. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/SynchronousMediaCodecAdapter` | A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter` that operates the underlying `https://developer.android.com/reference/android/media/MediaCodec.html` in synchronous mode. |

*** ** * ** ***

Abstracts `https://developer.android.com/reference/android/media/MediaCodec.html` operations.

`MediaCodecAdapter` offers a common interface to interact with a `https://developer.android.com/reference/android/media/MediaCodec.html` regardless of the mode the `https://developer.android.com/reference/android/media/MediaCodec.html` is operating in.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Configuration` Configuration parameters for a `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter`. |
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.Factory` A factory for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter` instances. |
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.OnBufferAvailableListener` Listener to be called when an input or output buffer becomes available. |
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.OnFrameRenderedListener` Listener to be called when an output frame has rendered on the output surface. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#dequeueInputBufferIndex()()` Returns the next available input buffer index from the underlying `https://developer.android.com/reference/android/media/MediaCodec.html` or `https://developer.android.com/reference/android/media/MediaCodec.html#INFO_TRY_AGAIN_LATER` if no such buffer exists. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#dequeueOutputBufferIndex(android.media.MediaCodec.BufferInfo)(bufferInfo: https://developer.android.com/reference/android/media/MediaCodec.BufferInfo.html!)` Returns the next available output buffer index from the underlying `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 35) https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#detachOutputSurface()()` Detaches the current output surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#flush()()` Flushes the adapter and the underlying `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://developer.android.com/reference/java/nio/ByteBuffer.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getInputBuffer(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns a writable ByteBuffer object for a dequeued input buffer index. |
| `https://developer.android.com/reference/android/os/PersistableBundle.html!` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getMetrics()()` Returns metrics data about the current codec instance. |
| `https://developer.android.com/reference/java/nio/ByteBuffer.html?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getOutputBuffer(int)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns a read-only ByteBuffer for a dequeued output buffer index. |
| `https://developer.android.com/reference/android/media/MediaFormat.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getOutputFormat()()` Gets the `https://developer.android.com/reference/android/media/MediaFormat.html` that was output from the `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#needsReconfiguration()()` Whether the adapter needs to be reconfigured before it is used. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#queueInputBuffer(int,int,int,long,int)( index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, size: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Submit an input buffer for decoding. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#queueSecureInputBuffer(int,int,androidx.media3.decoder.CryptoInfo,long,int)( index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, offset: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, info: https://developer.android.com/reference/kotlin/androidx/media3/decoder/CryptoInfo!, presentationTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, flags: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Submit an input buffer that is potentially encrypted for decoding. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#registerOnBufferAvailableListener(androidx.media3.exoplayer.mediacodec.MediaCodecAdapter.OnBufferAvailableListener)( listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.OnBufferAvailableListener! )` Registers a listener that will be called when an input or output buffer becomes available. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#release()()` Releases the adapter and the underlying `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#releaseOutputBuffer(int,boolean)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, render: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Returns the buffer to the `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#releaseOutputBuffer(int,long)(index: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, renderTimeStampNs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Updates the output buffer's surface timestamp and sends it to the `https://developer.android.com/reference/android/media/MediaCodec.html` to render it on the output surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#setOnFrameRenderedListener(androidx.media3.exoplayer.mediacodec.MediaCodecAdapter.OnFrameRenderedListener,android.os.Handler)( listener: https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter.OnFrameRenderedListener!, handler: https://developer.android.com/reference/android/os/Handler.html! )` Registers a callback to be invoked when an output frame is rendered on the output surface. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#setOutputSurface(android.view.Surface)(surface: https://developer.android.com/reference/android/view/Surface.html!)` Dynamically sets the output surface of a `https://developer.android.com/reference/android/media/MediaCodec.html`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#setParameters(android.os.Bundle)(params: https://developer.android.com/reference/android/os/Bundle.html!)` Communicate additional parameter changes to the `https://developer.android.com/reference/android/media/MediaCodec.html` instance. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#setVideoScalingMode(int)(@https://developer.android.com/reference/kotlin/androidx/media3/common/C.VideoScalingMode scalingMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Specifies the scaling mode to use, if a surface was specified when the codec was created. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 31) https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#subscribeToVendorParameters(java.util.List<java.lang.String>)(names: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` Subscribe to vendor parameters, so that these parameters will be present in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getOutputFormat()` and changes to these parameters generate output format change event. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 31) https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#unsubscribeFromVendorParameters(java.util.List<java.lang.String>)(names: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!)` Unsubscribe from vendor parameters, so that these parameters will not be present in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getOutputFormat()` and changes to these parameters no longer generate output format change event. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `<E : https://developer.android.com/reference/java/lang/Exception.html?> https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#useBuffer(androidx.media3.common.util.ThrowingRunnable<E>)(runnable: https://developer.android.com/reference/kotlin/androidx/media3/common/util/ThrowingRunnable<E!>!)` Uses an acquired input or output buffer (e.g. to read from or write data to it). |

## Public functions

### dequeueInputBufferIndex

```
fun dequeueInputBufferIndex(): Int
```

Returns the next available input buffer index from the underlying `https://developer.android.com/reference/android/media/MediaCodec.html` or `https://developer.android.com/reference/android/media/MediaCodec.html#INFO_TRY_AGAIN_LATER` if no such buffer exists.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If the underlying `https://developer.android.com/reference/android/media/MediaCodec.html` raised an error. |

### dequeueOutputBufferIndex

```
fun dequeueOutputBufferIndex(bufferInfo: MediaCodec.BufferInfo!): Int
```

Returns the next available output buffer index from the underlying `https://developer.android.com/reference/android/media/MediaCodec.html`. If the next available output is a MediaFormat change, it will return `https://developer.android.com/reference/android/media/MediaCodec.html#INFO_OUTPUT_FORMAT_CHANGED` and you should call `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getOutputFormat()` to get the format. If there is no available output, this method will return `https://developer.android.com/reference/android/media/MediaCodec.html#INFO_TRY_AGAIN_LATER`.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException.html` | If the underlying `https://developer.android.com/reference/android/media/MediaCodec.html` raised an error. |

### detachOutputSurface

```
@RequiresApi(value = 35)
fun detachOutputSurface(): Unit
```

Detaches the current output surface.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#detachOutputSurface()` |   |

### flush

```
fun flush(): Unit
```

Flushes the adapter and the underlying `https://developer.android.com/reference/android/media/MediaCodec.html`.

### getInputBuffer

```
fun getInputBuffer(index: Int): ByteBuffer?
```

Returns a writable ByteBuffer object for a dequeued input buffer index.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#getInputBuffer(int)` |   |

### getMetrics

```
@RequiresApi(value = 26)
fun getMetrics(): PersistableBundle!
```

Returns metrics data about the current codec instance.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#getMetrics()` |   |

### getOutputBuffer

```
fun getOutputBuffer(index: Int): ByteBuffer?
```

Returns a read-only ByteBuffer for a dequeued output buffer index.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#getOutputBuffer(int)` |   |

### getOutputFormat

```
fun getOutputFormat(): MediaFormat!
```

Gets the `https://developer.android.com/reference/android/media/MediaFormat.html` that was output from the `https://developer.android.com/reference/android/media/MediaCodec.html`.

Call this method if a previous call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#dequeueOutputBufferIndex(android.media.MediaCodec.BufferInfo)` returned `https://developer.android.com/reference/android/media/MediaCodec.html#INFO_OUTPUT_FORMAT_CHANGED`.

### needsReconfiguration

```
fun needsReconfiguration(): Boolean
```

Whether the adapter needs to be reconfigured before it is used.

### queueInputBuffer

```
fun queueInputBuffer(
    index: Int,
    offset: Int,
    size: Int,
    presentationTimeUs: Long,
    flags: Int
): Unit
```

Submit an input buffer for decoding.

The `index` must be an input buffer index that has been obtained from a previous call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#dequeueInputBufferIndex()`.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#queueInputBuffer(int, int, int, long, int)` |   |

### queueSecureInputBuffer

```
fun queueSecureInputBuffer(
    index: Int,
    offset: Int,
    info: CryptoInfo!,
    presentationTimeUs: Long,
    flags: Int
): Unit
```

Submit an input buffer that is potentially encrypted for decoding.

The `index` must be an input buffer index that has been obtained from a previous call to `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#dequeueInputBufferIndex()`.

This method behaves like `https://developer.android.com/reference/android/media/MediaCodec.html#queueSecureInputBuffer(int, int, android.media.MediaCodec.CryptoInfo, long, int)`, with the difference that `info` is of type `https://developer.android.com/reference/kotlin/androidx/media3/decoder/CryptoInfo` and not `https://developer.android.com/reference/android/media/MediaCodec.CryptoInfo.html`.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#queueSecureInputBuffer(int, int, android.media.MediaCodec.CryptoInfo, long, int)` |   |

### registerOnBufferAvailableListener

```
fun registerOnBufferAvailableListener(
    listener: MediaCodecAdapter.OnBufferAvailableListener!
): Boolean
```

Registers a listener that will be called when an input or output buffer becomes available.

Returns false if listener was not successfully registered for callbacks.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether listener was successfully registered. |

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.Callback.html#onInputBufferAvailable(android.media.MediaCodec, int)` |   |
| `https://developer.android.com/reference/android/media/MediaCodec.Callback.html#onOutputBufferAvailable(android.media.MediaCodec, int, android.media.MediaCodec.BufferInfo)` |   |

### release

```
fun release(): Unit
```

Releases the adapter and the underlying `https://developer.android.com/reference/android/media/MediaCodec.html`.

### releaseOutputBuffer

```
fun releaseOutputBuffer(index: Int, render: Boolean): Unit
```

Returns the buffer to the `https://developer.android.com/reference/android/media/MediaCodec.html`. If the `https://developer.android.com/reference/android/media/MediaCodec.html` was configured with an output surface, setting `render` to `true` will first send the buffer to the output surface. The surface will release the buffer back to the codec once it is no longer used/displayed.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#releaseOutputBuffer(int, boolean)` |   |

### releaseOutputBuffer

```
fun releaseOutputBuffer(index: Int, renderTimeStampNs: Long): Unit
```

Updates the output buffer's surface timestamp and sends it to the `https://developer.android.com/reference/android/media/MediaCodec.html` to render it on the output surface. If the `https://developer.android.com/reference/android/media/MediaCodec.html` is not configured with an output surface, this call will simply return the buffer to the `https://developer.android.com/reference/android/media/MediaCodec.html`.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#releaseOutputBuffer(int, long)` |   |

### setOnFrameRenderedListener

```
fun setOnFrameRenderedListener(
    listener: MediaCodecAdapter.OnFrameRenderedListener!,
    handler: Handler!
): Unit
```

Registers a callback to be invoked when an output frame is rendered on the output surface.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#setOnFrameRenderedListener(android.media.MediaCodec.OnFrameRenderedListener, android.os.Handler)` |   |

### setOutputSurface

```
fun setOutputSurface(surface: Surface!): Unit
```

Dynamically sets the output surface of a `https://developer.android.com/reference/android/media/MediaCodec.html`.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#setOutputSurface(android.view.Surface)` |   |

### setParameters

```
fun setParameters(params: Bundle!): Unit
```

Communicate additional parameter changes to the `https://developer.android.com/reference/android/media/MediaCodec.html` instance.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#setParameters(android.os.Bundle)` |   |

### setVideoScalingMode

```
fun setVideoScalingMode(@C.VideoScalingMode scalingMode: Int): Unit
```

Specifies the scaling mode to use, if a surface was specified when the codec was created.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#setVideoScalingMode(int)` |   |

### subscribeToVendorParameters

```
@RequiresApi(value = 31)
fun subscribeToVendorParameters(names: (Mutable)List<String!>!): Unit
```

Subscribe to vendor parameters, so that these parameters will be present in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getOutputFormat()` and changes to these parameters generate output format change event.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#subscribeToVendorParameters(java.util.List&lt;java.lang.String&gt;)` |   |

### unsubscribeFromVendorParameters

```
@RequiresApi(value = 31)
fun unsubscribeFromVendorParameters(names: (Mutable)List<String!>!): Unit
```

Unsubscribe from vendor parameters, so that these parameters will not be present in `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#getOutputFormat()` and changes to these parameters no longer generate output format change event.

| See also |
|---|---|
| `https://developer.android.com/reference/android/media/MediaCodec.html#unsubscribeFromVendorParameters(java.util.List&lt;java.lang.String&gt;)` |   |

### useBuffer

```
fun <E : Exception?> useBuffer(runnable: ThrowingRunnable<E!>!): Unit
```

Uses an acquired input or output buffer (e.g. to read from or write data to it).

This can be used for error handling, e.g. to guarantee no operation can invalidate the buffer while it's being used by the application or downstream components.

| Parameters |
|---|---|
| `<E : https://developer.android.com/reference/java/lang/Exception.html?>` | The type of exception thrown by `runnable`. |
| `runnable: https://developer.android.com/reference/kotlin/androidx/media3/common/util/ThrowingRunnable<E!>!` | The `https://developer.android.com/reference/kotlin/androidx/media3/common/util/ThrowingRunnable` utilizing an acquired buffer. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/mediacodec/MediaCodecAdapter#useBuffer(androidx.media3.common.util.ThrowingRunnable<E>)` | If `runnable` throws an exception. |