QuickTime movie playback as OpenGL textures Textures are always bound to the GL_TEXTURE_RECTANGLE_ARB
target.
More...
#include <QuickTime.h>
Classes | |
struct | Obj |
Public Member Functions | |
MovieGl () | |
MovieGl (const fs::path &path) | |
MovieGl (const class MovieLoader &loader) | |
MovieGl (const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint="") | |
Constructs a MovieGl from a block of memory of size dataSize pointed to by data, which must not be disposed of during the lifetime of the movie. More... | |
MovieGl (DataSourceRef dataSource, const std::string mimeTypeHint="") | |
const gl::Texture | getTexture () |
Returns the gl::Texture representing the Movie's current frame, bound to the GL_TEXTURE_RECTANGLE_ARB target. More... | |
bool | checkPlayable () |
Returns whether the movie has loaded and buffered enough to playback without interruption. More... | |
int32_t | getWidth () const |
Returns the width of the movie in pixels. More... | |
int32_t | getHeight () const |
Returns the height of the movie in pixels. More... | |
Vec2i | getSize () const |
Returns the size of the movie in pixels. More... | |
float | getAspectRatio () const |
Returns the movie's aspect ratio, the ratio of its width to its height. More... | |
Area | getBounds () const |
the Area defining the Movie's bounds in pixels: [0,0]-[width,height] More... | |
float | getPixelAspectRatio () const |
Returns the movie's pixel aspect ratio. Returns 1.0 if the movie does not contain an explicit pixel aspect ratio. More... | |
float | getDuration () const |
Returns the movie's length measured in seconds. More... | |
float | getFramerate () const |
Returns the movie's framerate measured as frames per second. More... | |
int32_t | getNumFrames () const |
Returns the total number of frames (video samples) in the movie. More... | |
bool | hasAlpha () const |
Returns whether the first video track in the movie contains an alpha channel. Returns false in the absence of visual media. More... | |
bool | hasVisuals () const |
Returns whether a movie contains at least one visual track, defined as Video, MPEG, Sprite, QuickDraw3D, Text, or TimeCode tracks. More... | |
bool | hasAudio () const |
Returns whether a movie contains at least one audio track, defined as Sound, Music, or MPEG tracks. More... | |
bool | checkNewFrame () |
Returns whether a movie has a new frame available. More... | |
float | getCurrentTime () const |
Returns the current time of a movie in seconds. More... | |
void | seekToTime (float seconds) |
Sets the movie to the time seconds. More... | |
void | seekToFrame (int frame) |
Sets the movie time to the start time of frame frame. More... | |
void | seekToStart () |
Sets the movie time to its beginning. More... | |
void | seekToEnd () |
Sets the movie time to its end. More... | |
void | setActiveSegment (float startTime, float duration) |
Limits the active portion of a movie to a subset beginning at startTime seconds and lasting for duration seconds. QuickTime will not process the movie outside the active segment. More... | |
void | resetActiveSegment () |
Resets the active segment to be the entire movie. More... | |
void | setLoop (bool loop=true, bool palindrome=false) |
Sets whether the movie is set to loop during playback. If palindrome is true, the movie will "ping-pong" back and forth. More... | |
void | stepForward () |
Advances the movie by one frame (a single video sample). Ignores looping settings. More... | |
void | stepBackward () |
Steps backward by one frame (a single video sample). Ignores looping settings. More... | |
void | setRate (float rate) |
Sets the playback rate, which begins playback immediately for nonzero values. 1.0 represents normal speed. Negative values indicate reverse playback and 0 stops. More... | |
void | setVolume (float volume) |
Sets the audio playback volume ranging from [0 - 1.0]. More... | |
float | getVolume () const |
Gets the audio playback volume ranging from [0 - 1.0]. More... | |
void | setupMonoFft (uint32_t numBands) |
Sets up Fourier analysis on the movie using numBands distinct bands in a single (mono) channel. This data is only available during playback. More... | |
void | setupStereoFft (uint32_t numBands) |
Sets up Fourier analysis on the movie using numBands distinct bands in a two (stereo) channels. This data is only available during playback. More... | |
void | setupMultiChannelFft (uint32_t numBands) |
Sets up Fourier analysis on the movie using numBands distinct bands in as many channels as the audo track contains. To determine the number of channels, use getNumFftChannels(). This data is only available during playback. More... | |
float * | getFftData () const |
uint32_t | getNumFftBands () const |
uint32_t | getNumFftChannels () const |
bool | isPlaying () const |
Returns whether the movie is currently playing or is paused/stopped. More... | |
bool | isDone () const |
Returns whether the movie has completely finished playing. More... | |
void | play () |
Begins movie playback. More... | |
void | stop () |
Stops movie playback. More... | |
void | setNewFrameCallback (void(*aNewFrameCallback)(long, void *), void *aNewFrameCallbackRefcon) |
Sets a function which is called whenever the movie has rendered a new frame during playback. Generally only necessary for advanced users. More... | |
::Movie | getMovieHandle () const |
Returns the native QuickTime Movie data structure. More... | |
Static Public Member Functions | |
static MovieGlRef | create (const fs::path &path) |
static MovieGlRef | create (const MovieLoaderRef &loader) |
static MovieGlRef | create (const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint="") |
static MovieGlRef | create (DataSourceRef dataSource, const std::string mimeTypeHint="") |
Protected Member Functions | |
void | allocateVisualContext () |
virtual MovieBase::Obj * | getObj () const |
void | init () |
void | updateFrame () |
void | updateLoadState () |
void | setupFft (FourCharCode code, uint32_t bandNum, uint8_t channelNum) |
TimeValue | getStartTimeOfFirstSample () const |
void | initFromPath (const fs::path &filePath) |
void | initFromLoader (const class MovieLoader &loader) |
void | initFromMemory (const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint) |
void | initFromDataSource (DataSourceRef dataSource, const std::string &mimeTypeHint) |
Static Protected Member Functions | |
static int32_t | countFrames (::Movie theMovie) |
Protected Attributes | |
std::shared_ptr< Obj > | mObj |
typedef std::shared_ptr< Obj > MovieGl::* | unspecified_bool_type |
Emulates shared_ptr-like behavior. More... | |
operator unspecified_bool_type () const | |
Emulates shared_ptr-like behavior. More... | |
void | reset () |
Emulates shared_ptr-like behavior. More... | |
QuickTime movie playback as OpenGL textures Textures are always bound to the GL_TEXTURE_RECTANGLE_ARB
target.
typedef std::shared_ptr<Obj> MovieGl::* cinder::qtime::MovieGl::unspecified_bool_type |
Emulates shared_ptr-like behavior.
cinder::qtime::MovieGl::MovieGl | ( | ) |
cinder::qtime::MovieGl::MovieGl | ( | const fs::path & | path | ) |
cinder::qtime::MovieGl::MovieGl | ( | const class MovieLoader & | loader | ) |
cinder::qtime::MovieGl::MovieGl | ( | const void * | data, |
size_t | dataSize, | ||
const std::string & | fileNameHint, | ||
const std::string & | mimeTypeHint = "" |
||
) |
Constructs a MovieGl from a block of memory of size dataSize pointed to by data, which must not be disposed of during the lifetime of the movie.
fileNameHint and mimeTypeHint provide important hints to QuickTime about the contents of the file. Omit both of them at your peril. "video/quicktime" is often a good choice for mimeTypeHint.
cinder::qtime::MovieGl::MovieGl | ( | DataSourceRef | dataSource, |
const std::string | mimeTypeHint = "" |
||
) |
|
static |
|
static |
|
static |
|
static |
const gl::Texture cinder::qtime::MovieGl::getTexture | ( | ) |
Returns the gl::Texture representing the Movie's current frame, bound to the GL_TEXTURE_RECTANGLE_ARB
target.
|
protected |
|
protectedvirtual |
Implements cinder::qtime::MovieBase.
cinder::qtime::MovieGl::operator unspecified_bool_type | ( | ) | const |
Emulates shared_ptr-like behavior.
void cinder::qtime::MovieGl::reset | ( | ) |
Emulates shared_ptr-like behavior.
|
inherited |
Returns whether the movie has loaded and buffered enough to playback without interruption.
|
inherited |
Returns the width of the movie in pixels.
|
inherited |
Returns the height of the movie in pixels.
|
inherited |
Returns the size of the movie in pixels.
|
inherited |
Returns the movie's aspect ratio, the ratio of its width to its height.
|
inherited |
the Area defining the Movie's bounds in pixels: [0,0]-[width,height]
|
inherited |
Returns the movie's pixel aspect ratio. Returns 1.0 if the movie does not contain an explicit pixel aspect ratio.
|
inherited |
Returns the movie's length measured in seconds.
|
inherited |
Returns the movie's framerate measured as frames per second.
|
inherited |
Returns the total number of frames (video samples) in the movie.
|
inherited |
Returns whether the first video track in the movie contains an alpha channel. Returns false in the absence of visual media.
|
inherited |
Returns whether a movie contains at least one visual track, defined as Video, MPEG, Sprite, QuickDraw3D, Text, or TimeCode tracks.
|
inherited |
Returns whether a movie contains at least one audio track, defined as Sound, Music, or MPEG tracks.
|
inherited |
Returns whether a movie has a new frame available.
|
inherited |
Returns the current time of a movie in seconds.
|
inherited |
Sets the movie to the time seconds.
Sets the movie time to the start time of frame frame.
|
inherited |
Sets the movie time to its beginning.
|
inherited |
Sets the movie time to its end.
|
inherited |
Limits the active portion of a movie to a subset beginning at startTime seconds and lasting for duration seconds. QuickTime will not process the movie outside the active segment.
|
inherited |
Resets the active segment to be the entire movie.
|
inherited |
Sets whether the movie is set to loop during playback. If palindrome is true, the movie will "ping-pong" back and forth.
|
inherited |
Advances the movie by one frame (a single video sample). Ignores looping settings.
|
inherited |
Steps backward by one frame (a single video sample). Ignores looping settings.
|
inherited |
Sets the playback rate, which begins playback immediately for nonzero values. 1.0 represents normal speed. Negative values indicate reverse playback and 0
stops.
|
inherited |
Sets the audio playback volume ranging from [0 - 1.0].
|
inherited |
Gets the audio playback volume ranging from [0 - 1.0].
|
inherited |
Sets up Fourier analysis on the movie using numBands distinct bands in a single (mono) channel. This data is only available during playback.
|
inherited |
Sets up Fourier analysis on the movie using numBands distinct bands in a two (stereo) channels. This data is only available during playback.
|
inherited |
Sets up Fourier analysis on the movie using numBands distinct bands in as many channels as the audo track contains. To determine the number of channels, use getNumFftChannels(). This data is only available during playback.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
Returns whether the movie is currently playing or is paused/stopped.
|
inherited |
Returns whether the movie has completely finished playing.
|
inherited |
Begins movie playback.
|
inherited |
Stops movie playback.
|
inherited |
Sets a function which is called whenever the movie has rendered a new frame during playback. Generally only necessary for advanced users.
|
inherited |
Returns the native QuickTime Movie data structure.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticprotectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protected |