FileDocCategorySizeDatePackage
Multiplexer.javaAPI DocJMF 2.1.1e5274Mon May 12 12:20:36 BST 2003javax.media

Multiplexer

public interface Multiplexer implements 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.

since
JMF 2.0

Fields Summary
Constructors Summary
Methods Summary
public javax.media.protocol.DataSourcegetDataOutput()
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.

return
The output DataSource for this Multiplexer.

public javax.media.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.

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

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

param inputs An array of the formats of the data to be input to the Multiplexer. If inputs is non-null, then this method lists the output content descriptors supported when the input data is in the specified formats. If inputs is null, this method lists all of the output content descriptors that this Multiplexer supports. & @ return An array of the content descriptors supported by this Multiplexer.

public intprocess(javax.media.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.

param
buffer The Buffer of data to process.
param
trackID The index number of the track to which the input Buffer belongs.
return
BUFFER_PROCESSED_OK If the processing is successful. Other possible return codes are defined in PlugIn.
see
PlugIn

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

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

public javax.media.FormatsetInputFormat(javax.media.Format format, int trackID)
Sets the input Format for the specified track.

param
format The input Format of the specified track.
param
trackID The index number of the track for which the Format is being set.
return
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.

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

param
numTracks The number of input tracks that the input stream contains.
return
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.