DefaultEncoderFactory
@UnstableApi
public final class DefaultEncoderFactory implements Codec.EncoderFactory
A default implementation of Codec.EncoderFactory.
Summary
Nested types |
|---|
public final class DefaultEncoderFactory.BuilderA builder for |
Public methods |
|
|---|---|
boolean |
Returns whether the audio needs to be encoded because of encoder specific configuration. |
DefaultEncoderFactory.Builder |
Returns a |
DefaultCodec |
createForAudioEncoding(Returns a |
DefaultCodec |
createForVideoEncoding(Returns a |
boolean |
isVideoFormatSupported(Format requestedFormat)Returns whether the requested video |
boolean |
Returns whether the video needs to be encoded because of encoder specific configuration. |
Public methods
audioNeedsEncoding
public boolean audioNeedsEncoding()
Returns whether the audio needs to be encoded because of encoder specific configuration.
buildUpon
public DefaultEncoderFactory.Builder buildUpon()
Returns a Builder initialized with the values of this instance.
createForAudioEncoding
public DefaultCodec 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.
| Parameters | |
|---|---|
Format format |
The |
@Nullable LogSessionId logSessionId |
The optional |
| Returns | |
|---|---|
DefaultCodec |
| Throws | |
|---|---|
androidx.media3.transformer.ExportException |
If no suitable |
createForVideoEncoding
public DefaultCodec createForVideoEncoding(
Format format,
@Nullable LogSessionId logSessionId
)
Returns a DefaultCodec for video encoding.
Use setRequestedVideoEncoderSettings with bitrate set to request for a specific encoding bitrate. Bitrate settings in Format are ignored when bitrate is set.
isVideoFormatSupported
public boolean isVideoFormatSupported(Format requestedFormat)
Returns whether the requested video Format is supported by the encoder factory.
This is an experimental API and is currently being used for FrameWriter specifically.
videoNeedsEncoding
public boolean videoNeedsEncoding()
Returns whether the video needs to be encoded because of encoder specific configuration.