All Packages Class Hierarchy This Package Previous Next Index
Class ejmf.toolkit.media.content.video.multi_image.Handler
java.lang.Object
|
+----ejmf.toolkit.media.AbstractClock
|
+----ejmf.toolkit.media.AbstractController
|
+----ejmf.toolkit.media.AbstractPlayer
|
+----ejmf.toolkit.media.content.video.multi_image.Handler
- public class Handler
- extends AbstractPlayer
This class provides a Player for the .mti (multi-image) format.
It uses a MultiImageRenderer to display the media.
The format specification for .mti is as follows:
- A Java int (32 bits) describing the width of the largest
image
- A Java int (32 bits) describing the height of the largest
image
- A Java long (64 bits) describing the total duration of the
video
- One or more "image frames", defined as
- A Java long (64 bits) describing the length (in bytes) of
the image
- A Java long (64 bits) describing the number of nanoseconds
to wait before displaying the next image frame
- The media data<\LI>
- See Also:
- MultiImageRenderer, JMFMultiImageRenderer
-
Handler()
- Construct a AbstractPlayer
-
doPlayerClose()
- Release as many resources as possible
-
doPlayerDeallocate()
- Since the media is buffered in the MultiImageRenderer, we
don't need to free any resources.
-
doPlayerPrefetch()
- Read in each video frame from the stream and call
mic.setFrames()
-
doPlayerRealize()
- Read in the video header from the stream.
-
doPlayerSetMediaTime(Time)
- Set the media time.
-
doPlayerSetRate(float)
- Set the rate of the media
-
doPlayerStop()
- Stop the MultiImageRenderer
-
doPlayerSyncStart(Time)
- Starts the MultiImageRenderer
-
endOfMedia()
- To be called when the end of media has been reached.
-
getControlPanelComponent()
- Get the control panel Component for this Player.
-
getPlayerDuration()
- Get the length of the media from the MultiImageRenderer.
-
getPlayerStartLatency()
- Assume that there is no significant latency involved in
realizing or prefetching the media.
-
postEvent(ControllerEvent)
- Post a ControllerEvent to the ControllerEventQueue.
-
setSource(DataSource)
- Set the DataSource for this Player.
Handler
public Handler()
- Construct a AbstractPlayer
setSource
public void setSource(DataSource source) throws IncompatibleSourceException
- Set the DataSource for this Player.
- Parameters:
- source
- The DataSource to try
- Throws: IncompatibleSourceException
- If the DataSource is not a PullDataSource or
does not contain valid streams.
- Overrides:
- setSource in class AbstractPlayer
getControlPanelComponent
public Component getControlPanelComponent()
- Get the control panel Component for this Player.
- Returns:
- The control panel Component.
- Overrides:
- getControlPanelComponent in class AbstractPlayer
doPlayerRealize
public boolean doPlayerRealize()
- Read in the video header from the stream. This will tell
us how big to make the video component.
- Overrides:
- doPlayerRealize in class AbstractPlayer
doPlayerPrefetch
public boolean doPlayerPrefetch()
- Read in each video frame from the stream and call
mic.setFrames()
- Overrides:
- doPlayerPrefetch in class AbstractPlayer
doPlayerSyncStart
public boolean doPlayerSyncStart(Time t)
- Starts the MultiImageRenderer
- Overrides:
- doPlayerSyncStart in class AbstractPlayer
doPlayerDeallocate
public boolean doPlayerDeallocate()
- Since the media is buffered in the MultiImageRenderer, we
don't need to free any resources. Set the media time to 0
and return.
- Overrides:
- doPlayerDeallocate in class AbstractPlayer
doPlayerStop
public boolean doPlayerStop()
- Stop the MultiImageRenderer
- Overrides:
- doPlayerStop in class AbstractPlayer
doPlayerClose
public void doPlayerClose()
- Release as many resources as possible
- Overrides:
- doPlayerClose in class AbstractPlayer
doPlayerSetRate
public float doPlayerSetRate(float rate)
- Set the rate of the media
- Parameters:
- rate
- The desired rate
- Returns:
- The actual rate set. For a MultiImageRenderer,
this will be equal to the desired rate.
- Overrides:
- doPlayerSetRate in class AbstractPlayer
doPlayerSetMediaTime
public void doPlayerSetMediaTime(Time t)
- Set the media time. The time is first converted to
nanoseconds and then set in the MultiImageRenderer.
- Parameters:
- t
- The time to set
- Overrides:
- doPlayerSetMediaTime in class AbstractPlayer
getPlayerStartLatency
public Time getPlayerStartLatency()
- Assume that there is no significant latency involved in
realizing or prefetching the media.
- Returns:
- A Time of zero nanoseconds.
- Overrides:
- getPlayerStartLatency in class AbstractPlayer
getPlayerDuration
public Time getPlayerDuration()
- Get the length of the media from the MultiImageRenderer.
The duration is taken from the MultiImageRenderer in
nanoseconds and converted into a Time object.
- Returns:
- A Time object representing the duration of
the media.
- Overrides:
- getPlayerDuration in class AbstractPlayer
postEvent
protected void postEvent(ControllerEvent e)
- Post a ControllerEvent to the ControllerEventQueue. This
method is re-implemented here to allow all classes within
this package to post ControllerEvents.
- Parameters:
- e
-
- Overrides:
- postEvent in class AbstractController
endOfMedia
protected void endOfMedia() throws ClockStoppedException
- To be called when the end of media has been reached.
- Throws: ClockStoppedException
- If the Clock is stopped when this method is
called.
- Overrides:
- endOfMedia in class AbstractPlayer
All Packages Class Hierarchy This Package Previous Next Index