const char *basename);
#define gst_registry_parent_class parent_class
-G_DEFINE_TYPE (GstRegistry, gst_registry, GST_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (GstRegistry, gst_registry, GST_TYPE_OBJECT);
static void
gst_registry_class_init (GstRegistryClass * klass)
gobject_class = (GObjectClass *) klass;
- g_type_class_add_private (klass, sizeof (GstRegistryPrivate));
-
/**
* GstRegistry::plugin-added:
* @registry: the registry that emitted the signal
static void
gst_registry_init (GstRegistry * registry)
{
- registry->priv =
- G_TYPE_INSTANCE_GET_PRIVATE (registry, GST_TYPE_REGISTRY,
- GstRegistryPrivate);
+ registry->priv = gst_registry_get_instance_private (registry);
registry->priv->feature_hash = g_hash_table_new (g_str_hash, g_str_equal);
registry->priv->basename_hash = g_hash_table_new (g_str_hash, g_str_equal);
}
g_mutex_lock (&_gst_registry_mutex);
if (G_UNLIKELY (!_gst_registry_default)) {
- _gst_registry_default = g_object_newv (GST_TYPE_REGISTRY, 0, NULL);
+ _gst_registry_default = g_object_new (GST_TYPE_REGISTRY, NULL);
gst_object_ref_sink (GST_OBJECT_CAST (_gst_registry_default));
}
registry = _gst_registry_default;
/**
* gst_registry_add_plugin:
* @registry: the registry to add the plugin to
- * @plugin: (transfer full): the plugin to add
+ * @plugin: (transfer floating): the plugin to add
*
* Add the plugin to the registry. The plugin-added signal will be emitted.
- * This function will sink @plugin.
+ *
+ * @plugin's reference count will be incremented, and any floating
+ * reference will be removed (see gst_object_ref_sink())
*
* Returns: %TRUE on success.
*
GST_WARNING_OBJECT (registry,
"Not replacing plugin because new one (%s) is blacklisted but for a different location than existing one (%s)",
plugin->filename, existing_plugin->filename);
+ /* Keep reference counting consistent */
+ gst_object_ref_sink (plugin);
gst_object_unref (plugin);
GST_OBJECT_UNLOCK (registry);
return FALSE;
/**
* gst_registry_add_feature:
* @registry: the registry to add the plugin to
- * @feature: (transfer full): the feature to add
+ * @feature: (transfer floating): the feature to add
*
* Add the feature to the registry. The feature-added signal will be emitted.
- * This function sinks @feature.
+ *
+ * @feature's reference count will be incremented, and any floating
+ * reference will be removed (see gst_object_ref_sink())
*
* Returns: %TRUE on success.
*
/**
* gst_registry_scan_path:
* @registry: the registry to add found plugins to
- * @path: the path to scan
+ * @path: (type filename): the path to scan
*
* Scan the given path for plugins to add to the registry. The syntax of the
* path is specific to the registry.