v4l2rtspserver/inc/V4l2MMAPDeviceSource.h

46 lines
1.1 KiB
C
Raw Normal View History

2014-08-17 15:29:08 +00:00
/* ---------------------------------------------------------------------------
** This software is in the public domain, furnished "as is", without technical
** support, and with no warranty, express or implied, as to its usefulness for
** any purpose.
**
** V4L2MMAPDeviceSource.h
**
** V4L2 source using mmap API
**
** -------------------------------------------------------------------------*/
#ifndef V4L2_MMAP_DEVICE_SOURCE
#define V4L2_MMAP_DEVICE_SOURCE
// project
#include "V4l2Device.h"
2014-08-17 15:29:08 +00:00
#define V4L2MMAP_NBBUFFER 10
class V4L2MMAPDeviceSource : public V4L2Device
2014-08-17 15:29:08 +00:00
{
public:
static V4L2MMAPDeviceSource* createNew(V4L2DeviceParameters params);
2014-08-17 15:29:08 +00:00
protected:
V4L2MMAPDeviceSource(V4L2DeviceParameters params) : V4L2Device(params), n_buffers(0) {};
2014-08-17 15:29:08 +00:00
public:
2014-08-17 15:29:08 +00:00
virtual bool captureStart();
virtual size_t read(char* buffer, size_t bufferSize);
virtual bool captureStop();
protected:
2014-09-07 16:41:00 +00:00
unsigned int n_buffers;
2014-08-17 15:29:08 +00:00
struct buffer
{
void * start;
size_t length;
};
buffer m_buffer[V4L2MMAP_NBBUFFER];
};
2014-09-07 16:41:00 +00:00
#endif