DefaultDecoderFactory
@UnstableApi
class DefaultDecoderFactory : Codec.DecoderFactory
Default implementation of Codec.DecoderFactory that uses MediaCodec for decoding.
Summary
Nested types |
|---|
|
A builder for |
interface DefaultDecoderFactory.ListenerListener for decoder factory events. |
Public constructors |
|---|
This function is deprecated. Use |
This function is deprecated. Use |
Public functions |
|
|---|---|
DefaultCodec! |
createForAudioDecoding(format: Format!, logSessionId: LogSessionId?)Returns a |
DefaultCodec! |
createForVideoDecoding(Returns a |
Boolean |
Returns whether decoder dynamic scheduling is enabled. |
Public constructors
DefaultDecoderFactory
DefaultDecoderFactory(
context: Context!,
enableDecoderFallback: Boolean,
listener: DefaultDecoderFactory.Listener!
)
Creates a new factory that selects the most preferred decoder, optionally falling back to less preferred decoders if initialization fails.
| Parameters | |
|---|---|
context: Context! |
The context. |
enableDecoderFallback: Boolean |
Whether to enable fallback to lower-priority decoders if decoder initialization fails. This may result in using a decoder that is less efficient or slower than the primary decoder. |
listener: DefaultDecoderFactory.Listener! |
Listener for codec initialization errors. |
Public functions
createForAudioDecoding
fun createForAudioDecoding(format: Format!, logSessionId: LogSessionId?): DefaultCodec!
Returns a Codec for audio decoding.
| Parameters | |
|---|---|
format: Format! |
The |
logSessionId: LogSessionId? |
The optional |
| Returns | |
|---|---|
DefaultCodec! |
A |
| Throws | |
|---|---|
androidx.media3.transformer.ExportException |
If no suitable |
createForVideoDecoding
fun createForVideoDecoding(
format: Format!,
outputSurface: Surface!,
requestSdrToneMapping: Boolean,
logSessionId: LogSessionId?
): DefaultCodec!
Returns a Codec for video decoding.
| Parameters | |
|---|---|
format: Format! |
The |
outputSurface: Surface! |
The |
requestSdrToneMapping: Boolean |
Whether to request tone-mapping to SDR. |
logSessionId: LogSessionId? |
The optional |
| Returns | |
|---|---|
DefaultCodec! |
A |
| Throws | |
|---|---|
androidx.media3.transformer.ExportException |
If no suitable |
isDynamicSchedulingEnabled
fun isDynamicSchedulingEnabled(): Boolean
Returns whether decoder dynamic scheduling is enabled.