DefaultEncoderFactory.Builder


class DefaultEncoderFactory.Builder


A builder for DefaultEncoderFactory instances.

Summary

Public constructors

Builder(context: Context!)

Creates a new Builder.

Public functions

DefaultEncoderFactory!

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

DefaultEncoderFactory.Builder!

Sets whether the encoder can fallback.

DefaultEncoderFactory.Builder!

Sets the requested VideoEncoderSettings.

DefaultEncoderFactory.Builder!

Sets the video EncoderSelector.

Public constructors

Builder

Builder(context: Context!)

Creates a new Builder.

Public functions

build

fun build(): DefaultEncoderFactory!

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

setEnableFallback

@CanIgnoreReturnValue
fun setEnableFallback(enableFallback: Boolean): DefaultEncoderFactory.Builder!

Sets whether the encoder can fallback.

With format fallback enabled, when the requested Format is not supported, DefaultEncoderFactory finds a format that is supported by the device and configures the Codec with it. The fallback process may change the requested MIME type, resolution, bitrate, profile/level etc.

The default value is true.

setRequestedVideoEncoderSettings

@CanIgnoreReturnValue
fun setRequestedVideoEncoderSettings(
    requestedVideoEncoderSettings: VideoEncoderSettings!
): DefaultEncoderFactory.Builder!

Sets the requested VideoEncoderSettings.

Values in requestedVideoEncoderSettings may be ignored to improve encoding quality and/or reduce failures.

profile and level are ignored for VIDEO_H264. Consider implementing Codec.EncoderFactory if such adjustments are unwanted.

requestedVideoEncoderSettings should be handled with care because there is no fallback support for it. For example, using incompatible profile and level can cause codec configuration failure. Setting an unsupported bitrateMode may cause encoder instantiation failure.

The default value is DEFAULT.

setVideoEncoderSelector

@CanIgnoreReturnValue
fun setVideoEncoderSelector(videoEncoderSelector: EncoderSelector!): DefaultEncoderFactory.Builder!

Sets the video EncoderSelector.

The default value is DEFAULT.