DefaultDecoderFactory.Builder


class DefaultDecoderFactory.Builder


A builder for DefaultDecoderFactory instances.

Summary

Public constructors

Builder(context: Context!)

Creates a new Builder.

Public functions

DefaultDecoderFactory!

Creates an instance of DefaultDecoderFactory, using defaults if values are unset.

DefaultDecoderFactory.Builder!

Sets whether decoder dynamic scheduling is enabled.

DefaultDecoderFactory.Builder!
@CanIgnoreReturnValue
setCodecPriority(
    @C.Priority codecPriority: @IntRange(to = C.PRIORITY_MAX) Int
)

Sets the codec priority.

DefaultDecoderFactory.Builder!

Sets whether the decoder can fallback.

DefaultDecoderFactory.Builder!

Sets the Listener.

DefaultDecoderFactory.Builder!

Sets the MediaCodecSelector used when selecting a decoder.

DefaultDecoderFactory.Builder!

Sets whether a device-specific decoder operating rate should be requested.

Public constructors

Builder

Builder(context: Context!)

Creates a new Builder.

Public functions

build

fun build(): DefaultDecoderFactory!

Creates an instance of DefaultDecoderFactory, using defaults if values are unset.

experimentalSetDynamicSchedulingEnabled

@CanIgnoreReturnValue
fun experimentalSetDynamicSchedulingEnabled(
    dynamicSchedulingEnabled: Boolean
): DefaultDecoderFactory.Builder!

Sets whether decoder dynamic scheduling is enabled.

If enabled, the ExoPlayerAssetLoader can change how often the rendering loop for decoders created by this factory is run.

On some devices, setting this to true will feed and drain decoders more frequently, and will lead to improved performance.

The default value is false.

This method is experimental, and will be renamed or removed in a future release.

Parameters
dynamicSchedulingEnabled: Boolean

Whether to enable dynamic scheduling.

setCodecPriority

@CanIgnoreReturnValue
fun setCodecPriority(
    @C.Priority codecPriority: @IntRange(to = C.PRIORITY_MAX) Int
): DefaultDecoderFactory.Builder!

Sets the codec priority.

Specifying codec priority allows the resource manager in the platform to reclaim less important codecs before more important codecs.

It is recommended to use predefined priorities like PRIORITY_PROCESSING_FOREGROUND, PRIORITY_PROCESSING_BACKGROUND or priority values defined relative to those defaults.

This method is a no-op on API versions before 35.

The default value is PRIORITY_PROCESSING_FOREGROUND.

Parameters
@C.Priority codecPriority: @IntRange(to = C.PRIORITY_MAX) Int

The C.Priority for the codec. Should be at most PRIORITY_MAX.

setEnableDecoderFallback

@CanIgnoreReturnValue
fun setEnableDecoderFallback(enableDecoderFallback: Boolean): DefaultDecoderFactory.Builder!

Sets whether the decoder can fallback.

This decides 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.

The default value is false.

setMediaCodecSelector

@CanIgnoreReturnValue
fun setMediaCodecSelector(mediaCodecSelector: MediaCodecSelector!): DefaultDecoderFactory.Builder!

Sets the MediaCodecSelector used when selecting a decoder.

The default value is DEFAULT

setShouldConfigureOperatingRate

@CanIgnoreReturnValue
fun setShouldConfigureOperatingRate(shouldConfigureOperatingRate: Boolean): DefaultDecoderFactory.Builder!

Sets whether a device-specific decoder operating rate should be requested.

This is a best-effort hint to the codec. Setting this to true might improve decoding performance.

The effect of this field will be most noticeable when no other MediaCodec instances are in use.

Defaults to false.

Parameters
shouldConfigureOperatingRate: Boolean

Whether to apply an KEY_OPERATING_RATE configuration to the decoder.