gst/gsttypefind.c: Make gst_type_find_register work for static typefind functions...
authorTim-Philipp Müller <tim@centricular.net>
Fri, 21 Dec 2007 20:58:23 +0000 (20:58 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Fri, 21 Dec 2007 20:58:23 +0000 (20:58 +0000)
Original commit message from CVS:
* gst/gsttypefind.c: (gst_type_find_register):
Make gst_type_find_register work for static typefind functions,
ie. allow passing plugin == NULL (prerequisite for #498924).
* gst/gstelementfactory.c: (gst_element_register):
Small docs addition.

ChangeLog
gst/gstelementfactory.c
gst/gsttypefind.c

index e684da4..41d8d57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-12-21  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/gsttypefind.c: (gst_type_find_register):
+         Make gst_type_find_register work for static typefind functions,
+         ie. allow passing plugin == NULL (prerequisite for #498924).
+
+       * gst/gstelementfactory.c: (gst_element_register):
+         Small docs addition.
+
 2007-12-21  Wim Taymans  <wim.taymans@collabora.co.uk>
 
        * gst/gstpad.c: (gst_pad_dispose):
index aed6898..02a3ce3 100644 (file)
@@ -254,7 +254,8 @@ gst_element_factory_cleanup (GstElementFactory * factory)
 
 /**
  * gst_element_register:
- * @plugin: #GstPlugin to register the element with
+ * @plugin: #GstPlugin to register the element with, or NULL for a static
+ * element (note that passing NULL only works in GStreamer 0.10.13 and later)
  * @name: name of elements of this type
  * @rank: rank of element (higher rank means more importance when autoplugging)
  * @type: GType of element to register
index dafc8e1..219b03b 100644 (file)
@@ -51,7 +51,8 @@ gst_type_find_get_type (void)
 
 /**
  * gst_type_find_register:
- * @plugin: A #GstPlugin.
+ * @plugin: A #GstPlugin, or NULL for a static typefind function (note that
+ *    passing NULL only works in GStreamer 0.10.16 and later)
  * @name: The name for registering
  * @rank: The rank (or importance) of this typefind function
  * @func: The #GstTypeFindFunction to use
@@ -76,7 +77,6 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank,
 {
   GstTypeFindFactory *factory;
 
-  g_return_val_if_fail (plugin != NULL, FALSE);
   g_return_val_if_fail (name != NULL, FALSE);
   g_return_val_if_fail (func != NULL, FALSE);
 
@@ -96,7 +96,11 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank,
   factory->function = func;
   factory->user_data = data;
   factory->user_data_notify = data_notify;
-  GST_PLUGIN_FEATURE (factory)->plugin_name = plugin->desc.name;        /* interned string */
+  if (plugin && plugin->desc.name) {
+    GST_PLUGIN_FEATURE (factory)->plugin_name = plugin->desc.name;      /* interned string */
+  } else {
+    GST_PLUGIN_FEATURE (factory)->plugin_name = "NULL";
+  }
   GST_PLUGIN_FEATURE (factory)->loaded = TRUE;
 
   gst_registry_add_feature (gst_registry_get_default (),