Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.renderer.common.input.movie
Class MovieDecoder

java.lang.Object
  extended by org.web3d.vrml.renderer.common.input.movie.MovieDecoder
All Implemented Interfaces:
javax.media.ControllerListener

public class MovieDecoder
extends java.lang.Object
implements javax.media.ControllerListener

This class wraps an instance of the JMF Processor class. It decodes a mpeg video stream and sends the audio and video frames to the handlers specified at creation time.

Version:
$Revision: 1.8 $
Author:
Guy Carpenter

Nested Class Summary
static interface MovieDecoder.Action
          This is the base class for actions performed on the processor.
 class MovieDecoder.ControlThread
          This thread class consumes the action queue and executes actions on the processor.
 class MovieDecoder.RewindAction
          This action rewinds the processor and starts it playing.
 class MovieDecoder.SetRateAction
           
 class MovieDecoder.StartAction
          This action starts the processor running.
 class MovieDecoder.StopAction
          This action class stops a running processor.
 
Field Summary
 int ALLSTATES
           
 int REALIZED
           
 int REWOUND
           
 int STARTED
           
 int TIMESET
           
 
Constructor Summary
MovieDecoder(VideoStreamHandler videoStreamHandler)
          Constructor for the MovieDecoder.
 
Method Summary
 void controllerUpdate(javax.media.ControllerEvent event)
          Callback for controller events.
 void init(java.lang.String mediaFile)
          Initializes the decoder.
 void rewind()
          Stops, Rewinds and Restarts the processor.
 void setRate(float speed)
          Sets the speed (rate) of playout.
 void start()
          Starts the processor running.
 void stop()
          Stops the processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REALIZED

public final int REALIZED
See Also:
Constant Field Values

STARTED

public final int STARTED
See Also:
Constant Field Values

REWOUND

public final int REWOUND
See Also:
Constant Field Values

TIMESET

public final int TIMESET
See Also:
Constant Field Values

ALLSTATES

public final int ALLSTATES
See Also:
Constant Field Values
Constructor Detail

MovieDecoder

public MovieDecoder(VideoStreamHandler videoStreamHandler)
Constructor for the MovieDecoder. Call init() after construction with a URL.

Parameters:
videoStreamHandler - - handler to be called with each video frame.
Method Detail

init

public void init(java.lang.String mediaFile)
Initializes the decoder. The file will be opened, decoding will start, and the first frame of the movie will be sent to the handlers.

Parameters:
mediaFile - - the URL of the media file to be loaded

start

public void start()
Starts the processor running. This call queues an asynchronous request which may not be acted on immediately.


stop

public void stop()
Stops the processor. This call queues an asynchronous request which may not be acted upon immediately


rewind

public void rewind()
Stops, Rewinds and Restarts the processor. This call queues an asynchronous request which may not be acted upon immediately


setRate

public void setRate(float speed)
Sets the speed (rate) of playout. In theory negative values are allowed, but may not be supported by the player.

Parameters:
speed - - playback rate scale factor. 1.0 is normal speed.

controllerUpdate

public void controllerUpdate(javax.media.ControllerEvent event)
Callback for controller events. This method is called by the processor whenever state changes.

Specified by:
controllerUpdate in interface javax.media.ControllerListener
Parameters:
event - - describes the nature of the state change.

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium