Codec.EncoderFactory
interface Codec.EncoderFactory
DefaultEncoderFactory |
A default implementation of |
A factory for encoder instances.
Summary
Public functions |
|
|---|---|
Boolean |
Returns whether the audio needs to be encoded because of encoder specific configuration. |
Codec! |
createForAudioEncoding(format: Format!, logSessionId: LogSessionId?)Returns a |
Codec! |
createForVideoEncoding(format: Format!, logSessionId: LogSessionId?)Returns a |
Boolean |
@ExperimentalApiReturns whether the requested video |
Boolean |
Returns whether the video needs to be encoded because of encoder specific configuration. |
Public functions
audioNeedsEncoding
fun audioNeedsEncoding(): Boolean
Returns whether the audio needs to be encoded because of encoder specific configuration.
createForAudioEncoding
fun createForAudioEncoding(format: Format!, logSessionId: LogSessionId?): Codec!
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 |
logSessionId: LogSessionId? |
The optional |
| Throws | |
|---|---|
androidx.media3.transformer.ExportException |
If no suitable |
createForVideoEncoding
fun createForVideoEncoding(format: Format!, logSessionId: LogSessionId?): Codec!
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: Format! |
The |
logSessionId: LogSessionId? |
The optional |
| Throws | |
|---|---|
androidx.media3.transformer.ExportException |
If no suitable |
isVideoFormatSupported
@ExperimentalApi
fun isVideoFormatSupported(format: Format!): Boolean
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
fun videoNeedsEncoding(): Boolean
Returns whether the video needs to be encoded because of encoder specific configuration.