|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A 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:
Demultiplexer doesn't support the type of DataSource specified (push or
pull). Demultiplexer requires a positionable DataSource.Demultiplexer requires a seekable, random-access stream.
(For example, the QuickTime Demultiplexer has this requirement.)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.
| Fields inherited from interface javax.media.PlugIn |
BUFFER_PROCESSED_FAILED,
BUFFER_PROCESSED_OK,
INPUT_BUFFER_NOT_CONSUMED,
OUTPUT_BUFFER_NOT_FILLED,
PLUGIN_TERMINATED |
| Fields inherited from interface javax.media.Duration |
DURATION_UNBOUNDED,
DURATION_UNKNOWN |
| Method Summary | |
Time |
getDuration()
Gets the duration of this media stream when played at the default rate. |
Time |
getMediaTime()
Gets the current media time. |
ContentDescriptor[] |
getSupportedInputContentDescriptors()
Lists the all of the input content descriptors that this Demultiplexer supports. |
Track[] |
getTracks()
Retrieves the individual tracks that the media stream contains. |
boolean |
isPositionable()
Checks whether or not the stream can be repositioned to the beginning. |
boolean |
isRandomAccess()
Checks whether or not the stream can be positioned at any Time. |
Time |
setPosition(Time where,
int rounding)
Sets the stream position (media time) to the specified Time. |
void |
start()
Signals that data is going to start being read from the Demultiplexer. |
void |
stop()
Signals that data is going to stop being read from the Demultiplexer. |
| Methods inherited from interface javax.media.PlugIn |
close,
getName,
open,
reset |
| Methods inherited from interface javax.media.MediaHandler |
setSource |
| Methods inherited from interface javax.media.Controls |
getControl,
getControls |
| Method Detail |
public ContentDescriptor[] getSupportedInputContentDescriptors()
Demultiplexer supports.
public void start()
throws java.io.IOException
Demultiplexer.
The start method is called before any calls are made to readFrame.DataSource.public void stop()
Demultiplexer.
After the stop method is called, readFrame will not be called again unless
start is called first.
public Track[] getTracks()
throws java.io.IOException,
BadHeaderException
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).
Track objects. The length of the array
is equal to the number of tracks in the stream.DataSource.public boolean isPositionable()
true if the stream can be repositioned, false if it cannot.public boolean isRandomAccess()
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.true if the stream is a random access stream, false if it is not.
public Time setPosition(Time where,
int rounding)
Time.
Returns the rounded position that was actually set.
Implementations should set the position to a key frame, if possible.time - The new stream position, specified as a Time.round - The rounding technique to be used: RoundUp, RoundDown, or RoundNearest.Time object.public Time getMediaTime()
readFrame will read.Time object.public Time getDuration()
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.
Time object that represents the duration
or DURATION_UNKNOWN if the duration cannot be determined.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||