AJA NTV2 SDK
17.1.3.1410
NTV2 SDK 17.1.3.1410
|
I am a circular frame buffer that simplifies implementing a type-safe producer/consumer model for processing frame-based streaming media. I can be used with any client-defined "frame", be it a struct or class. To use me: More...
#include <circularbuffer.h>
Public Member Functions | |
AJACircularBuffer () | |
My default constructor. More... | |
virtual | ~AJACircularBuffer () |
My destructor. More... | |
void | SetAbortFlag (const bool *pAbortFlag) |
Tells me the boolean variable I should monitor such that when it gets set to "true" will cause any threads waiting on my events/locks to gracefully exit. More... | |
unsigned int | GetCircBufferCount (void) const |
Retrieves the size count of the circular buffer, i.e. how far the tail pointer is behind the head pointer. More... | |
bool | IsEmpty (void) const |
Returns "true" if I'm empty – i.e., if my tail and head are in the same place. More... | |
unsigned int | GetNumFrames (void) const |
Returns my frame storage capacity, which reflects how many times my Add method has been called. More... | |
AJAStatus | Add (FrameDataPtr pInFrameData) |
Appends a new frame buffer to me, increasing my frame storage capacity by one frame. More... | |
FrameDataPtr | StartProduceNextBuffer (void) |
The thread that's responsible for providing frames – the producer – calls this function to populate the the returned FrameDataPtr. More... | |
void | EndProduceNextBuffer (void) |
The producer thread calls this function to signal that it has finished populating the frame it obtained from a prior call to StartProduceNextBuffer. This releases the frame, making it available for processing by the consumer thread. More... | |
FrameDataPtr | StartConsumeNextBuffer (void) |
The thread that's responsible for processing incoming frames – the consumer – calls this function to obtain the next available frame. More... | |
void | EndConsumeNextBuffer (void) |
The consumer thread calls this function to signal that it has finished processing the frame it obtained from a prior call to StartConsumeNextBuffer. This releases the frame, making it available for filling by the producer thread. More... | |
void | Clear (void) |
Clears my frame collection, their locks, everything. More... | |
I am a circular frame buffer that simplifies implementing a type-safe producer/consumer model for processing frame-based streaming media. I can be used with any client-defined "frame", be it a struct or class. To use me:
Definition at line 30 of file circularbuffer.h.
AJACircularBuffer< FrameDataPtr >::AJACircularBuffer |
My default constructor.
Definition at line 239 of file circularbuffer.h.
|
virtual |
My destructor.
Definition at line 250 of file circularbuffer.h.
|
inline |
Appends a new frame buffer to me, increasing my frame storage capacity by one frame.
[in] | pInFrameData | Specifies the FrameDataPtr to be added to me. |
Definition at line 92 of file circularbuffer.h.
void AJACircularBuffer< FrameDataPtr >::Clear | ( | void | ) |
Clears my frame collection, their locks, everything.
Definition at line 314 of file circularbuffer.h.
void AJACircularBuffer< FrameDataPtr >::EndConsumeNextBuffer | ( | void | ) |
The consumer thread calls this function to signal that it has finished processing the frame it obtained from a prior call to StartConsumeNextBuffer. This releases the frame, making it available for filling by the producer thread.
Definition at line 266 of file circularbuffer.h.
void AJACircularBuffer< FrameDataPtr >::EndProduceNextBuffer | ( | void | ) |
The producer thread calls this function to signal that it has finished populating the frame it obtained from a prior call to StartProduceNextBuffer. This releases the frame, making it available for processing by the consumer thread.
Definition at line 259 of file circularbuffer.h.
|
inline |
Retrieves the size count of the circular buffer, i.e. how far the tail pointer is behind the head pointer.
Definition at line 61 of file circularbuffer.h.
|
inline |
Returns my frame storage capacity, which reflects how many times my Add method has been called.
Definition at line 80 of file circularbuffer.h.
|
inline |
Returns "true" if I'm empty – i.e., if my tail and head are in the same place.
Definition at line 71 of file circularbuffer.h.
|
inline |
Tells me the boolean variable I should monitor such that when it gets set to "true" will cause any threads waiting on my events/locks to gracefully exit.
[in] | pAbortFlag | Specifies the valid, non-NULL address of a boolean variable that, when it becomes "true", will cause threads waiting on me to exit gracefully. |
Definition at line 51 of file circularbuffer.h.
|
inline |
The thread that's responsible for processing incoming frames – the consumer – calls this function to obtain the next available frame.
Definition at line 153 of file circularbuffer.h.
|
inline |
The thread that's responsible for providing frames – the producer – calls this function to populate the the returned FrameDataPtr.
Definition at line 109 of file circularbuffer.h.