AVBlocks for C++  1.13
Audio and Video Software Development Kit
Buffer Class Reference

Provides FIFO semantics and helper functions for MediaBuffer. More...

Static Public Member Functions

static bool_t clear (MediaBuffer *buffer)
 Clears the data in MediaBuffer and resets the data offset to the beginning of the buffer. More...
 
static bool_t pop (MediaBuffer *buffer, int32_t dataSize)
 Removes data from the beginning of the MediaBuffer data. More...
 
static bool_t normalize (MediaBuffer *buffer)
 Moves the data (if any) to the start of the buffer. More...
 
static bool_t push (MediaBuffer *buffer, const void *data, int32_t dataSize)
 Adds data at the end of the MediaBuffer data. More...
 
static int32_t freeLinearSpace (MediaBuffer *buffer)
 Returns the free linear space in MediaBuffer that can be used to add more data. More...
 

Detailed Description

Provides FIFO semantics and helper functions for MediaBuffer.

Member Function Documentation

static bool_t clear ( MediaBuffer buffer)
static

Clears the data in MediaBuffer and resets the data offset to the beginning of the buffer.

Parameters
bufferA pointer to a MediaBuffer object.
Returns
TRUE The operation is successful, FALSE otherwise.

References MediaBuffer::setData().

static int32_t freeLinearSpace ( MediaBuffer buffer)
static

Returns the free linear space in MediaBuffer that can be used to add more data.

Parameters
bufferA pointer to a MediaBuffer object.
Returns
The free space can range from 0 to the buffer size. If the free space cannot be returned, -1 is returned instead.

References MediaBuffer::capacity(), MediaBuffer::dataOffset(), and MediaBuffer::dataSize().

static bool_t normalize ( MediaBuffer buffer)
static

Moves the data (if any) to the start of the buffer.

Parameters
bufferA pointer to a MediaBuffer object.
Returns
TRUE The operation is successful, FALSE otherwise.

References MediaBuffer::data(), MediaBuffer::dataOffset(), MediaBuffer::dataSize(), MediaBuffer::setData(), and MediaBuffer::start().

static bool_t pop ( MediaBuffer buffer,
int32_t  dataSize 
)
static

Removes data from the beginning of the MediaBuffer data.

Parameters
bufferA pointer to a MediaBuffer object.
dataSizeThe number of bytes that should be removed from the valid data.
Returns
TRUE The operation is successful, FALSE otherwise.

References MediaBuffer::dataOffset(), MediaBuffer::dataSize(), and MediaBuffer::setData().

static bool_t push ( MediaBuffer buffer,
const void *  data,
int32_t  dataSize 
)
static

Adds data at the end of the MediaBuffer data.

Parameters
bufferA pointer to a MediaBuffer object.
dataA pointer to the data that should be added.
dataSizeThe number of bytes that should be added.
Returns
TRUE The operation is successful, FALSE otherwise.

References MediaBuffer::data(), MediaBuffer::dataOffset(), MediaBuffer::dataSize(), and MediaBuffer::setData().