jmcvideo
Class JMCMovie

java.lang.Object
  extended by processing.core.PImage
      extended by jmcvideo.JMC
          extended by jmcvideo.JMCMovie
All Implemented Interfaces:
com.sun.media.jmc.event.BufferDownloadListener, com.sun.media.jmc.event.VideoRendererListener, java.lang.Cloneable, java.util.EventListener, processing.core.PConstants

public class JMCMovie
extends JMC

JMCMovie provides methods to load a movie into a PImage pixel buffer.


Field Summary
 
Fields inherited from class jmcvideo.JMC
bounces, bounceStart, bounceStop, bufferedImage, forward, h, imageType, isBouncing, numBounces, pixelFormat, progress, rate, stopVideoAfterBouncing, vh, vw, w, x, y
 
Fields inherited from class processing.core.PImage
cacheMap, format, height, modified, mx1, mx2, my1, my2, parent, pixels, saveImageFormats, width
 
Fields inherited from interface processing.core.PConstants
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z
 
Constructor Summary
JMCMovie(processing.core.PApplet parent, java.io.File file, int pixelFormat)
          Creates an instance of JMCVideo by loading a movie from a specified file.
JMCMovie(processing.core.PApplet parent, java.lang.String filename, int pixelFormat)
          Creates an instance of JMCMovie by loading a movie from a file in the data directory with the specified filename.
JMCMovie(processing.core.PApplet parent, java.net.URI uri, int pixelFormat)
          Creates an instance of JMCMovie by loading a movie with the specified URI.
JMCMovie(processing.core.PApplet parent, java.net.URL url, int pixelFormat)
          Creates an instance of JMCMovie by loading a movie with the specified URL.
 
Method Summary
 void centerImage()
          Draws the image across the center of the parent canvas, preserving the original aspect ratio of the video.
 void centerImage(float inset)
          Draws the image across the center of the parent canvas, preserving the original aspect ratio of the video.
 void frameImage()
          Draws the image across the entire bounds of the parent canvas.
 void frameImage(float inset)
          Draws the image across the entire bounds, minus a specified inset, of the parent canvas.
 void image()
          Draws the image within the previously set bounds of the parent canvas.
 void image(float xloc, float yloc)
          Draws the image at the specified location within the previously set bounds of the parent canvas.
 void image(float x, float y, float w, float h)
          Draws the image at the specified location within the specified bounds of the parent canvas.
 void read()
          Updates the JMCMovie by writing the current video frame into the pixel array.
 void videoFrameUpdated(com.sun.media.jmc.event.VideoRendererEvent rendererEvent)
          JMC callback method when receiving a new video frame.
 
Methods inherited from class jmcvideo.JMC
bounce, bounce, bounce, bounce, centerVideo, centerVideo, centerVideo, changeBalance, changeRate, changeVolume, currentLoop, dispose, frameVideo, getBalance, getCurrentTime, getDuration, getDurationString, getFader, getImageType, getLoopString, getPlaybackPercentage, getProgress, getProgressString, getRate, getStartTime, getStopTime, getTimeString, getVolume, handleBouncingBehavior, initializeVideo, isLooping, isMuted, isPlaying, isReady, loop, loop, loop, loop, mediaDownloadProgressChanged, paintBufferedImage, pause, play, play, setBalance, setBounds, setCurrentTime, setFader, setImageType, setMute, setPlaybackPercentage, setRate, setStartTime, setStopTime, setupBufferedImage, setVideo, setVolume, stop, switchVideo, switchVideo, switchVideo, switchVideo, toggleMute, totalLoops
 
Methods inherited from class processing.core.PImage
blend, blend, blendColor, blurAlpha, blurARGB, blurRGB, buildBlurKernel, checkAlpha, clone, copy, copy, dilate, filter, filter, get, get, get, getCache, getImage, getImpl, init, isModified, loadPixels, loadTIFF, mask, mask, removeCache, resize, save, saveImageIO, saveTGA, saveTIFF, set, set, setCache, setImpl, setModified, setModified, updatePixels, updatePixels, updatePixelsImpl
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMCMovie

public JMCMovie(processing.core.PApplet parent,
                java.net.URL url,
                int pixelFormat)
Creates an instance of JMCMovie by loading a movie with the specified URL.

Parameters:
parent -
url -

JMCMovie

public JMCMovie(processing.core.PApplet parent,
                java.net.URI uri,
                int pixelFormat)
Creates an instance of JMCMovie by loading a movie with the specified URI.

Parameters:
parent -
uri -

JMCMovie

public JMCMovie(processing.core.PApplet parent,
                java.io.File file,
                int pixelFormat)
Creates an instance of JMCVideo by loading a movie from a specified file.

Parameters:
parent -
file -

JMCMovie

public JMCMovie(processing.core.PApplet parent,
                java.lang.String filename,
                int pixelFormat)
Creates an instance of JMCMovie by loading a movie from a file in the data directory with the specified filename.

Parameters:
parent - A PApplet instance.
filename - The name of the file.
Method Detail

videoFrameUpdated

public void videoFrameUpdated(com.sun.media.jmc.event.VideoRendererEvent rendererEvent)
JMC callback method when receiving a new video frame. If the parent does not contain If the parent contains a movieEvent() method, then we let that method determine how to set the pixel array by calling the read() method, otherwise we just call the read() method ourselves.

Parameters:
rendererEvent - The new frame to process.

read

public void read()
Updates the JMCMovie by writing the current video frame into the pixel array.


image

public void image()
Draws the image within the previously set bounds of the parent canvas.


image

public void image(float xloc,
                  float yloc)
Draws the image at the specified location within the previously set bounds of the parent canvas.


image

public void image(float x,
                  float y,
                  float w,
                  float h)
Draws the image at the specified location within the specified bounds of the parent canvas.


frameImage

public void frameImage()
Draws the image across the entire bounds of the parent canvas.


frameImage

public void frameImage(float inset)
Draws the image across the entire bounds, minus a specified inset, of the parent canvas.

Parameters:
inset - Amount of space between the frame and the video, in pixels.

centerImage

public void centerImage()
Draws the image across the center of the parent canvas, preserving the original aspect ratio of the video.


centerImage

public void centerImage(float inset)
Draws the image across the center of the parent canvas, preserving the original aspect ratio of the video.

Parameters:
inset - The minimum amount of space between the frame and the video, in pixels