Cinder  0.9.1
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
cinder::qtime::MovieBase Class Referenceabstract

#include <QuickTimeImplLegacy.h>

Inherited by cinder::qtime::MovieGl, cinder::qtime::MovieGl, cinder::qtime::MovieSurface, and cinder::qtime::MovieSurface.

Classes

struct  Obj
 

Public Member Functions

virtual ~MovieBase ()
 
int32_t getWidth () const
 
int32_t getHeight () const
 
ivec2 getSize () const
 
float getAspectRatio () const
 
Area getBounds () const
 
float getPixelAspectRatio () const
 
bool checkPlaythroughOk ()
 
bool isLoaded () const
 
bool isPlayable () const
 
bool isProtected () const
 
float getDuration () const
 
float getFramerate () const
 
int32_t getNumFrames ()
 
bool hasVisuals () const
 
bool hasAudio () const
 
virtual bool hasAlpha () const
 
bool checkNewFrame ()
 
float getCurrentTime () const
 
void seekToTime (float seconds)
 
void seekToFrame (int frame)
 
void seekToStart ()
 
void seekToEnd ()
 
void setActiveSegment (float startTime, float duration)
 
void resetActiveSegment ()
 
void setLoop (bool loop=true, bool palindrome=false)
 
bool stepForward ()
 
bool stepBackward ()
 
bool setRate (float rate)
 
void setVolume (float volume)
 
float getVolume () const
 
bool isPlaying () const
 
bool isDone () const
 
void play (bool toggle=false)
 
void stop ()
 
AVPlayer * getPlayerHandle () const
 
signals::Signal< void()> & getNewFrameSignal ()
 
signals::Signal< void()> & getReadySignal ()
 
signals::Signal< void()> & getCancelledSignal ()
 
signals::Signal< void()> & getEndedSignal ()
 
signals::Signal< void()> & getJumpedSignal ()
 
signals::Signal< void()> & getOutputWasFlushedSignal ()
 
virtual ~MovieBase ()
 
bool checkPlayable ()
 
int32_t getWidth () const
 
int32_t getHeight () const
 
ivec2 getSize () const
 
float getAspectRatio () const
 
Area getBounds () const
 
float getPixelAspectRatio () const
 
float getDuration () const
 
float getFramerate () const
 
int32_t getNumFrames () const
 
bool hasAlpha () const
 
bool hasVisuals () const
 
bool hasAudio () const
 
bool checkNewFrame ()
 
float getCurrentTime () const
 
void seekToTime (float seconds)
 
void seekToFrame (int frame)
 
void seekToStart ()
 
void seekToEnd ()
 
void setActiveSegment (float startTime, float duration)
 
void resetActiveSegment ()
 
void setLoop (bool loop=true, bool palindrome=false)
 
void stepForward ()
 
void stepBackward ()
 
void setRate (float rate)
 
void setVolume (float volume)
 
float getVolume () const
 
void setupMonoFft (uint32_t numBands)
 
void setupStereoFft (uint32_t numBands)
 
void setupMultiChannelFft (uint32_t numBands)
 
float * getFftData () const
 
uint32_t getNumFftBands () const
 
uint32_t getNumFftChannels () const
 
bool isPlaying () const
 
bool isDone () const
 
void play ()
 
void stop ()
 
void setNewFrameCallback (void(*aNewFrameCallback)(long, void *), void *aNewFrameCallbackRefcon)
 
::Movie getMovieHandle () const
 

Protected Member Functions

 MovieBase ()
 
void init ()
 
void initFromUrl (const Url &url)
 
void initFromPath (const fs::path &filePath)
 
void initFromLoader (const MovieLoader &loader)
 
void loadAsset ()
 
void updateFrame ()
 
uint32_t countFrames () const
 
void processAssetTracks (AVAsset *asset)
 
void createPlayerItemOutput (const AVPlayerItem *playerItem)
 
void lock ()
 
void unlock ()
 
void removeObservers ()
 
void addObservers ()
 
virtual NSDictionary * avPlayerItemOutputDictionary () const =0
 
virtual void allocateVisualContext ()=0
 
virtual void deallocateVisualContext ()=0
 
virtual void newFrame (CVImageBufferRef cvImage)=0
 
