javax.media
Interface Multiplexer


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.

Since:
JMF 2.0

Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Method Summary
 DataSource getDataOutput()
          Gets the output DataSource from this Multiplexer.
 Format[] getSupportedInputFormats()
          Returns the input formats that this Multiplexer supports.
 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.
 ContentDescriptor setContentDescriptor(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.
 
Methods inherited from interface javax.media.PlugIn
close, getName, open, reset
 
Methods inherited from interface javax.media.Controls
getControl, getControls
 

Method Detail

getSupportedOutputContentDescriptors

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

getSupportedInputFormats

public 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.
Returns:
An array of Format objects. If no formats are supported, then an array of size zero is returned.

setNumTracks

public int setNumTracks(int numTracks)
Sets the number of input tracks that the Multiplexer can expect to find in the input stream.
Parameters:
numTracks - The number of input tracks that the input stream contains.
Returns:
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

public Format setInputFormat(Format format,
                             int trackID)
Sets the input Format for the specified track.
Parameters:
format - The input Format of the specified track.
trackID - The index number of the track for which the Format is being set.
Returns:
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

public 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.
Parameters:
buffer - The Buffer of data to process.
trackID - The index number of the track to which the input Buffer belongs.
Returns:
BUFFER_PROCESSED_OK If the processing is successful. Other possible return codes are defined in PlugIn.
See Also:
PlugIn

getDataOutput

public 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.
Returns:
The output DataSource for this Multiplexer.

setContentDescriptor

public ContentDescriptor setContentDescriptor(ContentDescriptor outputContentDescriptor)
Sets the output content-type for this Multiplexer.
Parameters:
outputContentDescriptor - A ContentDescriptor that describes the content-type of the data to be output by the Multiplexer.
Returns:
The content descriptor that most closely matches the specified content descriptor or null if the specified content descriptor cannot be set.


Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.