![]() |
Theora Playback Library
1.0.0
|
Public Member Functions | |
TheoraFrameQueue (TheoraVideoClip *parent) | |
~TheoraFrameQueue () | |
TheoraVideoFrame * | getFirstAvailableFrame () |
Returns the first available frame in the queue or NULL if no frames are available. More... | |
int | getUsedCount () |
return the number of used (not ready) frames More... | |
int | getReadyCount () |
return the number of ready frames More... | |
void | pop () |
remove the first available frame from the queue. More... | |
void | clear () |
frees all decoded frames for reuse (does not destroy memory, just marks them as free) More... | |
TheoraVideoFrame * | requestEmptyFrame () |
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... | |
void | lock () |
lock the queue's mutex manually More... | |
void | unlock () |
unlock the queue's mutex manually More... | |
Protected Member Functions | |
TheoraVideoFrame * | createFrameInstance (TheoraVideoClip *clip) |
implementation function that returns a TheoraVideoFrame instance More... | |
Protected Attributes | |
std::list< TheoraVideoFrame * > | mQueue |
TheoraVideoClip * | mParent |
TheoraMutex | mMutex |
This class handles the frame queue. contains frames and handles their alloctation/deallocation it is designed to be thread-safe
TheoraFrameQueue::TheoraFrameQueue | ( | TheoraVideoClip * | parent | ) |
TheoraFrameQueue::~TheoraFrameQueue | ( | ) |
void TheoraFrameQueue::clear | ( | ) |
frees all decoded frames for reuse (does not destroy memory, just marks them as free)
|
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.
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::lock | ( | ) |
lock the queue's mutex manually
void TheoraFrameQueue::pop | ( | ) |
remove the first 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
void TheoraFrameQueue::unlock | ( | ) |
unlock the queue's mutex manually
|
protected |
|
protected |
|
protected |