virtual void releaseFrame ()=0
 
void playerReady ()
 
void playerItemEnded ()
 
void playerItemCancelled ()
 
void playerItemJumped ()
 
void outputWasFlushed (AVPlayerItemOutput *output)
 
 MovieBase ()
 
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)
 
virtual ObjgetObj () const =0
 

Static Protected Member Functions

static int32_t countFrames (::Movie theMovie)
 

Protected Attributes

int32_t mWidth
 
int32_t mHeight
 
int32_t mFrameCount
 
float mFrameRate
 
float mDuration
 
std::atomic< bool > mAssetLoaded
 
bool mLoaded
 
bool mPlayThroughOk
 
bool mPlayable
 
bool mProtected
 
bool mPlayingForward
 
bool mLoop
 
bool mPalindrome
 
bool mHasAudio
 
bool mHasVideo
 
bool mPlaying
 
AVPlayer * mPlayer
 
AVPlayerItem * mPlayerItem
 
AVURLAsset * mAsset
 
AVPlayerItemVideoOutput * mPlayerVideoOutput
 
std::mutex mMutex
 
signals::Signal< void()> mSignalNewFrame
 
signals::Signal< void()> mSignalReady
 
signals::Signal< void()> mSignalCancelled
 
signals::Signal< void()> mSignalEnded
 
signals::Signal< void()> mSignalJumped
 
signals::Signal< void()> mSignalOutputWasFlushed
 
MovieRespondermResponder
 
MovieDelegate * mPlayerDelegate
 

Friends

class MovieResponder
 

Constructor & Destructor Documentation

virtual cinder::qtime::MovieBase::~MovieBase ( )
virtual
cinder::qtime::MovieBase::MovieBase ( )
protected
virtual cinder::qtime::MovieBase::~MovieBase ( )
virtual
cinder::qtime::MovieBase::MovieBase ( )
protected

Member Function Documentation

int32_t cinder::qtime::MovieBase::getWidth ( ) const

Returns the width of the movie in pixels.

int32_t cinder::qtime::MovieBase::getHeight ( ) const

Returns the height of the movie in pixels.

ivec2 cinder::qtime::MovieBase::getSize ( ) const

Returns the size of the movie in pixels.

float cinder::qtime::MovieBase::getAspectRatio ( ) const

Returns the movie's aspect ratio, the ratio of its width to its height.

Area cinder::qtime::MovieBase::getBounds ( ) const

the Area defining the Movie's bounds in pixels: [0,0]-[width,height]

float cinder::qtime::MovieBase::getPixelAspectRatio ( ) const

Returns the movie's pixel aspect ratio. Returns 1.0 if the movie does not contain an explicit pixel aspect ratio.

bool cinder::qtime::MovieBase::checkPlaythroughOk ( )

Returns whether the movie has loaded and buffered enough to playback without interruption.

bool cinder::qtime::MovieBase::isLoaded ( ) const

Returns whether the movie is in a loaded state, implying its structures are ready for reading but it may not be ready for playback.

bool cinder::qtime::MovieBase::isPlayable ( ) const

Returns whether the movie is playable, implying the movie is fully formed and can be played but media data is still downloading.

bool cinder::qtime::MovieBase::isProtected ( ) const

Returns true if the content represented by the movie is protected by DRM.

float cinder::qtime::MovieBase::getDuration ( ) const

Returns the movie's length measured in seconds.

float cinder::qtime::MovieBase::getFramerate ( ) const

Returns the movie's framerate measured as frames per second.

See also
http://developer.apple.com/mac/library/qa/qa2001/qa1262.html Technical Q&A QA1262
int32_t cinder::qtime::MovieBase::getNumFrames ( )

Returns the total number of frames (video samples) in the movie.

bool cinder::qtime::MovieBase::hasVisuals ( ) const

Returns whether a movie contains at least one visual track, defined as Video, MPEG, Sprite, QuickDraw3D, Text, or TimeCode tracks.

bool cinder::qtime::MovieBase::hasAudio ( ) const

Returns whether a movie contains at least one audio track, defined as Sound, Music, or MPEG tracks.

bool cinder::qtime::MovieBase::hasAlpha ( ) const
virtual

