2014-12-09 16:47:02 +00:00
|
|
|
#ifndef MPVRENDERER_H_
|
|
|
|
#define MPVRENDERER_H_
|
|
|
|
|
|
|
|
#include <QtQuick/QQuickFramebufferObject>
|
|
|
|
|
2014-12-09 21:53:34 +00:00
|
|
|
#include <mpv/client.h>
|
|
|
|
#include <mpv/opengl_cb.h>
|
|
|
|
#include <mpv/qthelper.hpp>
|
2014-12-09 16:47:02 +00:00
|
|
|
|
2014-12-30 21:34:34 +00:00
|
|
|
class MpvRenderer;
|
|
|
|
|
2014-12-09 16:47:02 +00:00
|
|
|
class MpvObject : public QQuickFramebufferObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-12-30 21:34:34 +00:00
|
|
|
mpv::qt::Handle mpv;
|
2014-12-09 16:47:02 +00:00
|
|
|
mpv_opengl_cb_context *mpv_gl;
|
|
|
|
|
2014-12-30 21:34:34 +00:00
|
|
|
friend class MpvRenderer;
|
|
|
|
|
2014-12-09 16:47:02 +00:00
|
|
|
public:
|
|
|
|
MpvObject(QQuickItem * parent = 0);
|
|
|
|
virtual ~MpvObject();
|
2014-12-30 21:34:34 +00:00
|
|
|
virtual Renderer *createRenderer() const;
|
2014-12-09 16:47:02 +00:00
|
|
|
public slots:
|
2015-01-05 14:26:57 +00:00
|
|
|
void command(const QVariant& params);
|
2014-12-09 16:47:02 +00:00
|
|
|
signals:
|
|
|
|
void onUpdate();
|
|
|
|
private slots:
|
|
|
|
void doUpdate();
|
|
|
|
private:
|
|
|
|
static void on_update(void *ctx);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|