javax.media
接口 Codec

所有超级接口:
Controls, PlugIn
所有已知子接口:
Effect
所有已知实现类:
BasicCodec

public interface Codec
extends PlugIn

A Codec is a media processing unit that accepts a Buffer object as its input, performs some processing on the input data, and then puts the result in an output Buffer object. It has one input and one output. Typical examples of codecs include audio decoders, video encoders, and effects.

A codec usually works in one of the following modes:

Some restrictions apply to the processing a Codec can perform on its input and output Buffer objects:

从以下版本开始:
JMF 2.0

字段摘要
 
从接口 javax.media.PlugIn 继承的字段
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
方法摘要
 Format[] getSupportedInputFormats()
          Lists all of the input formats that this codec accepts.
 Format[] getSupportedOutputFormats(Format input)
          Lists the output formats that this codec can generate.
 int process(Buffer input, Buffer output)
          Performs the media processing defined by this codec.
 Format setInputFormat(Format format)
          Sets the format of the data to be input to this codec.
 Format setOutputFormat(Format format)
          Sets the format for the data this codec outputs.
 
从接口 javax.media.PlugIn 继承的方法
close, getName, open, reset
 
从接口 javax.media.Controls 继承的方法
getControl, getControls
 

方法详细信息

getSupportedInputFormats

Format[] getSupportedInputFormats()
Lists all of the input formats that this codec accepts.

返回:
An array that contains the supported input Formats.

getSupportedOutputFormats

Format[] getSupportedOutputFormats(Format input)
Lists the output formats that this codec can generate. If input is non-null, this method lists the possible output formats that can be generated from input data of the specified Format. If input is null, this method lists all of the output formats supported by this plug-in.

参数:
input - The Format of the data to be used as input to the plug-in.
返回:
An array that contains the supported output Formats.

setInputFormat

Format setInputFormat(Format format)
Sets the format of the data to be input to this codec.

参数:
format - The Format to be set.
返回:
The Format that was set, which might be the supported Format that most closely matches the one specified. Returns null if the specified Format is not supported and no reasonable match could be found.

setOutputFormat

Format setOutputFormat(Format format)
Sets the format for the data this codec outputs.

参数:
format - The Format to be set.
返回:
The Format that was set, which might be the Format that most closely matched the one specified. Returns null if the specified Format is not supported and no reasonable match could be found.

process

int process(Buffer input,
            Buffer output)
Performs the media processing defined by this codec.

参数:
input - The Buffer that contains the media data to be processed.
output - The Buffer in which to store the processed media data.
返回:
BUFFER_PROCESSED_OK if the processing is successful. Other possible return codes are defined in PlugIn.
另请参见:
PlugIn