Returns whether the first video track in the movie contains an alpha channel. Returns false in the absence of visual media.

See also
http://developer.apple.com/qa/qtmtb/qtmtb17.html Technical Q&A QTMTB17
bool cinder::qtime::MovieBase::checkNewFrame ( )

Returns whether a movie has a new frame available.

float cinder::qtime::MovieBase::getCurrentTime ( ) const

Returns the current time of a movie in seconds.

void cinder::qtime::MovieBase::seekToTime ( float  seconds)

Sets the movie to the time seconds.

void cinder::qtime::MovieBase::seekToFrame ( int  frame)

Sets the movie time to the start time of frame frame.

void cinder::qtime::MovieBase::seekToStart ( )

Sets the movie time to its beginning.

void cinder::qtime::MovieBase::seekToEnd ( )

Sets the movie time to its end.

void cinder::qtime::MovieBase::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.

void cinder::qtime::MovieBase::resetActiveSegment ( )

Resets the active segment to be the entire movie.

void cinder::qtime::MovieBase::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.

void cinder::qtime::MovieBase::stepForward ( )

Advances the movie by one frame (a single video sample). Ignores looping settings.

void cinder::qtime::MovieBase::stepBackward ( )

Steps backward by one frame (a single video sample). Ignores looping settings.

void cinder::qtime::MovieBase::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.

Returns a boolean value indicating whether the rate value can be played (some media types cannot be played backwards)

void cinder::qtime::MovieBase::setVolume ( float  volume)

Sets the audio playback volume ranging from [0 - 1.0].

float cinder::qtime::MovieBase::getVolume ( ) const

Gets the audio playback volume ranging from [0 - 1.0].

bool cinder::qtime::MovieBase::isPlaying ( ) const

Returns whether the movie is currently playing or is paused/stopped.

bool cinder::qtime::MovieBase::isDone ( ) const

Returns whether the movie has completely finished playing.

void cinder::qtime::MovieBase::play ( bool  toggle = false)

Begins movie playback.

void cinder::qtime::MovieBase::stop ( )

Stops playback.

AVPlayer* cinder::qtime::MovieBase::getPlayerHandle ( ) const

Returns the native AvFoundation Player data structure.

signals::Signal<void()>& cinder::qtime::MovieBase::getNewFrameSignal ( )
signals::Signal<void()>& cinder::qtime::MovieBase::getReadySignal ( )
signals::Signal<void()>& cinder::qtime::MovieBase::getCancelledSignal ( )
signals::Signal<void()>& cinder::qtime::MovieBase::getEndedSignal ( )
signals::Signal<void()>& cinder::qtime::MovieBase::getJumpedSignal ( )
signals::Signal<void()>& cinder::qtime::MovieBase::getOutputWasFlushedSignal ( )
void cinder::qtime::MovieBase::init ( )
protected
void cinder::qtime::MovieBase::initFromUrl ( const Url url)
protected
void cinder::qtime::MovieBase::initFromPath ( const fs::path &  filePath)
protected
void cinder::qtime::MovieBase::initFromLoader ( const MovieLoader loader)
protected
void cinder::qtime::MovieBase::loadAsset ( )
protected
void cinder::qtime::MovieBase::updateFrame ( )
protected
uint32_t cinder::qtime::MovieBase::countFrames ( ) const
protected
void cinder::qtime::MovieBase::processAssetTracks ( AVAsset *  asset)
protected
void cinder::qtime::MovieBase::createPlayerItemOutput ( const AVPlayerItem *  playerItem)
protected
void cinder::qtime::MovieBase::lock ( )
protected
void cinder::qtime::MovieBase::unlock ( )
protected
void cinder::qtime::MovieBase::removeObservers ( )
protected
void cinder::qtime::MovieBase::addObservers ( )
protected
virtual NSDictionary* cinder::qtime::MovieBase::avPlayerItemOutputDictionary ( ) const
protectedpure virtual
virtual void cinder::qtime::MovieBase::allocateVisualContext ( )
protectedpure virtual
virtual void cinder::qtime::MovieBase::deallocateVisualContext ( )
protectedpure virtual
virtual void cinder::qtime::MovieBase::newFrame ( CVImageBufferRef  cvImage)
protectedpure virtual
virtual void cinder::qtime::MovieBase::releaseFrame ( )
protectedpure virtual
void cinder::qtime::MovieBase::playerReady ( )
protected
void cinder::qtime::MovieBase::playerItemEnded ( )
protected
void cinder::qtime::MovieBase::playerItemCancelled ( )
protected
void cinder::qtime::MovieBase::playerItemJumped ( )
protected
void cinder::qtime::MovieBase::outputWasFlushed ( AVPlayerItemOutput *  output)
protected
bool cinder::qtime::MovieBase::checkPlayable ( )

