vaapi: don't register if VA driver is unsupported
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Wed, 29 Jun 2016 10:36:26 +0000 (12:36 +0200)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Fri, 22 Jul 2016 15:23:23 +0000 (17:23 +0200)
Using the test VA display, the driver name is queried, and if it is not
white-listed, the plugin rejects to register any element.

https://bugzilla.gnome.org/show_bug.cgi?id=724352

gst/vaapi/gstvaapi.c

index f52f1f4..8ec4046 100644 (file)
@@ -88,6 +88,8 @@ plugin_init (GstPlugin * plugin)
   display = gst_vaapi_create_test_display ();
   if (!display)
     goto error_no_display;
+  if (!gst_vaapi_driver_is_whitelisted (display))
+    goto unsupported_driver;
 
   gst_vaapidecode_register (plugin);
 
@@ -133,6 +135,11 @@ error_no_display:
      * transient condition */
     return TRUE;
   }
+unsupported_driver:
+  {
+    gst_vaapi_display_unref (display);
+    return TRUE;                /* return TRUE to avoid get blacklisted */
+  }
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,