diff --git a/ChangeLog b/ChangeLog index e684da4336..41d8d57bf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-12-21 Tim-Philipp Müller + + * 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 * gst/gstpad.c: (gst_pad_dispose): diff --git a/gst/gstelementfactory.c b/gst/gstelementfactory.c index aed6898460..02a3ce3bb7 100644 --- a/gst/gstelementfactory.c +++ b/gst/gstelementfactory.c @@ -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 diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c index dafc8e165f..219b03b2c8 100644 --- a/gst/gsttypefind.c +++ b/gst/gsttypefind.c @@ -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 (),