Returns whether the movie has loaded and buffered enough to playback without interruption.

Returns
The movie has loaded and buffered enough to playback without interruption
int32_t cinder::qtime::MovieBase::getWidth ( ) const

Returns the width of the movie in pixels.

int32_t cinder::qtime::MovieBase::getHeight ( ) const

Returns the height of the movie in pixels.

ivec2 cinder::qtime::MovieBase::getSize ( ) const

Returns the size of the movie in pixels.

float cinder::qtime::MovieBase::getAspectRatio ( ) const

Returns the movie's aspect ratio, the ratio of its width to its height.

Area cinder::qtime::MovieBase::getBounds ( ) const

the Area defining the Movie's bounds in pixels: [0,0]-[width,height]

float cinder::qtime::MovieBase::getPixelAspectRatio ( ) const

Returns the movie's pixel aspect ratio. Returns 1.0 if the movie does not contain an explicit pixel aspect ratio.

float cinder::qtime::MovieBase::getDuration ( ) const

Returns the movie's length measured in seconds.

float cinder::qtime::MovieBase::getFramerate ( ) const

Returns the movie's framerate measured as frames per second.

int32_t cinder::qtime::MovieBase::getNumFrames ( ) const

Returns the total number of frames (video samples) in the movie.

bool cinder::qtime::MovieBase::hasAlpha ( ) const

Returns whether the first video track in the movie contains an alpha channel. Returns false in the absence of visual media.

bool cinder::qtime::MovieBase::hasVisuals ( ) const

Returns whether a movie contains at least one visual track, defined as Video, MPEG, Sprite, QuickDraw3D, Text, or TimeCode tracks.

bool cinder::qtime::MovieBase::hasAudio ( ) const

Returns whether a movie contains at least one audio track, defined as Sound, Music, or MPEG tracks.

bool cinder::qtime::MovieBase::checkNewFrame ( )

Returns whether a movie has a new frame available.

float cinder::qtime::MovieBase::getCurrentTime ( ) const

Returns the current time of a movie in seconds.

void cinder::qtime::MovieBase::seekToTime ( float  seconds)

Sets the movie to the time seconds.

void cinder::qtime::MovieBase::seekToFrame ( int  frame)

Sets the movie time to the start time of frame frame.

void cinder::qtime::MovieBase::seekToStart ( )

Sets the movie time to its beginning.

void cinder::qtime::MovieBase::seekToEnd ( )

Sets the movie time to its end.

void cinder::qtime::MovieBase::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.

void cinder::qtime::MovieBase::resetActiveSegment ( )

Resets the active segment to be the entire movie.

void cinder::qtime::MovieBase::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.

void cinder::qtime::MovieBase::stepForward ( )

Advances the movie by one frame (a single video sample). Ignores looping settings.

void cinder::qtime::MovieBase::stepBackward ( )

Steps backward by one frame (a single video sample). Ignores looping settings.

void cinder::qtime::MovieBase::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.

void cinder::qtime::MovieBase::setVolume ( float  volume)

Sets the audio playback volume ranging from [0 - 1.0].

float cinder::qtime::MovieBase::getVolume ( ) const

Gets the audio playback volume ranging from [0 - 1.0].

void cinder::qtime::MovieBase::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.

void cinder::qtime::MovieBase::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.

void cinder::qtime::MovieBase::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.

float * cinder::qtime::MovieBase::getFftData ( ) const
uint32_t cinder::qtime::MovieBase::getNumFftBands ( ) const
uint32_t cinder::qtime::MovieBase::getNumFftChannels ( ) const
bool cinder::qtime::MovieBase::isPlaying ( ) const

