diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvadisplay.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvadisplay.c index 7728ffc453..afeca81266 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvadisplay.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvadisplay.c @@ -128,6 +128,7 @@ _gst_va_display_filter_driver (GstVaDisplay * self, gpointer foreign_display) GstVaDisplayPrivate *priv = GET_PRIV (self); VADisplay dpy; const char *vendor; + GstVaImplementation impl; g_assert ((foreign_display != NULL) ^ (priv->display != NULL)); dpy = foreign_display ? foreign_display : priv->display; @@ -135,13 +136,19 @@ _gst_va_display_filter_driver (GstVaDisplay * self, gpointer foreign_display) vendor = vaQueryVendorString (dpy); GST_INFO ("VA-API driver vendor: %s", vendor); - /* XXX(victor): driver allow list */ + impl = _get_implementation (vendor); if (foreign_display) { priv->display = foreign_display; priv->foreign = TRUE; + } else { + if (g_getenv ("GST_VA_ALL_DRIVERS") == NULL + && impl == GST_VA_IMPLEMENTATION_OTHER) { + GST_WARNING_OBJECT (self, "Unsupported driver: %s", vendor); + return FALSE; + } } - priv->impl = _get_implementation (vendor); + priv->impl = impl; priv->vendor_desc = _get_desc (vendor, priv->impl); return TRUE; @@ -164,6 +171,7 @@ gst_va_display_set_display (GstVaDisplay * self, gpointer display) /* assume driver is already initialized */ priv->init = TRUE; + /* assumed that user knows what's doing so all drivers are allowed */ _gst_va_display_filter_driver (self, display); } diff --git a/subprojects/gst-plugins-bad/sys/va/plugin.c b/subprojects/gst-plugins-bad/sys/va/plugin.c index 52924dcaa5..eff0606d29 100644 --- a/subprojects/gst-plugins-bad/sys/va/plugin.c +++ b/subprojects/gst-plugins-bad/sys/va/plugin.c @@ -58,7 +58,7 @@ static void plugin_add_dependencies (GstPlugin * plugin) { #ifndef G_OS_WIN32 - const gchar *env_vars[] = { "LIBVA_DRIVER_NAME", NULL }; + const gchar *env_vars[] = { "LIBVA_DRIVER_NAME", "GST_VA_ALL_DRIVERS", NULL }; const gchar *kernel_paths[] = { "/dev/dri", NULL }; const gchar *kernel_names[] = { "renderD", NULL }; @@ -66,7 +66,8 @@ plugin_add_dependencies (GstPlugin * plugin) gst_plugin_add_dependency (plugin, NULL, kernel_paths, kernel_names, GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX); - /* features get updated upon changes on LIBVA_DRIVER_NAME envvar */ + /* features get updated upon changes on LIBVA_DRIVER_NAME and + * GST_VA_ALL_DRIVERS envvar */ gst_plugin_add_dependency (plugin, env_vars, NULL, NULL, GST_PLUGIN_DEPENDENCY_FLAG_NONE);