# ExternallyLoadedImageDecoder

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/image/ExternallyLoadedImageDecoder.java+class:androidx.media3.exoplayer.image.ExternallyLoadedImageDecoder)

*** ** * ** ***


```
@UnstableApi
class ExternallyLoadedImageDecoder : ImageDecoder
```

<br />

*** ** * ** ***

An `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder` for externally loaded images.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/common/MimeTypes#APPLICATION_EXTERNALLY_LOADED_IMAGE()` |   |

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder.BitmapResolver` The resolver that resolves an external image request to a Bitmap. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder.ExternalImageRequest` A data class providing information about the external image request. |
| `class https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder.Factory : https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder.Factory` A `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoder.Factory` for `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder` instances. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder#dequeueInputBuffer()()` Dequeues the next input buffer to be filled and queued to the decoder. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageOutputBuffer?` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder#dequeueOutputBuffer()()` Returns the next decoded `https://developer.android.com/reference/android/graphics/Bitmap.html` in an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageOutputBuffer`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder#flush()()` Flushes the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder#getName()()` Returns the name of the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder#queueInputBuffer(androidx.media3.decoder.DecoderInputBuffer)(inputBuffer: https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer!)` Queues an `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer` to the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder#release()()` Releases the decoder. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ExternallyLoadedImageDecoder#setOutputStartTimeUs(long)(outputStartTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)` Sets the timestamp from which output buffers should be produced, in microseconds. |

| ### Inherited functions |
|---|
| From [androidx.media3.decoder.Decoder](https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder) |---|---| | `abstract O?` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#dequeueOutputBuffer()()` Dequeues the next output buffer from the decoder. | | `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#queueInputBuffer(I)(inputBuffer: I!)` Queues an input buffer to the decoder. | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#setCallback(androidx.media3.decoder.Decoder.Callback,java.util.concurrent.Executor)(callback: https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder.Callback!, executor: https://developer.android.com/reference/java/util/concurrent/Executor.html!)` Sets the callback and executor. | |

## Public functions

### dequeueInputBuffer

```
fun dequeueInputBuffer(): DecoderInputBuffer?
```

Dequeues the next input buffer to be filled and queued to the decoder.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer?` | The input buffer, which will have been cleared, or null if a buffer isn't available. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder` | If a decoder error has occurred. |

### dequeueOutputBuffer

```
fun dequeueOutputBuffer(): ImageOutputBuffer?
```

Returns the next decoded `https://developer.android.com/reference/android/graphics/Bitmap.html` in an `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageOutputBuffer`.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageOutputBuffer?` | The output buffer, or `null` if an output buffer isn't available. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoderException` | If a decoder error has occurred. |

### flush

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

Flushes the decoder. Ownership of dequeued input buffers is returned to the decoder. The caller is still responsible for releasing any dequeued output buffers.

### getName

```
fun getName(): String!
```

Returns the name of the decoder.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The name of the decoder. |

### queueInputBuffer

```
fun queueInputBuffer(inputBuffer: DecoderInputBuffer!): Unit
```

Queues an `https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer` to the decoder.

| Parameters |
|---|---|
| `inputBuffer: https://developer.android.com/reference/kotlin/androidx/media3/decoder/DecoderInputBuffer!` | The input buffer containing the byte data corresponding to the image(s). |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/image/ImageDecoderException` | If a decoder error has occurred. |

### release

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

Releases the decoder. Must be called when the decoder is no longer needed.

### setOutputStartTimeUs

```
fun setOutputStartTimeUs(outputStartTimeUs: Long): Unit
```

Sets the timestamp from which output buffers should be produced, in microseconds.

Any decoded buffer with a timestamp less than `outputStartTimeUs` should be skipped by the implementation and not made available via `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#dequeueOutputBuffer()`.

This method must only be called before `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#queueInputBuffer(I)` initially or after `https://developer.android.com/reference/kotlin/androidx/media3/decoder/Decoder#flush()`.

| Parameters |
|---|---|
| `outputStartTimeUs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | The time from which output buffer should be produced, in microseconds. |