omx: allow 0 feature
authorJulien Isorce <jisorce@oblong.com>
Sat, 20 May 2017 13:49:20 +0000 (14:49 +0100)
committerJulien Isorce <jisorce@oblong.com>
Sun, 21 May 2017 14:40:11 +0000 (15:40 +0100)
Previously the omx plugin was blacklisted if GST_OMX_CONFIG_DIR
points to an invalid path or if the gstomx.conf contains 0 valid
component.
Problem is that once the plugin is blacklisted, a rescan is not
triggered upon changes of the env var or the gstomx.conf file
despite being setup with gst_plugin_add_dependency.

This also makes it more consistent with other plugins that auto
generate features. For example gst-{ffmeg,libav}, gstreamer-vaapi,
v4l2 video dec.

To clarify the diff, the plugin_init func will return TRUE even if
g_key_file_get_groups returns 0 element and even if
g_key_file_load_from_dirs fails.

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

omx/gstomx.c

index 214f618..90bc059 100644 (file)
@@ -2659,7 +2659,6 @@ _class_init (gpointer g_class, gpointer data)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret = FALSE;
   GError *err = NULL;
   gchar **config_dirs;
   gchar **elements;
@@ -2807,7 +2806,7 @@ plugin_init (GstPlugin * plugin)
     }
     subtype = g_type_register_static (type, type_name, &type_info, 0);
     g_free (type_name);
-    ret |= gst_element_register (plugin, elements[i], rank, subtype);
+    gst_element_register (plugin, elements[i], rank, subtype);
   }
   g_strfreev (elements);
 
@@ -2815,7 +2814,7 @@ done:
   g_free (env_config_dir);
   g_free (config_dirs);
 
-  return ret;
+  return TRUE;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,