avcap::V4L2_VidCapManager Class Reference

#include <avcap/linux/V4L2_VidCapManager.h>

Inheritance diagram for avcap::V4L2_VidCapManager:

Inheritance graph
[legend]

Detailed Description

The Video4Linux2-API video capture manager.

This class can be used to capture video data from a V4L2 video device. The manager creates a defined number of IOBuffers and permanently reuses them to store the captured data. Since the number of these buffers is finite, it is important that applications call IOBuffer::release() as soon as they don't need the data anymore. The access to the internal buffer-list is synchronized, so release() can be called from any thread at any time. Typical applications don't create objects of this class directly. They obtain an instance from CaptureDevice.


Public Types

enum  { MAX_BUFFERS = 32, DEFAULT_BUFFERS = 16 }
enum  IOMethod { IO_METHOD_NOCAP = 0, IO_METHOD_READ, IO_METHOD_MMAP, IO_METHOD_USERPTR }

Public Member Functions

 V4L2_VidCapManager (V4L2_DeviceDescriptor *dd, FormatManager *fmt_mgr, int nbufs=DEFAULT_BUFFERS)
virtual ~V4L2_VidCapManager ()
int init ()
 Do basic initialization after startup.
int destroy ()
 Called before object destruction.
int startCapture ()
 Start capturing data.
int stopCapture ()
 Stop capturing data.
int getNumIOBuffers ()
 Returns the number of IOBuffers currently available.


Member Enumeration Documentation

anonymous enum

Enumerator:
MAX_BUFFERS  The maximum number of IOBuffers.
DEFAULT_BUFFERS  The default number of used IOBuffers.

enum avcap::V4L2_VidCapManager::IOMethod

Enumerator:
IO_METHOD_NOCAP 
IO_METHOD_READ 
IO_METHOD_MMAP 
IO_METHOD_USERPTR 


Constructor & Destructor Documentation

avcap::V4L2_VidCapManager::V4L2_VidCapManager ( V4L2_DeviceDescriptor dd,
FormatManager fmt_mgr,
int  nbufs = DEFAULT_BUFFERS 
)

virtual avcap::V4L2_VidCapManager::~V4L2_VidCapManager (  )  [virtual]


Member Function Documentation

int avcap::V4L2_VidCapManager::init (  )  [virtual]

Do basic initialization after startup.

Implements avcap::CaptureManager.

int avcap::V4L2_VidCapManager::destroy (  )  [virtual]

Called before object destruction.

Implements avcap::CaptureManager.

int avcap::V4L2_VidCapManager::startCapture (  )  [virtual]

Start capturing data.

Implements avcap::CaptureManager.

int avcap::V4L2_VidCapManager::stopCapture (  )  [virtual]

Stop capturing data.

Implements avcap::CaptureManager.

int avcap::V4L2_VidCapManager::getNumIOBuffers (  )  [virtual]

Returns the number of IOBuffers currently available.

The CaptureManager usually waits to capture the next frame until an IOBuffer is available. The application is reponsible to release the IOBuffers to make it available to the capture manager.

Returns:
the number of IOBuffers.

Implements avcap::CaptureManager.


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