1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-23 16:36:56 +00:00

vo_opengl: vaapi: add Wayland support

Pretty trivial with the new EGL interop.

Fixes #478.
This commit is contained in:
wm4 2015-09-27 21:24:35 +02:00
parent 1fa674c109
commit 8aa8417aa3
4 changed files with 31 additions and 2 deletions

View File

@ -612,6 +612,12 @@ _vaapi=$(defretval)
define_yes_no $_vaapi HAVE_VAAPI_HWACCEL
define_yes_no $_vaapi HAVE_VAAPI_X11
_vaapi_wayland=no
if test "$_vaapi" = yes ; then
_vaapi_wayland=auto
fi
check_pkg_config "VAAPI Wayland" $_vaapi_wayland VAAPI_WAYLAND 'libva-wayland >= 0.34.0'
if test "$_vaapi" = yes ; then
check_pkg_config "VAAPI VPP" auto VAAPI_VPP 'libva >= 0.34.0'
else

View File

@ -56,6 +56,16 @@ static VADisplay *create_x11_va_display(GL *gl)
}
#endif
#if HAVE_VAAPI_WAYLAND
#include <va/va_wayland.h>
static VADisplay *create_wayland_va_display(GL *gl)
{
struct wl_display *wl = gl->MPGetNativeDisplay("wl");
return wl ? vaGetDisplayWl(wl) : NULL;
}
#endif
static VADisplay *create_native_va_display(GL *gl)
{
if (!gl->MPGetNativeDisplay)
@ -65,6 +75,11 @@ static VADisplay *create_native_va_display(GL *gl)
display = create_x11_va_display(gl);
if (display)
return display;
#endif
#if HAVE_VAAPI_WAYLAND
display = create_wayland_va_display(gl);
if (display)
return display;
#endif
return display;
}

View File

@ -124,6 +124,9 @@ static bool egl_create_context(struct vo_wayland_state *wl,
mpgl_load_functions(gl, (void*(*)(const GLubyte*))eglGetProcAddress, eglstr,
wl->log);
ctx->native_display_type = "wl";
ctx->native_display = wl->display.display;
return true;
}

View File

@ -640,13 +640,18 @@ video_output_features = [
'name': '--vaapi',
'desc': 'VAAPI acceleration',
'deps': [ 'libdl' ],
'deps_any': [ 'x11' ],
'deps_any': [ 'x11', 'wayland' ],
'func': check_pkg_config('libva', '>= 0.34.0'),
}, {
'name': '--vaapi-x11',
'desc': 'VAAPI (X11 support)',
'deps': [ 'vaapi', 'x11' ],
'func': check_pkg_config('libva-x11', '>= 0.34.0'),
}, {
'name': '--vaapi-wayland',
'desc': 'VAAPI (Wayland support)',
'deps': [ 'vaapi', 'wayland' ],
'func': check_pkg_config('libva-wayland', '>= 0.34.0'),
}, {
'name': '--vaapi-vpp',
'desc': 'VAAPI VPP',
@ -666,7 +671,7 @@ video_output_features = [
'name': 'vaapi-egl',
'desc': 'VAAPI EGL',
'deps': [ 'c11-tls' ], # indirectly
'deps_any': [ 'vaapi-x-egl' ],
'deps_any': [ 'vaapi-x-egl', 'vaapi-wayland' ],
'func': check_true,
}, {
'name': '--caca',