From 68aca503ce6f1fbff4066df7c00cf3d6aef16e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 29 Sep 2017 20:05:22 +0200 Subject: [PATCH] plugins: try to create test display in order When creating the test display for querying capabilites, it try in certain order: DRM, Wayland and finally X11. GLX nor EGL are tried since they are either composited with X11 or Wayland. The reason for this is to reduce the posibility of failure that could blacklist the plugin. https://bugzilla.gnome.org/show_bug.cgi?id=782212 --- gst/vaapi/gstvaapipluginutil.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index d5114b5d99..9ec96a70f3 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -790,12 +790,32 @@ gst_video_info_force_nv12_if_encoded (GstVideoInfo * vinfo) * supported features. * * Returns: a new #GstVaapiDisplay instances. Free with - * gst_vaapi_display_unref () after use. + * gst_vaapi_display_unref () after use. Or %NULL if no VA display is + * available. **/ GstVaapiDisplay * gst_vaapi_create_test_display (void) { - return gst_vaapi_create_display (GST_VAAPI_DISPLAY_TYPE_ANY, NULL); + guint i; + GstVaapiDisplay *display = NULL; + const GstVaapiDisplayType test_display_map[] = { +#if USE_DRM + GST_VAAPI_DISPLAY_TYPE_DRM, +#endif +#if USE_WAYLAND + GST_VAAPI_DISPLAY_TYPE_WAYLAND, +#endif +#if USE_X11 + GST_VAAPI_DISPLAY_TYPE_X11, +#endif + }; + + for (i = 0; G_N_ELEMENTS (test_display_map); i++) { + display = gst_vaapi_create_display (test_display_map[i], NULL); + if (display) + break; + } + return display; } /**