Back to Exoplayer

DefaultEncoderFactory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/transformer/DefaultEncoderFactory.html

latest9.6 KB
Original Source

Package com.google.android.exoplayer2.transformer

Class DefaultEncoderFactory

  • java.lang.Object

    • com.google.android.exoplayer2.transformer.DefaultEncoderFactory
  • All Implemented Interfaces:Codec.EncoderFactory


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classDefaultEncoderFactoryextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Codec.EncoderFactory](Codec.EncoderFactory.html "interface in com.google.android.exoplayer2.transformer")

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 of Codec.EncoderFactory.

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static class | DefaultEncoderFactory.Builder | Deprecated.

A builder for DefaultEncoderFactory instances. |

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | DefaultEncoderFactory​(Context context) | Deprecated. Use DefaultEncoderFactory.Builder instead.

| | DefaultEncoderFactory​(Context context, EncoderSelector videoEncoderSelector, boolean enableFallback) | Deprecated. Use DefaultEncoderFactory.Builder instead.

| | DefaultEncoderFactory​(Context context, EncoderSelector videoEncoderSelector, VideoEncoderSettings requestedVideoEncoderSettings, boolean enableFallback) | Deprecated. Use DefaultEncoderFactory.Builder instead.

|

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | DefaultCodec | createForAudioEncoding​(Format format) | Deprecated.

Returns a Codec for audio encoding. | | DefaultCodec | createForVideoEncoding​(Format format) | Deprecated.

Returns a DefaultCodec 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](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public DefaultEncoderFactory​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context)

Deprecated. Use DefaultEncoderFactory.Builder instead.

- 

DefaultEncoderFactory

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public DefaultEncoderFactory​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[EncoderSelector](EncoderSelector.html "interface in com.google.android.exoplayer2.transformer")videoEncoderSelector,
                             boolean enableFallback)

Deprecated. Use DefaultEncoderFactory.Builder instead.

- 

DefaultEncoderFactory

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public DefaultEncoderFactory​([Context](https://developer.android.com/reference/android/content/Context.html "class or interface in android.content")context,[EncoderSelector](EncoderSelector.html "interface in com.google.android.exoplayer2.transformer")videoEncoderSelector,[VideoEncoderSettings](VideoEncoderSettings.html "class in com.google.android.exoplayer2.transformer")requestedVideoEncoderSettings,
                             boolean enableFallback)

Deprecated. Use DefaultEncoderFactory.Builder instead.

Method Detail

- 

createForAudioEncoding

public[DefaultCodec](DefaultCodec.html "class in com.google.android.exoplayer2.transformer")createForAudioEncoding​([Format](../Format.html "class in com.google.android.exoplayer2")format)
                                    throws[ExportException](ExportException.html "class in com.google.android.exoplayer2.transformer")

Deprecated.

Description copied from interface: Codec.EncoderFactory

Returns a Codec for audio encoding.

The caller should ensure the MIME type is supported on the device before calling this method.

Specified by:createForAudioEncoding in interface Codec.EncoderFactoryParameters:format - The Format (of the output data) used to determine the underlying encoder and its configuration values. Format.sampleMimeType, Format.sampleRate, Format.channelCount and Format.bitrate are set to those of the desired output video format.Returns:A Codec for encoding audio to the requested MIME type.Throws:ExportException - If no suitable Codec can be created.

- 

createForVideoEncoding

public[DefaultCodec](DefaultCodec.html "class in com.google.android.exoplayer2.transformer")createForVideoEncoding​([Format](../Format.html "class in com.google.android.exoplayer2")format)
                                    throws[ExportException](ExportException.html "class in com.google.android.exoplayer2.transformer")

Deprecated.

Returns a DefaultCodec for video encoding.

Use DefaultEncoderFactory.Builder.setRequestedVideoEncoderSettings(com.google.android.exoplayer2.transformer.VideoEncoderSettings) with VideoEncoderSettings.bitrate set to request for a specific encoding bitrate. Bitrate settings in Format are ignored when VideoEncoderSettings.bitrate or VideoEncoderSettings.enableHighQualityTargeting is set.

Specified by:createForVideoEncoding in interface Codec.EncoderFactoryParameters:format - The Format (of the output data) used to determine the underlying encoder and its configuration values. Format.sampleMimeType, Format.width and Format.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 and Format.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 suitable Codec 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 interface Codec.EncoderFactory