org.llama.jmf
Class JMFVideoImage

java.lang.Object
  extended by com.jme.image.Image
      extended by org.llama.jmf.JMFVideoImage
All Implemented Interfaces:
com.jme.util.export.Savable, java.io.Serializable, javax.media.ControllerListener, ByteBufferRendererListener

public class JMFVideoImage
extends com.jme.image.Image
implements ByteBufferRendererListener, javax.media.ControllerListener

The Class JMFVideoImage.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.image.Image
com.jme.image.Image.Format
 
Field Summary
static int SCALE_FIT
          The Constant SCALE_FIT.
static int SCALE_MAXIMIZE
          The Constant SCALE_MAXIMIZE.
static int SCALE_NONE
          The Constant SCALE_NONE.
 
Constructor Summary
JMFVideoImage(java.lang.String filename, boolean loop, int scalemethod)
          Instantiates a new JMF video image.
JMFVideoImage(java.net.URL url, boolean loop, int scalemethod)
          Instantiates a new JMF video image.
 
Method Summary
 void controllerUpdate(javax.media.ControllerEvent evt)
           
 void frame(java.nio.ByteBuffer buffer)
          Frame.
 javax.media.Time getDuration()
          Gets the duration.
 javax.media.Time getMediaTime()
          Gets the media time.
 float getSoundVolumeLevel()
          Gets the sound volume level.
 void getSpeed(float rate)
          Gets the speed.
 int getVideoHeight()
          Gets the video height.
 int getVideoWidth()
          Gets the video width.
 boolean isFlipped()
          Checks if is flipped.
 boolean isMute()
          Checks if is mute.
 void restart()
          Restart.
 void seek(javax.media.Time time)
          Seek.
 void setMute(boolean isMute)
          Sets the mute.
 void setSize(int videowidth, int videoheight, javax.media.format.RGBFormat format)
          Sets the size.
 void setSoundVolumeLevel(float level)
          Sets the sound volume level.
 void setSpeed(float rate)
          Sets the speed.
 void setTime(javax.media.Time time)
          Sets the time.
 void startMovie()
          Start movie.
 void startsFrom(double seconds)
          Starts from.
 void stopMovie()
          Stop movie.
 boolean update(com.jme.image.Texture texture)
          Update.
 boolean update(com.jme.image.Texture texture, boolean syncToFrameRate)
          Update.
 void waitSome(int time)
          Wait some.
 
Methods inherited from class com.jme.image.Image
addData, equals, getClassTag, getData, getData, getDepth, getEstimatedByteSize, getFormat, getHeight, getMipMapSizes, getWidth, hasMipmaps, read, setData, setData, setData, setDepth, setFormat, setHeight, setMipMapSizes, setWidth, write
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALE_FIT

public static final int SCALE_FIT
The Constant SCALE_FIT.

See Also:
Constant Field Values

SCALE_MAXIMIZE

public static final int SCALE_MAXIMIZE
The Constant SCALE_MAXIMIZE.

See Also:
Constant Field Values

SCALE_NONE

public static final int SCALE_NONE
The Constant SCALE_NONE.

See Also:
Constant Field Values
Constructor Detail

JMFVideoImage

public JMFVideoImage(java.lang.String filename,
                     boolean loop,
                     int scalemethod)
              throws javax.media.NoPlayerException,
                     javax.media.CannotRealizeException,
                     java.net.MalformedURLException,
                     java.io.IOException
Instantiates a new JMF video image.

Parameters:
filename - the filename
loop - the loop
scalemethod - the scalemethod
Throws:
javax.media.NoPlayerException - the no player exception
javax.media.CannotRealizeException - the cannot realize exception
java.net.MalformedURLException - the malformed url exception
java.io.IOException - Signals that an I/O exception has occurred.

JMFVideoImage

public JMFVideoImage(java.net.URL url,
                     boolean loop,
                     int scalemethod)
              throws javax.media.NoPlayerException,
                     javax.media.CannotRealizeException,
                     java.io.IOException
Instantiates a new JMF video image.

Parameters:
url - the url
loop - the loop
scalemethod - the scalemethod
Throws:
javax.media.NoPlayerException - the no player exception
javax.media.CannotRealizeException - the cannot realize exception
java.io.IOException - Signals that an I/O exception has occurred.
Method Detail

controllerUpdate

public void controllerUpdate(javax.media.ControllerEvent evt)
Specified by:
controllerUpdate in interface javax.media.ControllerListener

frame

public void frame(java.nio.ByteBuffer buffer)
Description copied from interface: ByteBufferRendererListener
Frame.

Specified by:
frame in interface ByteBufferRendererListener
Parameters:
buffer - the buffer

getDuration

public javax.media.Time getDuration()
Gets the duration.

Returns:
the duration

getMediaTime

public javax.media.Time getMediaTime()
Gets the media time.

Returns:
the media time

getSoundVolumeLevel

public float getSoundVolumeLevel()
Gets the sound volume level.

Returns:
the sound volume level

getSpeed

public void getSpeed(float rate)
Gets the speed.

Parameters:
rate - the rate

getVideoHeight

public int getVideoHeight()
Gets the video height.

Returns:
the video height

getVideoWidth

public int getVideoWidth()
Gets the video width.

Returns:
the video width

isFlipped

public boolean isFlipped()
Checks if is flipped.

Returns:
true, if is flipped

isMute

public boolean isMute()
Checks if is mute.

Returns:
true, if is mute

restart

public void restart()
Restart.


seek

public void seek(javax.media.Time time)
Seek.

Parameters:
time - the time

setMute

public void setMute(boolean isMute)
Sets the mute.

Parameters:
isMute - the new mute

setSize

public void setSize(int videowidth,
                    int videoheight,
                    javax.media.format.RGBFormat format)
Description copied from interface: ByteBufferRendererListener
Sets the size.

Specified by:
setSize in interface ByteBufferRendererListener
Parameters:
videowidth - the videowidth
videoheight - the videoheight
format - the format

setSoundVolumeLevel

public void setSoundVolumeLevel(float level)
Sets the sound volume level.

Parameters:
level - the new sound volume level

setSpeed

public void setSpeed(float rate)
Sets the speed.

Parameters:
rate - the new speed

setTime

public void setTime(javax.media.Time time)
Sets the time.

Parameters:
time - the new time

startMovie

public void startMovie()
Start movie.


startsFrom

public void startsFrom(double seconds)
Starts from.

Parameters:
seconds - the seconds

stopMovie

public void stopMovie()
Stop movie.


update

public boolean update(com.jme.image.Texture texture)
Update.

Parameters:
texture - the texture
Returns:
true, if successful

update

public boolean update(com.jme.image.Texture texture,
                      boolean syncToFrameRate)
Update.

Parameters:
texture - Texture to update
syncToFrameRate - Wait till the frame is updated before updating the texture.
Returns:
true if the texture was updated

waitSome

public void waitSome(int time)
Wait some.

Parameters:
time - the time