-
Notifications
You must be signed in to change notification settings - Fork 127
/
mpv.h
50 lines (37 loc) · 1.05 KB
/
mpv.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
#ifndef MPVRENDERER_H_
#define MPVRENDERER_H_
#define MPV_ENABLE_DEPRECATED 0
#include <QtQuick/QQuickFramebufferObject>
#include <mpv/client.h>
#include <mpv/render_gl.h>
#include <mpv/qthelper.hpp>
class MpvRenderer;
class MpvObject : public QQuickFramebufferObject
{
Q_OBJECT
mpv_handle *mpv;
mpv_render_context *mpv_gl;
friend class MpvRenderer;
public:
static void on_update(void *ctx);
MpvObject(QQuickItem * parent = 0);
virtual ~MpvObject();
virtual Renderer *createRenderer() const;
public slots:
void command(const QVariant& params);
void setProperty(const QString& name, const QVariant& value);
QVariant getProperty(const QString& name);
void observeProperty(const QString& name);
signals:
void onUpdate();
void mpvEvent(const QString& ev, const QVariant& value);
private slots:
void doUpdate();
void on_mpv_events();
private:
static void wakeup(void *ctx);
void handle_mpv_event(mpv_event *event);
void initialize_mpv();
QSet<QString> observed_properties;
};
#endif