@UnstableApi
public interface ImageDecoder extends Decoder

Known direct subclasses
BitmapFactoryImageDecoder

An image decoder that uses BitmapFactory to decode images.

ExternallyLoadedImageDecoder

An ImageDecoder for externally loaded images.


A Decoder implementation for images.

Summary

Nested types

public interface ImageDecoder.Factory

A factory for image decoders.

Public methods

abstract @Nullable ImageOutputBuffer

Returns the next decoded Bitmap in an ImageOutputBuffer.

abstract void

Queues an DecoderInputBuffer to the decoder.

Inherited methods

From androidx.media3.decoder.Decoder
abstract @Nullable I

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

abstract void

Flushes the decoder.

abstract String

Returns the name of the decoder.

abstract void

Releases the decoder.

abstract void
setOutputStartTimeUs(long outputStartTimeUs)

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

Public methods

dequeueOutputBuffer

abstract @Nullable ImageOutputBuffer dequeueOutputBuffer()

Returns the next decoded Bitmap in an ImageOutputBuffer.

Returns
@Nullable ImageOutputBuffer

The output buffer, or null if an output buffer isn't available.

Throws
androidx.media3.exoplayer.image.ImageDecoderException

If a decoder error has occurred.

queueInputBuffer

abstract void queueInputBuffer(DecoderInputBuffer inputBuffer)

Queues an DecoderInputBuffer to the decoder.

Parameters
DecoderInputBuffer inputBuffer

The input buffer containing the byte data corresponding to the image(s).

Throws
androidx.media3.exoplayer.image.ImageDecoderException

If a decoder error has occurred.