-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgstqmlrenderer.h
70 lines (63 loc) · 1.71 KB
/
gstqmlrenderer.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
60
61
62
63
64
65
66
67
68
69
70
#ifndef GSTQMLRENDERER_H
#define GSTQMLRENDERER_H
#include <QObject>
#include <QUrl>
#include <gst/gst.h>
class QSurfaceFormat;
class QOpenGLContext;
typedef struct _GstGLDisplay GstGLDisplay;
typedef struct _GstGLContext GstGLContext;
class QQmlEngine;
class QQuickRenderControl;
class QQuickWindow;
class QQmlComponent;
class QQuickItem;
class QOffscreenSurface;
class QOpenGLFramebufferObject;
class QTimer;
typedef struct _GstVideoInfo GstVideoInfo;
class GstQmlRenderer : public QObject
{
friend gboolean sync_bus_call (GstBus *, GstMessage *, GstQmlRenderer *);
Q_OBJECT
public:
explicit GstQmlRenderer(QObject *parent = nullptr);
void start();
private:
QUrl _qmlUrl = QUrl("qrc:/KStream/Content.qml");
int _width = 640;
int _height = 480;
int _framerate = 60;
QSurfaceFormat * _surfaceFormat;
QOpenGLContext * _qcontext;
GstGLDisplay * _display;
GstGLContext * _gstQtContext;
GstGLContext * _gstGstContext;
uint _gstFbo;
QQmlEngine * _qmlEngine;
QQuickRenderControl * _renderControl;
QQuickWindow * _quickWindow;
QQmlComponent * _qmlComponent;
QQuickItem * _rootItem;
QOffscreenSurface * _offscreenSurface;
QOpenGLFramebufferObject * _fbo;
GstElement * _pipeline;
GstElement * _appSource;
GstElement * _gldownload;
GstElement * _queue;
GstElement * _vaapisink;
QTimer * _renderTimer;
GstAllocator * _gstMemoryAllocator;
GstVideoInfo * _gstVideoInfo;
qint64 _startTime;
void createGlContexts();
void createWindow();
void createFramebuffer();
void setupRendering();
void createPipeline();
void startPipeline();
void startRendering();
void render();
signals:
};
#endif // GSTQMLRENDERER_H