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!
@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.

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.

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