xbmc
|
This buffer can be used by one read and one write thread at any one time without the risk of data corruption. More...
#include <AERingBuffer.h>
Public Member Functions | |
AERingBuffer (unsigned int size, unsigned int planes=1) | |
bool | Create (int size, unsigned int planes=1) |
Allocates space for buffer, and sets it's contents to 0. More... | |
void | Reset () |
Fills the buffer with zeros and resets the pointers. More... | |
int | Write (unsigned char *src, unsigned int size, unsigned int plane=0) |
Writes data to buffer. More... | |
int | Read (unsigned char *dest, unsigned int size, unsigned int plane=0) |
Reads data from buffer. More... | |
void | Dump () |
Dumps the buffer. | |
unsigned int | GetWriteSize () |
Returns available space for writing to buffer. More... | |
unsigned int | GetReadSize () |
Returns available space for reading from buffer. More... | |
unsigned int | GetMaxSize () |
Returns the buffer size. | |
unsigned int | NumPlanes () const |
Returns the number of planes. | |
This buffer can be used by one read and one write thread at any one time without the risk of data corruption.
If you intend to call the Reset() method, please use Locks. All other operations are thread-safe.
|
inline |
Allocates space for buffer, and sets it's contents to 0.
|
inline |
Returns available space for reading from buffer.
Attempt to read more bytes than available results in AE_RING_BUFFER_EMPTY.
|
inline |
Returns available space for writing to buffer.
Attempt to write more bytes than available results in AE_RING_BUFFER_FULL.
|
inline |
Reads data from buffer.
Attempt to read more bytes than available results in RING_BUFFER_NOTAVAILABLE. Reading from empty buffer returns AE_RING_BUFFER_EMPTY
|
inline |
Fills the buffer with zeros and resets the pointers.
This method is not thread-safe, so before using this method please acquire a Lock()
|
inline |
Writes data to buffer.
Attempt to write more bytes than available results in AE_RING_BUFFER_FULL.