Returns whether the movie is currently playing or is paused/stopped.

bool cinder::qtime::MovieBase::isDone ( ) const

Returns whether the movie has completely finished playing.

void cinder::qtime::MovieBase::play ( )

Begins movie playback.

void cinder::qtime::MovieBase::stop ( )

Stops movie playback.

void cinder::qtime::MovieBase::setNewFrameCallback ( void(*)(long, void *)  aNewFrameCallback,
void *  aNewFrameCallbackRefcon 
)

Sets a function which is called whenever the movie has rendered a new frame during playback. Generally only necessary for advanced users.

::Movie cinder::qtime::MovieBase::getMovieHandle ( ) const

Returns the native QuickTime Movie data structure.

void cinder::qtime::MovieBase::init ( )
protected
void cinder::qtime::MovieBase::updateFrame ( )
protected
void cinder::qtime::MovieBase::updateLoadState ( )
protected
void cinder::qtime::MovieBase::setupFft ( FourCharCode  code,
uint32_t  bandNum,
uint8_t  channelNum 
)
protected
int32_t cinder::qtime::MovieBase::countFrames ( ::Movie  theMovie)
staticprotected
TimeValue cinder::qtime::MovieBase::getStartTimeOfFirstSample ( ) const
protected
void cinder::qtime::MovieBase::initFromPath ( const fs::path &  filePath)
protected
void cinder::qtime::MovieBase::initFromLoader ( const class MovieLoader loader)
protected
void cinder::qtime::MovieBase::initFromMemory ( const void *  data,
size_t  dataSize,
const std::string &  fileNameHint,
const std::string &  mimeTypeHint 
)
protected
void cinder::qtime::MovieBase::initFromDataSource ( DataSourceRef  dataSource,
const std::string &  mimeTypeHint 
)
protected
virtual Obj* cinder::qtime::MovieBase::getObj ( ) const
protectedpure virtual

Friends And Related Function Documentation

friend class MovieResponder
friend

Member Data Documentation

int32_t cinder::qtime::MovieBase::mWidth
protected
int32_t cinder::qtime::MovieBase::mHeight
protected
int32_t cinder::qtime::MovieBase::mFrameCount
protected
float cinder::qtime::MovieBase::mFrameRate
protected
float cinder::qtime::MovieBase::mDuration
protected
std::atomic<bool> cinder::qtime::MovieBase::mAssetLoaded
protected
bool cinder::qtime::MovieBase::mLoaded
protected
bool cinder::qtime::MovieBase::mPlayThroughOk
protected
bool cinder::qtime::MovieBase::mPlayable
protected
bool cinder::qtime::MovieBase::mProtected
protected
bool cinder::qtime::MovieBase::mPlayingForward
protected
bool cinder::qtime::MovieBase::mLoop
protected
bool cinder::qtime::MovieBase::mPalindrome
protected
bool cinder::qtime::MovieBase::mHasAudio
protected
bool cinder::qtime::MovieBase::mHasVideo
protected
bool cinder::qtime::MovieBase::mPlaying
protected
AVPlayer* cinder::qtime::MovieBase::mPlayer
protected
AVPlayerItem* cinder::qtime::MovieBase::mPlayerItem
protected
AVURLAsset* cinder::qtime::MovieBase::mAsset
protected
AVPlayerItemVideoOutput* cinder::qtime::MovieBase::mPlayerVideoOutput
protected
std::mutex cinder::qtime::MovieBase::mMutex
protected
signals::Signal<void()> cinder::qtime::MovieBase::mSignalNewFrame
protected
signals::Signal<void()> cinder::qtime::MovieBase::mSignalReady
protected
signals::Signal<void()> cinder::qtime::MovieBase::mSignalCancelled
protected
signals::Signal<void()> cinder::qtime::MovieBase::mSignalEnded
protected
signals::Signal<void()> cinder::qtime::MovieBase::mSignalJumped
protected
signals::Signal<void()> cinder::qtime::MovieBase::mSignalOutputWasFlushed
protected
MovieResponder* cinder::qtime::MovieBase::mResponder
protected
MovieDelegate* cinder::qtime::MovieBase::mPlayerDelegate
protected

The documentation for this class was generated from the following files: