Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
Player: fix vaapi-egl support
Browse files Browse the repository at this point in the history
Broken in 5430cd8
  • Loading branch information
rcombs committed Jan 15, 2021
1 parent 5430cd8 commit 5d099a1
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions src/player/PlayerQuickItem.cpp
Expand Up @@ -25,12 +25,6 @@

#ifdef USE_X11EXTRAS
#include <QX11Info>
static void* MPGetNativeDisplay(const char* name)
{
if (strcmp(name, "x11") == 0)
return QX11Info::display();
return nullptr;
}
#endif

///////////////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -43,14 +37,6 @@ static void* get_proc_address(void* ctx, const char* name)
return nullptr;

void *res = (void *)glctx->getProcAddress(QByteArray(name));
if (strcmp(name, "glMPGetNativeDisplay") == 0)
{
#ifdef USE_X11EXTRAS
return (void *)&MPGetNativeDisplay;
#else
return nullptr;
#endif
}
#ifdef Q_OS_WIN32
// wglGetProcAddress(), which is used by Qt, does not always resolve all
// builtin functions with all drivers (only extensions). Qt compensates this
Expand Down Expand Up @@ -105,18 +91,17 @@ bool PlayerRenderer::init()
DwmEnableMMCSS(TRUE);
#endif


// Signals presence of MPGetNativeDisplay().
const char *extensions = "GL_MP_MPGetNativeDisplay";

mpv_opengl_init_params opengl_params = {
.get_proc_address = get_proc_address,
.get_proc_address_ctx = NULL,
.extra_exts = extensions,
};

mpv_render_param params[] = {
{MPV_RENDER_PARAM_API_TYPE, (void*)MPV_RENDER_API_TYPE_OPENGL},
{MPV_RENDER_PARAM_OPENGL_INIT_PARAMS, &opengl_params},
#ifdef USE_X11EXTRAS
{MPV_RENDER_PARAM_X11_DISPLAY, QX11Info::display()},
#endif
{MPV_RENDER_PARAM_INVALID},
};
int err = mpv_render_context_create(&m_mpvGL, m_mpv, params);
Expand Down

0 comments on commit 5d099a1

Please sign in to comment.