#include <avcap/linux/V4L2_VidCapManager.h>
Inheritance diagram for avcap::V4L2_VidCapManager:
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. |
anonymous enum |
avcap::V4L2_VidCapManager::V4L2_VidCapManager | ( | V4L2_DeviceDescriptor * | dd, | |
FormatManager * | fmt_mgr, | |||
int | nbufs = DEFAULT_BUFFERS | |||
) |
virtual avcap::V4L2_VidCapManager::~V4L2_VidCapManager | ( | ) | [virtual] |
int avcap::V4L2_VidCapManager::init | ( | ) | [virtual] |
int avcap::V4L2_VidCapManager::destroy | ( | ) | [virtual] |
int avcap::V4L2_VidCapManager::startCapture | ( | ) | [virtual] |
int avcap::V4L2_VidCapManager::stopCapture | ( | ) | [virtual] |
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.
Implements avcap::CaptureManager.