dmuMovieIn

Inherits from: dmuMovie

#include "dmuMovieIn.h"

Overview

The dmuMovieIn class is a base class for any object that reads frames from a movie file into a DMbuffer. It should not be instantiated directly - use a class that inherits from this base class instead. This class handles movie file open and setup, and movie file reading. To read the frames, this object starts a new thread which continually attempts to read (and possibly uncompress and render) a frame ahead, while making sure that there is always a frame available for its child objects to use. The current implementation does not support movie audio tracks, only the image track

The dmuMovieIn object always reads frames into DMbuffers that are sized to dimensions that are the nearest power of 2. This is done to facilitate using the DMbuffers as texture maps.

The sequence of methods you need to call to use a dmuMovieIn object usually looks something like this:

  • Construct a movie object - The dmuMovieObject should never be instantiated directly. Use a subclass like dmuRenderMovieIn.
  • Set up the object to use the movie file you want associated with the object. In the current implementation, once the read thread is started, the only way to restart it with a new movie is to delete the object and recreate it.
  • You may want to grab the frame and/or buffer size values for use in setting up other objects.
  • Wire into standard dmu object chain (see Overview for details)
  • Start the movie read loop using the start() method. This starts up a thread which begins reading frames into memory. The read thread has a file descriptor associated with it which is used to notify the use program that a new movie frame has been read in and is ready for a call to handleEvents
  • Handle events as discussed in the Overview section.

    Using the movie for GL pixel operations - To use the movie in standard (non-texturing) situations, use the getImageDimensions method to get the demensions of the actual frame data, and do all operations on the DMbuffer data from (0,0) to (imageSizeX,imageSizeY).

    Using the movie for texture mapping - To use the movie as a texture map, use the getBufferDimensions method to get the size of the DMbuffer that's actally used for the frame data. A number of methods are provided to make setting proper texture coordinates for your texture map easier. See the movieTexCoord2d, movieTexCoord2f, getTexCoordScaleXF and getTexCoordScaleYF for more information.

    See the source code for more info and implementation details.

    Public Methods


    Overview    Object List     Object Hierarchy       Sample Apps