From 8d8a2045bde250a50228df7fa8f24124ec5b0251 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 25 Sep 2015 00:20:57 +0200 Subject: vo_opengl: support new VAAPI EGL interop Should work much better than the old GLX interop code. Requires Mesa 11, and explicitly selecting the X11 EGL backend with: --vo=opengl:backend=x11egl Should it turn out that the new interop works well, we will try to autodetect EGL by default. This code still uses some bad assumptions, like expecting surfaces to be in NV12. (This is probably ok, because virtually all HW will use this format. But we should at least check this on init or so, instead of failing to render an image if our assumption doesn't hold up.) This repo was a lot of help: https://github.com/gbeauchesne/ffvademo The kodi code was also helpful (the magic FourCC it uses for EGL_LINUX_DRM_FOURCC_EXT are nowhere documented, and EGL_IMAGE_INTERNAL_FORMAT_EXT as used in ffvademo does not actually exist). (This is the 3rd VAAPI GL interop that was implemented in this player.) --- video/out/opengl/hwdec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'video/out/opengl/hwdec.c') diff --git a/video/out/opengl/hwdec.c b/video/out/opengl/hwdec.c index ee602fa191..d93dc99397 100644 --- a/video/out/opengl/hwdec.c +++ b/video/out/opengl/hwdec.c @@ -29,6 +29,7 @@ #include "common/msg.h" #include "hwdec.h" +extern const struct gl_hwdec_driver gl_hwdec_vaegl; extern const struct gl_hwdec_driver gl_hwdec_vaglx; extern const struct gl_hwdec_driver gl_hwdec_vda; extern const struct gl_hwdec_driver gl_hwdec_videotoolbox; @@ -36,6 +37,9 @@ extern const struct gl_hwdec_driver gl_hwdec_vdpau; extern const struct gl_hwdec_driver gl_hwdec_dxva2; static const struct gl_hwdec_driver *const mpgl_hwdec_drivers[] = { +#if HAVE_VAAPI_X_EGL + &gl_hwdec_vaegl, +#endif #if HAVE_VAAPI_GLX &gl_hwdec_vaglx, #endif -- cgit v1.2.3