javax.media
接口 Multiplexer

所有超级接口:
Controls, PlugIn

public interface Multiplexer
extends PlugIn

A Multiplexer is a media processing unit takes input data from multiple tracks, combines the data into an interleaved container format, then outputs the interleaved data through an output DataSource. It typically has multiple inputs and one output. A Multiplexer can also have a single track as input. In this case, multiple tracks don't have to be interleaved, but the Multiplexer might format the output stream with additional data interleaved with the input track.

If a Multiplexer implements the Clock interface, it can be used by a Player as the master time base for synchronization. In this case, the Multiplexer should update the media time and time-base time as it processes the media.

从以下版本开始:
JMF 2.0

字段摘要
 
从接口 javax.media.PlugIn 继承的字段
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
方法摘要
 javax.media.protocol.DataSource getDataOutput()
          Gets the output DataSource from this Multiplexer.
 Format[] getSupportedInputFormats()
          Returns the input formats that this Multiplexer supports.
 javax.media.protocol.ContentDescriptor[] getSupportedOutputContentDescriptors(Format[] inputs)
          Lists the output content-descriptors that this Multiplexer supports.
 int process(Buffer buffer, int trackID)
          Processes the input Buffer and multiplexes it with data from other tracks.
 javax.media.protocol.ContentDescriptor setContentDescriptor(javax.media.protocol.ContentDescriptor outputContentDescriptor)
          Sets the output content-type for this Multiplexer.
 Format setInputFormat(Format format, int trackID)
          Sets the input Format for the specified track.
 int setNumTracks(int numTracks)
          Sets the number of input tracks that the Multiplexer can expect to find in the input stream.
 
从接口 javax.media.PlugIn 继承的方法
close, getName, open, reset
 
从接口 javax.media.Controls 继承的方法
getControl, getControls
 

方法详细信息

getSupportedOutputContentDescriptors

javax.media.protocol.ContentDescriptor[] getSupportedOutputContentDescriptors(Format[] inputs)
Lists the output content-descriptors that this Multiplexer supports.


getSupportedInputFormats

Format[] getSupportedInputFormats()
Returns the input formats that this Multiplexer supports. The Format objects that are returned might be loosely defined. In this case, setInputFormat should be called with a more specific Format to make sure that the desired Format is supported by this Multiplexer.

返回:
An array of Format objects. If no formats are supported, then an array of size zero is returned.

setNumTracks

int setNumTracks(int numTracks)
Sets the number of input tracks that the Multiplexer can expect to find in the input stream.

参数:
numTracks - The number of input tracks that the input stream contains.
返回:
The number of input tracks actually set. This might be less than the number of tracks specified. If the number specified exceeds the number of tracks that the Multiplexer can handle, this method returns the maximum number of tracks supported by the Multiplexer.

setInputFormat

Format setInputFormat(Format format,
                      int trackID)
Sets the input Format for the specified track.

参数:
format - The input Format of the specified track.
trackID - The index number of the track for which the Format is being set.
返回:
The Format preferred by the Multiplexer. This might the same as the specified Format, a more well-defined Format than was specified, or null if the specified Format is not supported by the Multiplexer at all.

process

int process(Buffer buffer,
            int trackID)
Processes the input Buffer and multiplexes it with data from other tracks. The multiplexed output is sent to an output DataSource.

参数:
buffer - The Buffer of data to process.
trackID - The index number of the track to which the input Buffer belongs.
返回:
BUFFER_PROCESSED_OK If the processing is successful. Other possible return codes are defined in PlugIn.
另请参见:
PlugIn

getDataOutput

javax.media.protocol.DataSource getDataOutput()
Gets the output DataSource from this Multiplexer. The DataSource is returned in the connected state. The returned DataSource can be a push or pull DataSource--Push[Pull]DataSource or Push[Pull]BufferDataSource.

返回:
The output DataSource for this Multiplexer.

setContentDescriptor

javax.media.protocol.ContentDescriptor setContentDescriptor(javax.media.protocol.ContentDescriptor outputContentDescriptor)
Sets the output content-type for this Multiplexer.

参数:
outputContentDescriptor - A ContentDescriptor that describes the content-type of the data to be output by the Multiplexer.
返回:
The content descriptor that most closely matches the specified content descriptor or null if the specified content descriptor cannot be set.