Interface Codec.EncoderFactory
-
- All Known Implementing Classes:
DefaultEncoderFactory
- Enclosing interface:
- Codec
public static interface Codec.EncoderFactory
A factory for encoder instances.
-
-
Method Summary
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 aCodec
for audio encoding.Codec
createForVideoEncoding(Format format)
Returns aCodec
for video encoding.default boolean
videoNeedsEncoding()
Returns whether the video needs to be encoded because of encoder specific configuration.
-
-
-
Method Detail
-
createForAudioEncoding
Codec createForAudioEncoding(Format format) throws ExportException
Returns aCodec
for audio encoding.The caller should ensure the MIME type is supported on the device before calling this method.
- Parameters:
format
- TheFormat
(of the output data) used to determine the underlying encoder and its configuration values.Format.sampleMimeType
,Format.sampleRate
,Format.channelCount
andFormat.bitrate
are set to those of the desired output video format.- Returns:
- A
Codec
for encoding audio to the requestedMIME type
. - Throws:
ExportException
- If no suitableCodec
can be created.
-
createForVideoEncoding
Codec createForVideoEncoding(Format format) throws ExportException
Returns aCodec
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
- TheFormat
(of the output data) used to determine the underlying encoder and its configuration values.Format.sampleMimeType
,Format.width
andFormat.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 andFormat.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 suitableCodec
can be created.
-
audioNeedsEncoding
default boolean audioNeedsEncoding()
Returns whether the audio needs to be encoded because of encoder specific configuration.
-
videoNeedsEncoding
default boolean videoNeedsEncoding()
Returns whether the video needs to be encoded because of encoder specific configuration.
-
-