Class DefaultEncoderFactory
- java.lang.Object
-
- com.google.android.exoplayer2.transformer.DefaultEncoderFactory
-
- All Implemented Interfaces:
Codec.EncoderFactory
@Deprecated public final class DefaultEncoderFactory extends Object implements Codec.EncoderFactory
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.A default implementation ofCodec.EncoderFactory
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultEncoderFactory.Builder
Deprecated.A builder forDefaultEncoderFactory
instances.
-
Constructor Summary
Constructors Constructor Description DefaultEncoderFactory(Context context)
Deprecated.UseDefaultEncoderFactory.Builder
instead.DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, boolean enableFallback)
Deprecated.UseDefaultEncoderFactory.Builder
instead.DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, VideoEncoderSettings requestedVideoEncoderSettings, boolean enableFallback)
Deprecated.UseDefaultEncoderFactory.Builder
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DefaultCodec
createForAudioEncoding(Format format)
Deprecated.Returns aCodec
for audio encoding.DefaultCodec
createForVideoEncoding(Format format)
Deprecated.Returns aDefaultCodec
for video encoding.boolean
videoNeedsEncoding()
Deprecated.Returns whether the video needs to be encoded because of encoder specific configuration.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.transformer.Codec.EncoderFactory
audioNeedsEncoding
-
-
-
-
Constructor Detail
-
DefaultEncoderFactory
@Deprecated public DefaultEncoderFactory(Context context)
Deprecated.UseDefaultEncoderFactory.Builder
instead.
-
DefaultEncoderFactory
@Deprecated public DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, boolean enableFallback)
Deprecated.UseDefaultEncoderFactory.Builder
instead.
-
DefaultEncoderFactory
@Deprecated public DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, VideoEncoderSettings requestedVideoEncoderSettings, boolean enableFallback)
Deprecated.UseDefaultEncoderFactory.Builder
instead.
-
-
Method Detail
-
createForAudioEncoding
public DefaultCodec createForAudioEncoding(Format format) throws ExportException
Deprecated.Description copied from interface:Codec.EncoderFactory
Returns aCodec
for audio encoding.The caller should ensure the MIME type is supported on the device before calling this method.
- Specified by:
createForAudioEncoding
in interfaceCodec.EncoderFactory
- Parameters:
format
- TheFormat
(of the output data) used to determine the underlying encoder and its configuration values.Format.sampleMimeType
,Format.sampleRate
,Format.channelCount
andFormat.bitrate
are set to those of the desired output video format.- Returns:
- A
Codec
for encoding audio to the requestedMIME type
. - Throws:
ExportException
- If no suitableCodec
can be created.
-
createForVideoEncoding
public DefaultCodec createForVideoEncoding(Format format) throws ExportException
Deprecated.Returns aDefaultCodec
for video encoding.Use
DefaultEncoderFactory.Builder.setRequestedVideoEncoderSettings(com.google.android.exoplayer2.transformer.VideoEncoderSettings)
withVideoEncoderSettings.bitrate
set to request for a specific encoding bitrate. Bitrate settings inFormat
are ignored whenVideoEncoderSettings.bitrate
orVideoEncoderSettings.enableHighQualityTargeting
is set.- Specified by:
createForVideoEncoding
in interfaceCodec.EncoderFactory
- Parameters:
format
- TheFormat
(of the output data) used to determine the underlying encoder and its configuration values.Format.sampleMimeType
,Format.width
andFormat.height
are set to those of the desired output video format.Format.frameRate
is set to the requested output frame rate, if available.Format.colorInfo
is set to the requested output color characteristics, if available.Format.rotationDegrees
is 0 andFormat.width
>=
Format.height
, therefore the video is always in landscape orientation.- Returns:
- A
Codec
for encoding video to the requested MIME type. - Throws:
ExportException
- If no suitableCodec
can be created.
-
videoNeedsEncoding
public boolean videoNeedsEncoding()
Deprecated.Description copied from interface:Codec.EncoderFactory
Returns whether the video needs to be encoded because of encoder specific configuration.- Specified by:
videoNeedsEncoding
in interfaceCodec.EncoderFactory
-
-