docs/doc/reference/com/google/android/exoplayer2/transformer/Codec.EncoderFactory.html
Package com.google.android.exoplayer2.transformer
DefaultEncoderFactoryEnclosing interface:Codecpublic static interfaceCodec.EncoderFactory
A factory for encoder instances.
All Methods Instance Methods Abstract Methods Default Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| default boolean | audioNeedsEncoding() |
Returns whether the audio needs to be encoded because of encoder specific configuration.
|
| Codec | createForAudioEncoding(Format format) |
Returns a Codec for audio encoding.
|
| Codec | createForVideoEncoding(Format format) |
Returns a Codec for video encoding.
|
| default boolean | videoNeedsEncoding() |
Returns whether the video needs to be encoded because of encoder specific configuration.
|
-
[Codec](Codec.html "interface 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")
Returns a Codec for audio encoding.
The caller should ensure the MIME type is supported on the device before calling this method.
Parameters: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.
-
[Codec](Codec.html "interface 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")
Returns a Codec for video encoding.
The caller should ensure the MIME type is supported on the device before calling this method. If encoding to HDR, the caller should also ensure the color characteristics are supported.
Parameters: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.
-
default boolean audioNeedsEncoding()
Returns whether the audio needs to be encoded because of encoder specific configuration.
-
default boolean videoNeedsEncoding()
Returns whether the video needs to be encoded because of encoder specific configuration.