Demultiplexerpublic interface Demultiplexer implements MediaHandler, Duration, PlugInA Demultiplexer is a media processing unit that
takes an interleaved media stream as input, extracts the individual tracks from the stream,
and outputs the resulting tracks. It has one input and multiple outputs.
A Demultiplexer is a MediaHandler and needs to
implement the setSource method. This method
should throw an IncompatibleSourceException if the
Demultiplexer cannot use the specified DataSource .
This typically happens if:
- The
Demultiplexer doesn't support the type of DataSource specified (push or
pull).
- The
Demultiplexer requires a positionable DataSource .
- The
Demultiplexer requires a seekable, random-access stream.
(For example, the QuickTime Demultiplexer has this requirement.)
The setSource method should throw an IOException if the specified
DataSource contains a null stream array.
Note: No data is read by the setSource method.
When trying to select a Demultiplexer for a particular content-type from a
list of Demultiplexer implementations obtained through the PlugInManager ,
the Processor picks the first
Demultiplexer that doesn't for throw an
IncompatibleSourceException or an
IOException when setSource is called.
If a particular Demultiplexer reads some
data from the stream and then throws an IncompatibleSourceException ,
the next Demultiplexer in the list gets the stream in a different state. |
Methods Summary |
---|
public javax.media.Time | getDuration()Gets the duration of this media stream
when played at the default rate.
Note that each track can have a different duration and a
different start time. This method returns
the total duration from when the first track starts and the last track ends.
| public javax.media.Time | getMediaTime()Gets the current media time. This is the stream position that the next readFrame will read.
| public javax.media.protocol.ContentDescriptor[] | getSupportedInputContentDescriptors()Lists the all of the input content descriptors that this Demultiplexer supports.
| public javax.media.Track[] | getTracks()
Retrieves the individual tracks that the media stream contains.
A stream can contain multiple media tracks, such as separate tracks for
audio, video, and midi data. The information specific to a track
is abstracted by an instance of a class that implements the Track interface.
The Track interface also provides methods for enabling or disabling
a track.
When getTracks is called, the stream header is read and
parsed (if there is one), the track information is retrieved,
the maximum frame size for each track is computed, and
the play list is built (if applicable).
| public boolean | isPositionable()Checks whether or not the stream can be repositioned
to the beginning.
| public boolean | isRandomAccess()Checks whether or not the stream can be positioned at any Time .
If isRandomAccess returns true , then the stream is also positionable (isPositionable returns true ).
However, a stream can be positionable but not random access--the isPositionable method might return true even
if isRandomAccess returns false .
| public javax.media.Time | setPosition(javax.media.Time where, int rounding)Sets the stream position (media time) to the specified Time .
Returns the rounded position that was actually set.
Implementations should set the position to a key frame, if possible.
| public void | start()Signals that data is going to start being read from the Demultiplexer .
The start method is called before any calls are made to readFrame .
| public void | stop()Signals that data is going to stop being read from the Demultiplexer .
After the stop method is called, readFrame will not be called again unless
start is called first.
|
|