javax.media
Interface Codec

All Known Subinterfaces:
Effect

public abstract interface Codec
extends PlugIn

A codec is a timed-media processing unit with one input and one output.
Typical codecs are audio decoders, video encoders or effects.
The codec accepts a Buffer object in its input, does some processing and puts the result in the output Buffer object.

The codec usually works in one of the following modes:

Some restriction applies to the manipulation a Codec might perform on the input and output Buffer objects:

Since:
JMF 2.0

Fields inherited from class javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED
 
Method Summary
 Format[] getSupportedInputFormats()
          Lists the possible input formats supported by this plug-in.
 Format[] getSupportedOutputFormats(Format input)
          Lists the possible output formats of the processed data.
 int process(Buffer input, Buffer output)
          Processes the media data.
 Format setInputFormat(Format format)
          Sets the data input format.
 Format setOutputFormat(Format format)
          Sets the data output format.
 
Methods inherited from interface javax.media.PlugIn
close, getName, open, reset
 
Methods inherited from interface javax.media.Controls
getControl, getControls
 

Method Detail

getSupportedInputFormats

public Format[] getSupportedInputFormats()
Lists the possible input formats supported by this plug-in.

getSupportedOutputFormats

public Format[] getSupportedOutputFormats(Format input)
Lists the possible output formats of the processed data. If input is non-null, then it lists the possible output formats given that the input data is of the format specified by input. If input is null, then it lists all possible output formats that this plug-in advertises.

setInputFormat

public Format setInputFormat(Format format)
Sets the data input format.
Returns:
null if the format is not supported. Otherwise returns a format that most closely matches the specified one.

setOutputFormat

public Format setOutputFormat(Format format)
Sets the data output format.
Returns:
null if the format is not supported. Otherwise returns a format that most closely matches the specified one.

process

public int process(Buffer input,
                   Buffer output)
Processes the media data.
Returns:
BUFFER_PROCESSED_OK if the processing is successful. Other possible return codes are defined in PlugIn.
See Also:
PlugIn