Codec.DecoderFactory


interface Codec.DecoderFactory

Known direct subclasses
DefaultDecoderFactory

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


A factory for decoder instances.

Summary

Public functions

Codec!

Returns a Codec for audio decoding.

Codec!
createForVideoDecoding(
    format: Format!,
    outputSurface: Surface!,
    requestSdrToneMapping: Boolean
)

Returns a Codec for video decoding.

Public functions

createForAudioDecoding

fun createForAudioDecoding(format: Format!): Codec!

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

fun createForVideoDecoding(
    format: Format!,
    outputSurface: Surface!,
    requestSdrToneMapping: Boolean
): Codec!

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.

outputSurface: Surface!

The Surface to which the decoder output is rendered.

requestSdrToneMapping: Boolean

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.