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, List<String> allowedMimeTypes)
Returns aCodec
for audio encoding.Codec
createForVideoEncoding(Format format, List<String> allowedMimeTypes)
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, List<String> allowedMimeTypes) throws TransformationException
Returns aCodec
for audio encoding.This method must validate that the
Codec
is configured to produce one of theallowedMimeTypes
. The sample MIME type given informat
is not necessarily allowed.- Parameters:
format
- TheFormat
(of the output data) used to determine the underlying encoder and its configuration values.allowedMimeTypes
- The non-empty list of allowed output sample MIME types.- Returns:
- A
Codec
for audio encoding. - Throws:
TransformationException
- If no suitableCodec
can be created.
-
createForVideoEncoding
Codec createForVideoEncoding(Format format, List<String> allowedMimeTypes) throws TransformationException
Returns aCodec
for video encoding.This method must validate that the
Codec
is configured to produce one of theallowedMimeTypes
. The sample MIME type given informat
is not necessarily allowed.- 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.rotationDegrees
is 0 andFormat.width
>=
Format.height
, therefore the video is always in landscape orientation.Format.frameRate
is set to the output video's frame rate, if available.allowedMimeTypes
- The non-empty list of allowed output sample MIME types.- Returns:
- A
Codec
for video encoding. - Throws:
TransformationException
- 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.
-
-