-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecorder.h
53 lines (39 loc) · 1.07 KB
/
recorder.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
#ifndef RECORDER_H
#define RECORDER_H
#include <QObject>
#include <glib.h>
#include "gst/gst.h"
#include "gst/video/videooverlay.h"
struct RecorderPipeline{
GstElement* bin;
GstElement* source;
GstElement* videoQueue;
GstElement* videoDepayloader;
GstElement* h264Parser;
GstElement* audioQueue;
GstElement* audioDepayloader;
GstElement* aacParser;
GstElement* muxer;
GstElement* sink;
GstBus* bus;
};
class Recorder : public QObject{
Q_OBJECT
public:
Recorder(QObject *parent = nullptr);
~Recorder();
void buildPipeline(std::string, std::string);
void startRecord();
void stopRecord();
friend void onPadAddedForRecorder(GstElement*, GstPad*, gpointer);
friend gboolean getMessageFromBusForRecorder(GstBus*, GstMessage*, gpointer);
friend gpointer pushEosThread(gpointer);
private:
RecorderPipeline* mRecorderPipeline;
void setPropertiesOfGstElement(std::string, std::string);
void addElements();
void linkElements();
void setBus();
void destroyPipeline();
};
#endif // RECORDER_H