DefaultDecoderFactory


@UnstableApi
class DefaultDecoderFactory : Codec.DecoderFactory


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

Summary

Nested types

A builder for DefaultDecoderFactory instances.

Listener for decoder factory events.

Public functions

DefaultCodec!
createForAudioDecoding(format: Format!, logSessionId: LogSessionId?)

Returns a Codec for audio decoding.

DefaultCodec!
createForVideoDecoding(
    format: Format!,
    outputSurface: Surface!,
    requestSdrToneMapping: Boolean,
    logSessionId: LogSessionId?
)

Returns a Codec for video decoding.

Public functions

createForAudioDecoding

fun createForAudioDecoding(format: Format!, logSessionId: LogSessionId?): DefaultCodec!

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.

logSessionId: LogSessionId?

The optional LogSessionId of the android.media.metrics.EditingSession.

Returns
DefaultCodec!

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,
    logSessionId: LogSessionId?
): DefaultCodec!

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.

logSessionId: LogSessionId?

The optional LogSessionId of the android.media.metrics.EditingSession.

Returns
DefaultCodec!

A Codec for video decoding.

Throws
androidx.media3.transformer.ExportException

If no suitable Codec can be created.