avcap::IOBuffer Class Reference

#include <avcap/IOBuffer.h>


Detailed Description

The buffer to store captured data.

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.


Member Enumeration Documentation

enum avcap::IOBuffer::State

Use-state of the buffer.

Enumerator:
STATE_USED 
STATE_UNUSED  > currently used


Constructor & Destructor Documentation

IOBuffer::IOBuffer ( CaptureManager mgr,
void *  ptr,
size_t  size,
int  index = 0 
)

Constructor.

IOBuffer::~IOBuffer (  )  [virtual]


Member Function Documentation

void* avcap::IOBuffer::getPtr (  )  const [inline]

Get the pointer to the frame data.

Returns:
the captured data.

size_t avcap::IOBuffer::getSize (  )  const [inline]

Returns the maximum number of bytes the buffer can contain.

Returns:
Size of buffer in bytes.

long avcap::IOBuffer::getSequence (  )  const [inline]

Return the sequence number of the frame.

Returns:
Sequence number

size_t avcap::IOBuffer::getValidBytes (  )  const [inline]

Returns the number of valid bytes in the buffer.

Returns:
Number of valid bytes

unsigned long IOBuffer::getTimestamp (  ) 

Returns a timestamp in milliseconds.

Returns:
timestamp

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.

Returns:
the buffer index.

void avcap::IOBuffer::setState ( State  state  )  [inline]

Set the state of the buffer.

This method should not be used by applications. /*!

Parameters:
state : the new state

State avcap::IOBuffer::getState (  )  const [inline]

Get the buffer usage state.

Returns:
the current buffer 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.

Parameters:
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


The documentation for this class was generated from the following files:
Generated on Mon Nov 30 11:10:32 2009 for avcap-0.1 by  doxygen 1.5.1