-
Notifications
You must be signed in to change notification settings - Fork 0
/
capture.h
56 lines (48 loc) · 1.2 KB
/
capture.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
#ifndef CAPTURE_H
#define CAPTURE_H
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include <QObject>
#include <QImage>
#include <QMutex>
#include <opencv2/opencv.hpp>
//for tictoc
#include <time.h>
class capture : public QObject
{
Q_OBJECT
public:
explicit capture(QString config, QObject *parent = nullptr);
~capture();
cv::Mat getFrame();
void change_property(int i, QString str);
void change_property(QString prop, float num);
QString get_stringproperty(QString prop, QString &value);
int get_intproperty(QString prop, int &value);
float get_floatproperty(QString prop, float &value);
void event_bringup();
void setStatePlaying();
void setStatePause();
void setStateReady();
// void oneShot();
QString m_MediaType;
QString m_format;
signals:
void frameArived();
public slots:
private:
static GstFlowReturn newSample(GstAppSink* sink, gpointer gSelf);
GstElement* m_pipeline;
GstElement *sink, *src, *conv;
// QImage m_image;
// QImage m_image2;
cv::Mat m_cv1;
cv::Mat m_cv2;
// cv::Mat m_cv[2];
int m_imFlag;
QMutex m_mutex;
GstEvent * event;
int counter;
//int idxs;
};
#endif // CAPTURE_H