1
0
Fork 0
VideoPlayer/src/mpvobject.h
2018-10-21 14:32:39 +01:00

66 lines
1.1 KiB
C++

#ifndef MPVOBJECT_H
#define MPVOBJECT_H
#include <QQuickFramebufferObject>
#include <mpv/client.h>
#include <mpv/render_gl.h>
#include <mpv/qthelper.hpp>
#include <QObject>
#include <QtGlobal>
#include <QOpenGLContext>
#include <QGuiApplication>
#include <QQuickFramebufferObject>
#include <QtQuick/QQuickWindow>
#include <QtQuick/QQuickView>
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);
void setOption(const QString& name, const QVariant& value);
QVariant getProperty(const QString& name) const;
signals:
void onUpdate();
void positionChanged(int value);
void mpv_events();
private slots:
void doUpdate();
void on_mpv_events();
private:
void handle_mpv_event(mpv_event *event);
};
#endif