Class DefaultEncoderFactory.Builder
- java.lang.Object
-
- com.google.android.exoplayer2.transformer.DefaultEncoderFactory.Builder
-
- Enclosing class:
- DefaultEncoderFactory
public static final class DefaultEncoderFactory.Builder extends Object
A builder forDefaultEncoderFactory
instances.
-
-
Constructor Summary
Constructors Constructor Description Builder(Context context)
Creates a newDefaultEncoderFactory.Builder
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultEncoderFactory
build()
Creates an instance ofDefaultEncoderFactory
, using defaults if values are unset.DefaultEncoderFactory.Builder
setEnableFallback(boolean enableFallback)
Sets whether the encoder can fallback.DefaultEncoderFactory.Builder
setRequestedVideoEncoderSettings(VideoEncoderSettings requestedVideoEncoderSettings)
Sets the requestedVideoEncoderSettings
.DefaultEncoderFactory.Builder
setVideoEncoderSelector(EncoderSelector videoEncoderSelector)
Sets the videoEncoderSelector
.
-
-
-
Constructor Detail
-
Builder
public Builder(Context context)
Creates a newDefaultEncoderFactory.Builder
.
-
-
Method Detail
-
setVideoEncoderSelector
@CanIgnoreReturnValue public DefaultEncoderFactory.Builder setVideoEncoderSelector(EncoderSelector videoEncoderSelector)
Sets the videoEncoderSelector
.The default value is
EncoderSelector.DEFAULT
.
-
setRequestedVideoEncoderSettings
@CanIgnoreReturnValue public DefaultEncoderFactory.Builder setRequestedVideoEncoderSettings(VideoEncoderSettings requestedVideoEncoderSettings)
Sets the requestedVideoEncoderSettings
.Values in
requestedVideoEncoderSettings
may be ignored to improve encoding quality and/or reduce failures.VideoEncoderSettings.profile
andVideoEncoderSettings.level
are ignored forMimeTypes.VIDEO_H264
. Consider implementingCodec.EncoderFactory
if such adjustments are unwanted.requestedVideoEncoderSettings
should be handled with care because there is no fallback support for it. For example, using incompatibleVideoEncoderSettings.profile
andVideoEncoderSettings.level
can cause codec configuration failure. Setting an unsupportedVideoEncoderSettings.bitrateMode
may cause encoder instantiation failure.The default value is
VideoEncoderSettings.DEFAULT
.
-
setEnableFallback
@CanIgnoreReturnValue public DefaultEncoderFactory.Builder setEnableFallback(boolean enableFallback)
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 theCodec
with it. The fallback process may change the requestedMIME type
, resolution,bitrate
,profile/level
etc.The default value is
true
.
-
build
public DefaultEncoderFactory build()
Creates an instance ofDefaultEncoderFactory
, using defaults if values are unset.
-
-