-
Notifications
You must be signed in to change notification settings - Fork 0
/
videoengine.h
42 lines (37 loc) · 875 Bytes
/
videoengine.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
#ifndef VIDEOENGINE_H
#define VIDEOENGINE_H
#include <QThread>
#include <QImage>
#include <QMutex>
#include "videoprocessor.h"
#include "cvmattoqimage.h"
#include "videoformat.h"
#include "colorkeyerhsv.h"
class VideoEngine : public QThread
{
Q_OBJECT
public:
VideoEngine();
~VideoEngine();
void openFile(const QString& file);
void openCamera(int device = 0, int channel = 0);
void setProcessor(VideoProcessor*);
const VideoFormat& videoFormat() const;
int framePosition();
protected:
void run();
public slots:
void stop();
signals:
void sendInputImage(const QImage&);
void sendProcessedImage(const QImage&);
private:
cv::VideoCapture videoCapture;
VideoFormat _videoFormat;
bool stopped;
QMutex mutex;
VideoProcessor* processor;
bool usingCamera;
int cameraChannel;
};
#endif // VIDEOENGINE_H