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:

  1. A Java int (32 bits) describing the width of the largest image
  2. A Java int (32 bits) describing the height of the largest image
  3. A Java long (64 bits) describing the total duration of the video
  4. One or more "image frames", defined as
    1. A Java long (64 bits) describing the length (in bytes) of the image
    2. A Java long (64 bits) describing the number of nanoseconds to wait before displaying the next image frame
    3. The media data<\LI>

See Also:
MultiImageRenderer, JMFMultiImageRenderer

Constructor Index

 o Handler()
Construct a AbstractPlayer

Method Index

 o doPlayerClose()
Release as many resources as possible
 o doPlayerDeallocate()
Since the media is buffered in the MultiImageRenderer, we don't need to free any resources.
 o doPlayerPrefetch()
Read in each video frame from the stream and call mic.setFrames()
 o doPlayerRealize()
Read in the video header from the stream.
 o doPlayerSetMediaTime(Time)
Set the media time.
 o doPlayerSetRate(float)
Set the rate of the media
 o doPlayerStop()
Stop the MultiImageRenderer
 o doPlayerSyncStart(Time)
Starts the MultiImageRenderer
 o endOfMedia()
To be called when the end of media has been reached.
 o getControlPanelComponent()
Get the control panel Component for this Player.
 o getPlayerDuration()
Get the length of the media from the MultiImageRenderer.
 o getPlayerStartLatency()
Assume that there is no significant latency involved in realizing or prefetching the media.
 o postEvent(ControllerEvent)
Post a ControllerEvent to the ControllerEventQueue.
 o setSource(DataSource)
Set the DataSource for this Player.

Constructors

 o Handler
 public Handler()
Construct a AbstractPlayer

Methods

 o 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
 o getControlPanelComponent
 public Component getControlPanelComponent()
Get the control panel Component for this Player.

Returns:
The control panel Component.
Overrides:
getControlPanelComponent in class AbstractPlayer
 o 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
 o doPlayerPrefetch
 public boolean doPlayerPrefetch()
Read in each video frame from the stream and call mic.setFrames()

Overrides:
doPlayerPrefetch in class AbstractPlayer
 o doPlayerSyncStart
 public boolean doPlayerSyncStart(Time t)
Starts the MultiImageRenderer

Overrides:
doPlayerSyncStart in class AbstractPlayer
 o 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
 o doPlayerStop
 public boolean doPlayerStop()
Stop the MultiImageRenderer

Overrides:
doPlayerStop in class AbstractPlayer
 o doPlayerClose
 public void doPlayerClose()
Release as many resources as possible

Overrides:
doPlayerClose in class AbstractPlayer
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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