#include <avcap/IOBuffer.h>
The class contains the captured data and provides additional information, e.g. sequence number, valid bytes and a capture timestamp. The data in the buffer may not correspond exactly to one frame, e.g. if the captured data is part of a stream (e.g. MPEG).
Public Types | |
enum | State { STATE_USED = 0, STATE_UNUSED } |
Use-state of the buffer. More... | |
Public Member Functions | |
IOBuffer (CaptureManager *mgr, void *ptr, size_t size, int index=0) | |
Constructor. | |
virtual | ~IOBuffer () |
void * | getPtr () const |
Get the pointer to the frame data. | |
size_t | getSize () const |
Returns the maximum number of bytes the buffer can contain. | |
long | getSequence () const |
Return the sequence number of the frame. | |
size_t | getValidBytes () const |
Returns the number of valid bytes in the buffer. | |
unsigned long | getTimestamp () |
Returns a timestamp in milliseconds. | |
void | release () |
Must be called by the application after the buffer isn't used anymore to to enable its reutilization. | |
int | getIndex () const |
Get the index of the buffer. | |
void | setState (State state) |
Set the state of the buffer. | |
State | getState () const |
Get the buffer usage state. | |
void | setParams (const size_t valid, State state, struct timeval &ts, int seq) |
Set buffer parameters. |
IOBuffer::IOBuffer | ( | CaptureManager * | mgr, | |
void * | ptr, | |||
size_t | size, | |||
int | index = 0 | |||
) |
Constructor.
IOBuffer::~IOBuffer | ( | ) | [virtual] |
void* avcap::IOBuffer::getPtr | ( | ) | const [inline] |
Get the pointer to the frame data.
size_t avcap::IOBuffer::getSize | ( | ) | const [inline] |
Returns the maximum number of bytes the buffer can contain.
long avcap::IOBuffer::getSequence | ( | ) | const [inline] |
Return the sequence number of the frame.
size_t avcap::IOBuffer::getValidBytes | ( | ) | const [inline] |
Returns the number of valid bytes in the buffer.
unsigned long IOBuffer::getTimestamp | ( | ) |
Returns a timestamp in milliseconds.
void IOBuffer::release | ( | ) |
Must be called by the application after the buffer isn't used anymore to to enable its reutilization.
int avcap::IOBuffer::getIndex | ( | ) | const [inline] |
Get the index of the buffer.
void avcap::IOBuffer::setState | ( | State | state | ) | [inline] |
Set the state of the buffer.
This method should not be used by applications. /*!
state | : the new state |
State avcap::IOBuffer::getState | ( | ) | const [inline] |
Get the buffer usage state.
void IOBuffer::setParams | ( | const size_t | valid, | |
State | state, | |||
struct timeval & | ts, | |||
int | seq | |||
) |
Set buffer parameters.
This method should not be used by applications.
valid | : number of valid bytes in buffer | |
state | : the current buffer state | |
ts | : the timestamp the data was captured | |
seq | : the sequence number of the captured data |