Codec.EncoderFactory
public interface Codec.EncoderFactory
DefaultEncoderFactory |
A default implementation of |
A factory for encoder instances.
Summary
Public methods |
|
|---|---|
default boolean |
Returns whether the audio needs to be encoded because of encoder specific configuration. |
abstract Codec |
createForAudioEncoding(Returns a |
abstract Codec |
createForVideoEncoding(Returns a |
default boolean |
Returns whether the video needs to be encoded because of encoder specific configuration. |
Public methods
audioNeedsEncoding
default boolean audioNeedsEncoding()
Returns whether the audio needs to be encoded because of encoder specific configuration.
createForAudioEncoding
abstract Codec createForAudioEncoding(
Format format,
@Nullable LogSessionId logSessionId
)
Returns a Codec for audio encoding.
The caller should ensure the MIME type is supported on the device before calling this method.
codecs contains the codec string for the original input media that has been decoded and processed. This is provided only as a hint, and the factory may encode to a different format.
| Parameters | |
|---|---|
Format format |
The |
@Nullable LogSessionId logSessionId |
The optional |
| Throws | |
|---|---|
androidx.media3.transformer.ExportException |
If no suitable |
createForVideoEncoding
abstract Codec createForVideoEncoding(
Format format,
@Nullable LogSessionId logSessionId
)
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.
codecs contains the codec string for the original input media that has been decoded and processed. This is provided only as a hint, and the factory may encode to a different format.
| Parameters | |
|---|---|
Format format |
The |
@Nullable LogSessionId logSessionId |
The optional |
| Throws | |
|---|---|
androidx.media3.transformer.ExportException |
If no suitable |
videoNeedsEncoding
default boolean videoNeedsEncoding()
Returns whether the video needs to be encoded because of encoder specific configuration.