Theora Playback Library  1.1.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TheoraFrameQueue Class Reference

Public Member Functions

 TheoraFrameQueue (TheoraVideoClip *parent)
 
 ~TheoraFrameQueue ()
 
TheoraVideoFramegetFirstAvailableFrame ()
 Returns the first available frame in the queue or NULL if no frames are available. More...
 
TheoraVideoFrame_getFirstAvailableFrame ()
 non-mutex version More...
 
int getUsedCount ()
 return the number of used (not ready) frames More...
 
int getReadyCount ()
 return the number of ready frames More...
 
int _getReadyCount ()
 non-mutex version More...
 
void pop (int n=1)
 remove the first N available frame from the queue. More...
 
void _pop (int n)
 This is an internal _pop function. use externally only in combination with lock() / unlock() calls. More...
 
void clear ()
 frees all decoded frames for reuse (does not destroy memory, just marks them as free) More...
 
TheoraVideoFramerequestEmptyFrame ()
 Called by WorkerThreads when they need to unload frame data, do not call directly! More...
 
void setSize (int n)
 set's the size of the frame queue. More...
 
int getSize ()
 return the size of the queue More...
 
bool isFull ()
 return whether all frames in the queue are ready for display More...
 
TheoraMutexgetMutex ()
 
std::list< TheoraVideoFrame * > & _getFrameQueue ()
 returns the internal frame queue. Warning: Always lock / unlock queue's mutex before accessing frames directly! More...
 

Protected Member Functions

TheoraVideoFramecreateFrameInstance (TheoraVideoClip *clip)
 implementation function that returns a TheoraVideoFrame instance More...
 

Protected Attributes

std::list< TheoraVideoFrame * > mQueue
 
TheoraVideoClipmParent
 
TheoraMutex mMutex
 

Detailed Description

This class handles the frame queue. contains frames and handles their alloctation/deallocation it is designed to be thread-safe

Constructor & Destructor Documentation

TheoraFrameQueue::TheoraFrameQueue ( TheoraVideoClip parent)
TheoraFrameQueue::~TheoraFrameQueue ( )

Member Function Documentation

TheoraVideoFrame* TheoraFrameQueue::_getFirstAvailableFrame ( )

non-mutex version

std::list<TheoraVideoFrame*>& TheoraFrameQueue::_getFrameQueue ( )

returns the internal frame queue. Warning: Always lock / unlock queue's mutex before accessing frames directly!

int TheoraFrameQueue::_getReadyCount ( )

non-mutex version

void TheoraFrameQueue::_pop ( int  n)

This is an internal _pop function. use externally only in combination with lock() / unlock() calls.

void TheoraFrameQueue::clear ( )

frees all decoded frames for reuse (does not destroy memory, just marks them as free)

TheoraVideoFrame* TheoraFrameQueue::createFrameInstance ( TheoraVideoClip clip)
protected

implementation function that returns a TheoraVideoFrame instance

TheoraVideoFrame* TheoraFrameQueue::getFirstAvailableFrame ( )

Returns the first available frame in the queue or NULL if no frames are available.

This function DOES NOT remove the frame from the queue, you have to do it manually when you want to mark the frame as used by calling the pop() function.

TheoraMutex* TheoraFrameQueue::getMutex ( )
inline
int TheoraFrameQueue::getReadyCount ( )

return the number of ready frames

int TheoraFrameQueue::getSize ( )

return the size of the queue

int TheoraFrameQueue::getUsedCount ( )

return the number of used (not ready) frames

bool TheoraFrameQueue::isFull ( )

return whether all frames in the queue are ready for display

void TheoraFrameQueue::pop ( int  n = 1)

remove the first N available frame from the queue.

Use this every time you display a frame so you can get the next one when the time comes. This function marks the frame on the front of the queue as unused and it's memory then get's used again in the decoding process. If you don't call this, the frame queue will fill up with precached frames up to the specified amount in the TheoraVideoManager class and you won't be able to advance the video.

TheoraVideoFrame* TheoraFrameQueue::requestEmptyFrame ( )

Called by WorkerThreads when they need to unload frame data, do not call directly!

void TheoraFrameQueue::setSize ( int  n)

set's the size of the frame queue.

Beware, currently stored ready frames will be lost upon this call

Member Data Documentation

TheoraMutex TheoraFrameQueue::mMutex
protected
TheoraVideoClip* TheoraFrameQueue::mParent
protected
std::list<TheoraVideoFrame*> TheoraFrameQueue::mQueue
protected

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