It's not really a default if there is only one that can't be changed.
Should we return a ref like e.g. g_volume_monitor_get() does?
Set the "mode" gobject property on the control-source instead. The possible
enum values have been renamed from GST_INTERPOLATE_XXX to
GST_INTERPOLATION_MODE_XXX.
+
+* GstRegistry
+
+ gst_registry_get_default() -> gst_registry_get()
+ gst_default_registry_*(...) -> gst_registry_*(gst_registry_get(), ...)
if (!init_post (NULL, NULL, NULL, NULL))
exit (1);
- list2 = gst_registry_plugin_filter (gst_registry_get_default (),
+ list2 = gst_registry_plugin_filter (gst_registry_get (),
select_all, FALSE, NULL);
/* FIXME this is gross. why don't debug have categories PluginFeatures? */
g_return_val_if_fail (name != NULL, NULL);
- feature = gst_registry_find_feature (gst_registry_get_default (), name,
+ feature = gst_registry_find_feature (gst_registry_get (), name,
GST_TYPE_ELEMENT_FACTORY);
if (feature)
return GST_ELEMENT_FACTORY (feature);
g_return_val_if_fail (name != NULL, FALSE);
g_return_val_if_fail (g_type_is_a (type, GST_TYPE_ELEMENT), FALSE);
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
/* check if feature already exists, if it exists there is no need to update it
* when the registry is getting updated, outdated plugins and all their
data.minrank = minrank;
/* get the feature list using the filter */
- result = gst_default_registry_feature_filter ((GstPluginFeatureFilter)
- element_filter, FALSE, &data);
+ result = gst_registry_feature_filter (gst_registry_get (),
+ (GstPluginFeatureFilter) element_filter, FALSE, &data);
/* sort on rank and name */
result = g_list_sort (result, gst_plugin_feature_rank_compare_func);
/* FIXME: make registry add a weak ref instead */
#if 0
- GstRegistry *registry = gst_registry_get_default ();
+ GstRegistry *registry = gst_registry_get ();
GList *g;
for (g = registry->plugins; g; g = g->next) {
if (g->data == (gpointer) plugin) {
plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
if (gst_plugin_register_func (plugin, &desc, NULL) != NULL) {
GST_INFO ("registered static plugin \"%s\"", name);
- res = gst_default_registry_add_plugin (plugin);
+ res = gst_registry_add_plugin (gst_registry_get (), plugin);
GST_INFO ("added static plugin \"%s\", result: %d", name, res);
}
return res;
plugin = g_object_newv (GST_TYPE_PLUGIN, 0, NULL);
if (gst_plugin_register_func (plugin, &desc, user_data) != NULL) {
GST_INFO ("registered static plugin \"%s\"", name);
- res = gst_default_registry_add_plugin (plugin);
+ res = gst_registry_add_plugin (gst_registry_get (), plugin);
GST_INFO ("added static plugin \"%s\", result: %d", name, res);
}
return res;
g_return_val_if_fail (filename != NULL, NULL);
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
g_static_mutex_lock (&gst_plugin_loading_mutex);
plugin = gst_registry_lookup (registry, filename);
if (new_plugin) {
gst_object_ref (plugin);
- gst_default_registry_add_plugin (plugin);
+ gst_registry_add_plugin (gst_registry_get (), plugin);
}
g_static_mutex_unlock (&gst_plugin_loading_mutex);
GError *error = NULL;
GST_DEBUG ("looking up plugin %s in default registry", name);
- plugin = gst_registry_find_plugin (gst_registry_get_default (), name);
+ plugin = gst_registry_find_plugin (gst_registry_get (), name);
if (plugin) {
GST_DEBUG ("loading plugin %s from file %s", name, plugin->filename);
newplugin = gst_plugin_load_file (plugin->filename, &error);
GST_DEBUG ("loaded plugin %s", feature->plugin_name);
gst_object_unref (plugin);
- real_feature =
- gst_registry_lookup_feature (gst_registry_get_default (),
+ real_feature = gst_registry_lookup_feature (gst_registry_get (),
GST_OBJECT_NAME (feature));
if (real_feature == NULL)
GST_DEBUG ("Looking up plugin '%s' containing plugin feature '%s'",
feature->plugin_name, GST_OBJECT_NAME (feature));
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
plugin = gst_registry_find_plugin (registry, feature->plugin_name);
if (plugin) {
/* Now serialise the plugin details and send */
if (!_priv_gst_registry_chunks_save_plugin (&chunks,
- gst_registry_get_default (), newplugin))
+ gst_registry_get (), newplugin))
goto fail;
/* Store where the header is, write an empty one, then write
}
/**
- * gst_registry_get_default:
+ * gst_registry_get:
*
- * Retrieves the default registry. The caller does not own a reference on the
- * registry, as it is alive as long as GStreamer is initialized.
+ * Retrieves the singleton plugin registry. The caller does not own a
+ * reference on the registry, as it is alive as long as GStreamer is
+ * initialized.
*
- * Returns: (transfer none): The default #GstRegistry.
+ * Returns: (transfer none): the #GstRegistry.
*/
GstRegistry *
-gst_registry_get_default (void)
+gst_registry_get (void)
{
GstRegistry *registry;
GST_DEBUG ("Looking up plugin feature '%s'", feature_name);
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
feature = gst_registry_lookup_feature (registry, feature_name);
if (feature) {
ret = gst_plugin_feature_check_version (feature, min_major, min_minor,
if (plugin) {
GST_INFO ("Loaded plugin: \"%s\"", filename);
- gst_default_registry_add_plugin (plugin);
+ gst_registry_add_plugin (gst_registry_get (), plugin);
} else {
if (err) {
/* Report error to user, and free error */
gboolean do_update = TRUE;
gboolean have_cache = TRUE;
- default_registry = gst_registry_get_default ();
+ default_registry = gst_registry_get ();
registry_file = g_strdup (g_getenv ("GST_REGISTRY"));
if (registry_file == NULL) {
registry_file = g_build_filename (g_get_user_cache_dir (),
GType gst_registry_get_type (void);
-GstRegistry * gst_registry_get_default (void);
+GstRegistry * gst_registry_get (void);
gboolean gst_registry_scan_path (GstRegistry *registry, const gchar *path);
void gst_registry_add_path (GstRegistry * registry, const gchar * path);
}
GST_PLUGIN_FEATURE_CAST (factory)->loaded = TRUE;
- gst_registry_add_feature (gst_registry_get_default (),
+ gst_registry_add_feature (gst_registry_get (),
GST_PLUGIN_FEATURE_CAST (factory));
return TRUE;
GList *
gst_type_find_factory_get_list (void)
{
- return gst_registry_get_feature_list (gst_registry_get_default (),
+ return gst_registry_get_feature_list (gst_registry_get (),
GST_TYPE_TYPE_FIND_FACTORY);
}
entry.type = type;
entry.protocol = protocol;
- possibilities = gst_registry_feature_filter (gst_registry_get_default (),
+ possibilities = gst_registry_feature_filter (gst_registry_get (),
search_by_entry, FALSE, &entry);
return possibilities;
{
GList *plugins, *l;
- plugins = gst_default_registry_get_plugin_list ();
+ plugins = gst_registry_get_plugin_list (gst_registry_get ());
plugins = g_list_sort (plugins, (GCompareFunc) sort_plugins);
for (l = plugins; l != NULL; l = l->next) {
GstPlugin *plugin = GST_PLUGIN (l->data);
ignorelist = g_strsplit (STATE_IGNORE_ELEMENTS, " ", 0);
}
- plugins = gst_registry_get_plugin_list (gst_registry_get_default ());
+ plugins = gst_registry_get_plugin_list (gst_registry_get ());
for (p = plugins; p; p = p->next) {
GstPlugin *plugin = p->data;
continue;
features =
- gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
+ gst_registry_get_feature_list_by_plugin (gst_registry_get (),
gst_plugin_get_name (plugin));
for (f = features; f; f = f->next) {
GList *list, *g;
GstRegistry *registry;
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
list = gst_registry_get_plugin_list (registry);
for (g = list; g; g = g->next) {
GstPlugin *unloaded_plugin;
GstPlugin *loaded_plugin;
- unloaded_plugin = gst_default_registry_find_plugin ("coreelements");
+ unloaded_plugin = gst_registry_find_plugin (gst_registry_get (),
+ "coreelements");
fail_if (unloaded_plugin == NULL, "Failed to find coreelements plugin");
fail_if (GST_OBJECT_REFCOUNT_VALUE (unloaded_plugin) != 2,
"Refcount of unloaded plugin in registry initially should be 2");
GList *list;
GstPlugin *plugin;
- plugin = gst_default_registry_find_plugin ("coreelements");
+ plugin = gst_registry_find_plugin (gst_registry_get (), "coreelements");
fail_if (GST_OBJECT_REFCOUNT_VALUE (plugin) != 2,
"Refcount of plugin in registry should be 2");
- list = gst_registry_get_plugin_list (gst_registry_get_default ());
+ list = gst_registry_get_plugin_list (gst_registry_get ());
fail_if (GST_OBJECT_REFCOUNT_VALUE (plugin) != 3,
"Refcount of plugin in registry+list should be 3");
{
GstPlugin *plugin;
- plugin = gst_registry_find_plugin (gst_registry_get_default (),
- "coreelements");
+ plugin = gst_registry_find_plugin (gst_registry_get (), "coreelements");
fail_if (plugin == NULL, "Failed to find coreelements plugin");
ASSERT_OBJECT_REFCOUNT (plugin, "plugin", 2);
{
GstPluginFeature *feature;
- feature = gst_registry_find_feature (gst_registry_get_default (),
+ feature = gst_registry_find_feature (gst_registry_get (),
"identity", GST_TYPE_ELEMENT_FACTORY);
fail_if (feature == NULL, "Failed to find identity element factory");
fail_if (strcmp (feature->plugin_name, "coreelements"),
"Refcount of plugin in registry should be 2");
fail_if (gst_plugin_is_loaded (plugin), "Expected plugin to be unloaded");
- feature = gst_registry_find_feature (gst_registry_get_default (),
+ feature = gst_registry_find_feature (gst_registry_get (),
"audio/x-au", GST_TYPE_TYPE_FIND_FACTORY);
fail_if (feature == NULL, "Failed to find audio/x-aw typefind factory");
fail_if (feature->plugin != plugin,
GstRegistry *registry;
GList *plugins_before, *plugins_after, *l;
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
fail_unless (registry != NULL);
ASSERT_OBJECT_REFCOUNT (registry, "default registry", 1);
/* refcount should still be 1 the second time */
- registry = gst_registry_get_default ();
+ registry = gst_registry_get ();
fail_unless (registry != NULL);
ASSERT_OBJECT_REFCOUNT (registry, "default registry", 1);
g_print ("%s\n", _("Blacklisted files:"));
- plugins = gst_default_registry_get_plugin_list ();
+ plugins = gst_registry_get_plugin_list (gst_registry_get ());
for (cur = plugins; cur != NULL; cur = g_list_next (cur)) {
GstPlugin *plugin = (GstPlugin *) (cur->data);
if (plugin->flags & GST_PLUGIN_FLAG_BLACKLISTED) {
int plugincount = 0, featurecount = 0, blacklistcount = 0;
GList *plugins, *orig_plugins;
- orig_plugins = plugins = gst_default_registry_get_plugin_list ();
+ orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
while (plugins) {
GList *features, *orig_features;
GstPlugin *plugin;
}
orig_features = features =
- gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
+ gst_registry_get_feature_list_by_plugin (gst_registry_get (),
plugin->desc.name);
while (features) {
GstPluginFeature *feature;
{
GList *plugins, *p, *features, *f;
- plugins = gst_default_registry_get_plugin_list ();
+ plugins = gst_registry_get_plugin_list (gst_registry_get ());
for (p = plugins; p; p = p->next) {
GstPlugin *plugin = (GstPlugin *) (p->data);
features =
- gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
+ gst_registry_get_feature_list_by_plugin (gst_registry_get (),
plugin->desc.name);
for (f = features; f; f = f->next) {
gint num_other = 0;
origlist = features =
- gst_registry_get_feature_list_by_plugin (gst_registry_get_default (),
+ gst_registry_get_feature_list_by_plugin (gst_registry_get (),
plugin->desc.name);
while (features) {
return 0;
}
#endif
- feature = gst_default_registry_find_feature (element_name,
+ feature = gst_registry_find_feature (gst_registry_get (), element_name,
GST_TYPE_TYPE_FIND_FACTORY);
if (feature) {
n_print ("%s: a typefind function\n", element_name);
if (GST_PLUGIN_FEATURE (factory)->plugin_name) {
GstPlugin *plugin;
- plugin = gst_registry_find_plugin (gst_registry_get_default (),
+ plugin = gst_registry_find_plugin (gst_registry_get (),
GST_PLUGIN_FEATURE (factory)->plugin_name);
if (plugin) {
print_plugin_info (plugin);
plugin_name = gst_plugin_get_name (plugin);
/* not interested in typefind factories, only element factories */
- features = gst_registry_get_feature_list (gst_registry_get_default (),
+ features = gst_registry_get_feature_list (gst_registry_get (),
GST_TYPE_ELEMENT_FACTORY);
for (l = features; l != NULL; l = l->next) {
{
GList *plugins, *orig_plugins;
- orig_plugins = plugins = gst_default_registry_get_plugin_list ();
+ orig_plugins = plugins = gst_registry_get_plugin_list (gst_registry_get ());
while (plugins) {
GstPlugin *plugin;
/* otherwise check if it's a plugin */
if (retval) {
- plugin = gst_default_registry_find_plugin (arg);
+ plugin = gst_registry_find_plugin (gst_registry_get (), arg);
/* if there is such a plugin, print out info */
if (plugin) {
gst_registry_find_plugin
gst_registry_fork_is_enabled
gst_registry_fork_set_enabled
- gst_registry_get_default
+ gst_registry_get
gst_registry_get_feature_list
gst_registry_get_feature_list_by_plugin
gst_registry_get_feature_list_cookie