-
Notifications
You must be signed in to change notification settings - Fork 0
/
qplayer.h
44 lines (39 loc) · 759 Bytes
/
qplayer.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
#ifndef QPLAYER_H
#define QPLAYER_H
#include <QThread>
#include <QImage>
#include <QWaitCondition>
#include <vector>
#include <qmutex.h>
#include "opencv2/opencv.hpp"
using namespace cv;
using namespace std;
class QPlayer : public QThread
{
Q_OBJECT
public:
QPlayer();
~QPlayer();
private:
QMutex mutex;
QWaitCondition condition;
Mat frame, RGBframe;
int frameRate;
float fscale;
VideoCapture capture;
QImage img;
bool m_bOpen;
vector<Mat> bufferFrames;
int m_nPlaySpeed;
protected:
void run();
signals:
void processedImage(QImage qImg);
public:
bool loadCamera(int nIndex);
bool isCameraOpened();
void push_mat(Mat mImg);
void pop_mat();
void read_mat(Mat& mImg);
};
#endif // QPLAYER_H