Codec.DecoderFactory


public interface Codec.DecoderFactory

Known direct subclasses
DefaultDecoderFactory

Default implementation of Codec.DecoderFactory that uses MediaCodec for decoding.


A factory for decoder instances.

Summary

Public methods

abstract Codec

Returns a Codec for audio decoding.

abstract Codec
createForVideoDecoding(
    Format format,
    Surface outputSurface,
    boolean requestSdrToneMapping
)

Returns a Codec for video decoding.

Public methods

createForAudioDecoding

abstract Codec createForAudioDecoding(Format format)

Returns a Codec for audio decoding.

Parameters
Format format

The Format (of the input data) used to determine the underlying decoder and its configuration values.

Returns
Codec

A Codec for audio decoding.

Throws
androidx.media3.transformer.ExportException

If no suitable Codec can be created.

createForVideoDecoding

abstract Codec createForVideoDecoding(
    Format format,
    Surface outputSurface,
    boolean requestSdrToneMapping
)

Returns a Codec for video decoding.

Parameters
Format format

The Format (of the input data) used to determine the underlying decoder and its configuration values.

Surface outputSurface

The Surface to which the decoder output is rendered.

boolean requestSdrToneMapping

Whether to request tone-mapping to SDR.

Returns
Codec

A Codec for video decoding.

Throws
androidx.media3.transformer.ExportException

If no suitable Codec can be created.