Class MovieDecoder
java.lang.Object
org.web3d.vrml.renderer.common.input.movie.MovieDecoder
- All Implemented Interfaces:
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
Nested ClassesModifier and TypeClassDescriptionstatic interface
This is the base class for actions performed on the processor.class
This thread class consumes the action queue and executes actions on the processor.class
This action rewinds the processor and starts it playing.class
This action class sets the playback rate.class
This action starts the processor running.class
This action class stops a running processor. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMovieDecoder
(VideoStreamHandler videoStreamHandler) Constructor for the MovieDecoder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
controllerUpdate
(javax.media.ControllerEvent event) Callback for controller events.void
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.
-
Field Details
-
REALIZED
public final int REALIZED- See Also:
-
STARTED
public final int STARTED- See Also:
-
REWOUND
public final int REWOUND- See Also:
-
TIMESET
public final int TIMESET- See Also:
-
ALLSTATES
public final int ALLSTATES- See Also:
-
-
Constructor Details
-
MovieDecoder
Constructor for the MovieDecoder. Call init() after construction with a URL.- Parameters:
videoStreamHandler
- - handler to be called with each video frame.
-
-
Method Details
-
init
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 interfacejavax.media.ControllerListener
- Parameters:
event
- - describes the nature of the state change.
-