-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvclinxvideocapture.h
59 lines (47 loc) · 1.15 KB
/
vclinxvideocapture.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef VCLINXVIDEOCAPTURE_H
#define VCLINXVIDEOCAPTURE_H
#include <QObject>
#include <vector>
#include <QString>
#include <stdint.h>
#include <thread>
#include <linux/videodev2.h>
#include "datasink.h"
enum IOMethod {
IO_METHOD_READ,
IO_METHOD_MMAP
};
typedef struct {
QString devName;
enum IOMethod readMethod;
uint32_t fourcc;
uint32_t bestWidth;
uint32_t bestHeight;
uint32_t framerateNum;
uint32_t framerateDen;
}DeviceCaps;
typedef std::vector<DeviceCaps*> QListDevices;
class VCLinxVideoCapture : public QObject
{
Q_OBJECT
protected:
QListDevices mListDevices;
int mOpenedDevice;
std::thread* mMainThreadHandle;
volatile bool mRunningFlag;
std::vector<void*> mBufferRequested;
uint32_t mBufferLength;
unsigned mOpenedDeviceIdx;
static void mainThread(void* opaque);
public:
VCLinxVideoCapture(QObject *parent = 0);
virtual ~VCLinxVideoCapture();
unsigned numberDevices();
const QListDevices& getDevices() const;
bool openDevice(unsigned idx);
void closeDevice();
signals:
void sendCapturedImg(VideoImage* img);
public slots:
};
#endif // VCLINXVIDEOCAPTURE_H