From 375886c7779c805e46f79ff3c648f9005bb47830 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 26 Sep 2015 20:28:36 +0200 Subject: vo_opengl: probe for EGL by default Normally, we prefer GLX on X11. But for the VAAPI EGL interop, we obviously want EGL. Since nvidia does not provide EGL with desktop GL yet, we can leave it to the autoprobing. Just make sure some failure messages don't unnecessarily show up in the nvidia case. This breaks VAAPI GLX interop by default, but I don't care much. If you use --hwdec=auto (which you should if you want hw decoding), this should fallback to vaapi-copy instead. --- video/out/opengl/common.c | 6 +++--- video/out/opengl/x11egl.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'video') diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index 8eafc09d25..43d9375155 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -533,12 +533,12 @@ static const struct backend backends[] = { #if HAVE_GL_WAYLAND {"wayland", mpgl_set_backend_wayland}, #endif -#if HAVE_GL_X11 - {.driver = &mpgl_driver_x11}, -#endif #if HAVE_EGL_X11 {.driver = &mpgl_driver_x11egl}, #endif +#if HAVE_GL_X11 + {.driver = &mpgl_driver_x11}, +#endif }; int mpgl_find_backend(const char *name) diff --git a/video/out/opengl/x11egl.c b/video/out/opengl/x11egl.c index 1559e5ba8a..b196b7d9f4 100644 --- a/video/out/opengl/x11egl.c +++ b/video/out/opengl/x11egl.c @@ -123,6 +123,7 @@ static int mpegl_init(struct MPGLContext *ctx, int flags) struct priv *p = ctx->priv; struct vo *vo = ctx->vo; bool es = flags & VOFLAG_GLES; + int msgl = vo->probing ? MSGL_V : MSGL_FATAL; if (!vo_x11_init(vo)) goto uninit; @@ -130,13 +131,13 @@ static int mpegl_init(struct MPGLContext *ctx, int flags) p->x_display = vo->x11->display; if (!eglBindAPI(es ? EGL_OPENGL_ES_API : EGL_OPENGL_API)) { - MP_FATAL(vo, "Could not bind API (%s).\n", es ? "GLES" : "GL"); + mp_msg(vo->log, msgl, "Could not bind API (%s).\n", es ? "GLES" : "GL"); goto uninit; } p->egl_display = eglGetDisplay(vo->x11->display); if (!eglInitialize(p->egl_display, NULL, NULL)) { - MP_FATAL(vo, "Could not initialize EGL.\n"); + mp_msg(vo->log, msgl, "Could not initialize EGL.\n"); goto uninit; } -- cgit v1.2.3