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 classDefaultEncoderFactory.BuilderDeprecated.A builder forDefaultEncoderFactoryinstances.
-
Constructor Summary
Constructors Constructor Description DefaultEncoderFactory(Context context)Deprecated.UseDefaultEncoderFactory.Builderinstead.DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, boolean enableFallback)Deprecated.UseDefaultEncoderFactory.Builderinstead.DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, VideoEncoderSettings requestedVideoEncoderSettings, boolean enableFallback)Deprecated.UseDefaultEncoderFactory.Builderinstead.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DefaultCodeccreateForAudioEncoding(Format format)Deprecated.Returns aCodecfor audio encoding.DefaultCodeccreateForVideoEncoding(Format format)Deprecated.Returns aDefaultCodecfor video encoding.booleanvideoNeedsEncoding()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.Builderinstead.
-
DefaultEncoderFactory
@Deprecated public DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, boolean enableFallback)
Deprecated.UseDefaultEncoderFactory.Builderinstead.
-
DefaultEncoderFactory
@Deprecated public DefaultEncoderFactory(Context context, EncoderSelector videoEncoderSelector, VideoEncoderSettings requestedVideoEncoderSettings, boolean enableFallback)
Deprecated.UseDefaultEncoderFactory.Builderinstead.
-
-
Method Detail
-
createForAudioEncoding
public DefaultCodec createForAudioEncoding(Format format) throws ExportException
Deprecated.Description copied from interface:Codec.EncoderFactoryReturns aCodecfor audio encoding.The caller should ensure the MIME type is supported on the device before calling this method.
- Specified by:
createForAudioEncodingin interfaceCodec.EncoderFactory- Parameters:
format- TheFormat(of the output data) used to determine the underlying encoder and its configuration values.Format.sampleMimeType,Format.sampleRate,Format.channelCountandFormat.bitrateare set to those of the desired output video format.- Returns:
- A
Codecfor encoding audio to the requestedMIME type. - Throws:
ExportException- If no suitableCodeccan be created.
-
createForVideoEncoding
public DefaultCodec createForVideoEncoding(Format format) throws ExportException
Deprecated.Returns aDefaultCodecfor video encoding.Use
DefaultEncoderFactory.Builder.setRequestedVideoEncoderSettings(com.google.android.exoplayer2.transformer.VideoEncoderSettings)withVideoEncoderSettings.bitrateset to request for a specific encoding bitrate. Bitrate settings inFormatare ignored whenVideoEncoderSettings.bitrateorVideoEncoderSettings.enableHighQualityTargetingis set.- Specified by:
createForVideoEncodingin interfaceCodec.EncoderFactory- Parameters:
format- TheFormat(of the output data) used to determine the underlying encoder and its configuration values.Format.sampleMimeType,Format.widthandFormat.heightare set to those of the desired output video format.Format.frameRateis set to the requested output frame rate, if available.Format.colorInfois set to the requested output color characteristics, if available.Format.rotationDegreesis 0 andFormat.width>=Format.height, therefore the video is always in landscape orientation.- Returns:
- A
Codecfor encoding video to the requested MIME type. - Throws:
ExportException- If no suitableCodeccan be created.
-
videoNeedsEncoding
public boolean videoNeedsEncoding()
Deprecated.Description copied from interface:Codec.EncoderFactoryReturns whether the video needs to be encoded because of encoder specific configuration.- Specified by:
videoNeedsEncodingin interfaceCodec.EncoderFactory
-
-