forked from Stremio/stremio-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmpv.h
More file actions
42 lines (34 loc) · 975 Bytes
/
Copy pathmpv.h
File metadata and controls
42 lines (34 loc) · 975 Bytes
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 MPVRENDERER_H_
#define MPVRENDERER_H_
#include <QtQuick/QQuickFramebufferObject>
#include <mpv/client.h>
#include <mpv/opengl_cb.h>
#include <mpv/qthelper.hpp>
class MpvRenderer;
class MpvObject : public QQuickFramebufferObject
{
Q_OBJECT
mpv::qt::Handle mpv;
mpv_opengl_cb_context *mpv_gl;
friend class MpvRenderer;
public:
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 on_update(void *ctx);
static void wakeup(void *ctx);
void handle_mpv_event(mpv_event *event);
};
#endif