summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-09-27 21:24:35 +0200
committerwm4 <wm4@nowhere>2015-09-27 21:38:45 +0200
commit8aa8417aa35fd30990a1695380f22179848c6463 (patch)
treeb261790ecaa06c6561721a07eb8c16957194f01a /video
parent1fa674c109c05e082bf0fb43be064cbdabea3327 (diff)
downloadmpv-8aa8417aa35fd30990a1695380f22179848c6463.tar.bz2
mpv-8aa8417aa35fd30990a1695380f22179848c6463.tar.xz
vo_opengl: vaapi: add Wayland support
Pretty trivial with the new EGL interop. Fixes #478.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/hwdec_vaegl.c15
-rw-r--r--video/out/opengl/wayland.c3
2 files changed, 18 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_vaegl.c b/video/out/opengl/hwdec_vaegl.c
index 90c7478d94..580e014423 100644
--- a/video/out/opengl/hwdec_vaegl.c
+++ b/video/out/opengl/hwdec_vaegl.c
@@ -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)
@@ -66,6 +76,11 @@ static VADisplay *create_native_va_display(GL *gl)
if (display)
return display;
#endif
+#if HAVE_VAAPI_WAYLAND
+ display = create_wayland_va_display(gl);
+ if (display)
+ return display;
+#endif
return display;
}
diff --git a/video/out/opengl/wayland.c b/video/out/opengl/wayland.c
index 2963ec8985..b4d74ef98d 100644
--- a/video/out/opengl/wayland.c
+++ b/video/out/opengl/wayland.c
@@ -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;
}