h
This commit is contained in:
parent
eca87bfcfd
commit
b794a741aa
|
@ -36,12 +36,6 @@ on_mpv_redraw(void* ctx)
|
||||||
reinterpret_cast<MPVBackend*>(ctx), "update", Qt::QueuedConnection);
|
reinterpret_cast<MPVBackend*>(ctx), "update", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
class MpvRenderer : public QQuickFramebufferObject::Renderer
|
|
||||||
{
|
|
||||||
MPVBackend* obj;
|
|
||||||
|
|
||||||
static void*
|
static void*
|
||||||
get_proc_address_mpv(void* ctx, const char* name)
|
get_proc_address_mpv(void* ctx, const char* name)
|
||||||
{
|
{
|
||||||
|
@ -51,11 +45,15 @@ get_proc_address_mpv(void* ctx, const char* name)
|
||||||
std::cerr << "No GLCTX :(" << std::endl;
|
std::cerr << "No GLCTX :(" << std::endl;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return reinterpret_cast<void*>(glctx->getProcAddress(QByteArray(name)));
|
return reinterpret_cast<void*>(glctx->getProcAddress(QByteArray(name)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
class MpvRenderer : public QQuickFramebufferObject::Renderer
|
||||||
|
{
|
||||||
|
MPVBackend* obj;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MpvRenderer(MPVBackend* new_obj)
|
MpvRenderer(MPVBackend* new_obj)
|
||||||
: obj{ new_obj }
|
: obj{ new_obj }
|
||||||
|
@ -70,7 +68,6 @@ public:
|
||||||
{
|
{
|
||||||
// init mpv_gl:
|
// init mpv_gl:
|
||||||
if (!obj->mpv_gl) {
|
if (!obj->mpv_gl) {
|
||||||
QOpenGLContext* glctx = QOpenGLContext::currentContext();
|
|
||||||
mpv_opengl_init_params gl_init_params{ get_proc_address_mpv,
|
mpv_opengl_init_params gl_init_params{ get_proc_address_mpv,
|
||||||
nullptr,
|
nullptr,
|
||||||
nullptr };
|
nullptr };
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
#include "src/enums.hpp"
|
#include "src/enums.hpp"
|
||||||
#include "src/utils.hpp"
|
#include "src/utils.hpp"
|
||||||
|
|
||||||
|
class MpvRenderer;
|
||||||
|
|
||||||
class MPVBackend
|
class MPVBackend
|
||||||
: public QQuickFramebufferObject
|
: public QQuickFramebufferObject
|
||||||
, public BackendInterface
|
, public BackendInterface
|
||||||
|
|
Loading…
Reference in a new issue