From c653cb55f9a97d1bf6d3fc1d0ae30dcd958174a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 12 Feb 2018 17:53:58 +0100 Subject: [PATCH] vaapi: register vaapisink as marginal on wayland vaapsink, when used with the Intel VA-API driver, tries to display surfaces with format NV12, which are handled correctly by Weston. Nonetheless, COGL cannot display YUV surfaces, making fail pipelines on mutter. This shall be solved either by COGL or by making the driver to paint RGB surfaces. In the meanwhile, let's just demote vaapisink as marginal when the Wayland environment is detected, no matter if it is Weston. https://bugzilla.gnome.org/show_bug.cgi?id=775698 --- gst/vaapi/gstvaapi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapi.c b/gst/vaapi/gstvaapi.c index 0edec43c07..9a82454406 100644 --- a/gst/vaapi/gstvaapi.c +++ b/gst/vaapi/gstvaapi.c @@ -210,6 +210,7 @@ plugin_init (GstPlugin * plugin) { GstVaapiDisplay *display; GArray *decoders; + guint rank; plugin_add_dependencies (plugin); @@ -234,8 +235,11 @@ plugin_init (GstPlugin * plugin) gst_element_register (plugin, "vaapidecodebin", GST_RANK_PRIMARY + 2, GST_TYPE_VAAPI_DECODE_BIN); - gst_element_register (plugin, "vaapisink", - GST_RANK_PRIMARY, GST_TYPE_VAAPISINK); + rank = GST_RANK_PRIMARY; + if (g_getenv ("WAYLAND_DISPLAY")) + rank = GST_RANK_MARGINAL; + gst_element_register (plugin, "vaapisink", rank, GST_TYPE_VAAPISINK); + #if USE_ENCODERS gst_vaapiencode_register (plugin, display); #endif