2002-04-12 09:53:00 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
*
|
|
|
|
* gstregistry.c: handle registry
|
2004-03-15 15:16:04 +00:00
|
|
|
*
|
2002-04-12 09:53:00 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2004-04-28 23:26:06 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2002-04-12 09:53:00 +00:00
|
|
|
#include <glib.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
2004-04-28 23:26:06 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
2002-04-12 09:53:00 +00:00
|
|
|
#include <unistd.h>
|
2004-04-28 23:26:06 +00:00
|
|
|
#endif
|
2002-04-12 09:53:00 +00:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2003-06-29 14:05:49 +00:00
|
|
|
#include "gst_private.h"
|
|
|
|
|
2002-04-12 09:53:00 +00:00
|
|
|
#include "gstinfo.h"
|
|
|
|
#include "gstregistry.h"
|
2002-07-08 19:07:30 +00:00
|
|
|
#include "gstlog.h"
|
|
|
|
#include "gstmarshal.h"
|
2003-04-14 18:53:03 +00:00
|
|
|
#include "gstfilter.h"
|
2002-04-12 09:53:00 +00:00
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
/* Element signals and args */
|
2004-03-13 15:27:01 +00:00
|
|
|
enum
|
|
|
|
{
|
2002-05-08 20:40:48 +00:00
|
|
|
PLUGIN_ADDED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
static void gst_registry_class_init (GstRegistryClass * klass);
|
|
|
|
static void gst_registry_init (GstRegistry * registry);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
static GObjectClass *parent_class = NULL;
|
2004-03-13 15:27:01 +00:00
|
|
|
static guint gst_registry_signals[LAST_SIGNAL] = { 0 };
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
GType
|
|
|
|
gst_registry_get_type (void)
|
|
|
|
{
|
|
|
|
static GType registry_type = 0;
|
|
|
|
|
|
|
|
if (!registry_type) {
|
|
|
|
static const GTypeInfo registry_info = {
|
|
|
|
sizeof (GstRegistryClass),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_registry_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstRegistry),
|
2004-04-09 19:05:03 +00:00
|
|
|
0,
|
2002-05-08 20:40:48 +00:00
|
|
|
(GInstanceInitFunc) gst_registry_init,
|
|
|
|
NULL
|
|
|
|
};
|
2004-03-15 15:16:04 +00:00
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
registry_type = g_type_register_static (G_TYPE_OBJECT, "GstRegistry",
|
2004-03-15 19:27:17 +00:00
|
|
|
®istry_info, G_TYPE_FLAG_ABSTRACT);
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
|
|
|
return registry_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_class_init (GstRegistryClass * klass)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
parent_class = g_type_class_ref (G_TYPE_OBJECT);
|
|
|
|
|
|
|
|
gst_registry_signals[PLUGIN_ADDED] =
|
2004-03-13 15:27:01 +00:00
|
|
|
g_signal_new ("plugin-added", G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRegistryClass, plugin_added), NULL,
|
|
|
|
NULL, gst_marshal_VOID__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
gobject_class->dispose = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_init (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
registry->priority = 0;
|
|
|
|
registry->loaded = FALSE;
|
|
|
|
registry->paths = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_load:
|
|
|
|
* @registry: the registry to load
|
|
|
|
*
|
|
|
|
* Load the given registry
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
|
|
|
gboolean
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_load (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2002-12-19 21:31:03 +00:00
|
|
|
GstRegistryClass *rclass;
|
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
|
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
rclass = GST_REGISTRY_GET_CLASS (registry);
|
|
|
|
|
|
|
|
if (rclass->load)
|
|
|
|
return rclass->load (registry);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_is_loaded:
|
|
|
|
* @registry: the registry to check
|
|
|
|
*
|
|
|
|
* Check if the given registry is loaded
|
|
|
|
*
|
|
|
|
* Returns: TRUE if loaded.
|
|
|
|
*/
|
|
|
|
gboolean
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_is_loaded (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
|
|
|
|
|
|
|
|
return registry->loaded;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_save:
|
|
|
|
* @registry: the registry to save
|
|
|
|
*
|
|
|
|
* Save the contents of the given registry
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success
|
|
|
|
*/
|
|
|
|
gboolean
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_save (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2002-12-19 21:31:03 +00:00
|
|
|
GstRegistryClass *rclass;
|
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
|
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
rclass = GST_REGISTRY_GET_CLASS (registry);
|
|
|
|
|
|
|
|
if (rclass->save)
|
|
|
|
return rclass->save (registry);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_rebuild:
|
|
|
|
* @registry: the registry to rebuild
|
|
|
|
*
|
|
|
|
* Rebuild the given registry
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success
|
|
|
|
*/
|
|
|
|
gboolean
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_rebuild (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2002-12-19 21:31:03 +00:00
|
|
|
GstRegistryClass *rclass;
|
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
|
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
rclass = GST_REGISTRY_GET_CLASS (registry);
|
|
|
|
|
|
|
|
if (rclass->rebuild)
|
|
|
|
return rclass->rebuild (registry);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_unload:
|
|
|
|
* @registry: the registry to unload
|
|
|
|
*
|
|
|
|
* Unload the given registry
|
|
|
|
*
|
|
|
|
* Returns: TRUE on success
|
|
|
|
*/
|
|
|
|
gboolean
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_unload (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2002-12-19 21:31:03 +00:00
|
|
|
GstRegistryClass *rclass;
|
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
|
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
rclass = GST_REGISTRY_GET_CLASS (registry);
|
|
|
|
|
|
|
|
if (rclass->unload)
|
|
|
|
return rclass->unload (registry);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_add_path:
|
|
|
|
* @registry: the registry to add the path to
|
2004-03-15 15:16:04 +00:00
|
|
|
* @path: the path to add to the registry
|
2002-05-08 20:40:48 +00:00
|
|
|
*
|
2002-05-11 20:30:05 +00:00
|
|
|
* Add the given path to the registry. The syntax of the
|
|
|
|
* path is specific to the registry. If the path has already been
|
|
|
|
* added, do nothing.
|
2002-05-08 20:40:48 +00:00
|
|
|
*/
|
|
|
|
void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_add_path (GstRegistry * registry, const gchar * path)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_REGISTRY (registry));
|
|
|
|
g_return_if_fail (path != NULL);
|
|
|
|
|
2003-04-14 18:53:03 +00:00
|
|
|
if (g_list_find_custom (registry->paths, path, (GCompareFunc) strcmp)) {
|
2004-03-13 15:27:01 +00:00
|
|
|
g_warning ("path %s already added to registry", path);
|
2003-04-14 18:53:03 +00:00
|
|
|
return;
|
2002-05-11 20:30:05 +00:00
|
|
|
}
|
2003-04-14 18:53:03 +00:00
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
registry->paths = g_list_append (registry->paths, g_strdup (path));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_get_path_list:
|
|
|
|
* @registry: the registry to get the pathlist of
|
|
|
|
*
|
|
|
|
* Get the list of paths for the given registry.
|
|
|
|
*
|
|
|
|
* Returns: A Glist of paths as strings. g_list_free after use.
|
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GList *
|
|
|
|
gst_registry_get_path_list (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
|
|
|
|
|
|
|
return g_list_copy (registry->paths);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_clear_paths:
|
|
|
|
* @registry: the registry to clear the paths of
|
|
|
|
*
|
|
|
|
* Clear the paths of the given registry
|
|
|
|
*/
|
|
|
|
void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_clear_paths (GstRegistry * registry)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_REGISTRY (registry));
|
|
|
|
|
2003-04-14 18:53:03 +00:00
|
|
|
g_list_foreach (registry->paths, (GFunc) g_free, NULL);
|
2002-05-08 20:40:48 +00:00
|
|
|
g_list_free (registry->paths);
|
|
|
|
|
|
|
|
registry->paths = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_add_plugin:
|
|
|
|
* @registry: the registry to add the plugin to
|
|
|
|
* @plugin: the plugin to add
|
|
|
|
*
|
2004-03-15 15:16:04 +00:00
|
|
|
* Add the plugin to the registry. The plugin-added signal will be emitted.
|
2002-05-08 20:40:48 +00:00
|
|
|
*
|
|
|
|
* Returns: TRUE on success.
|
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
gboolean
|
|
|
|
gst_registry_add_plugin (GstRegistry * registry, GstPlugin * plugin)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), FALSE);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
plugin->manager = registry;
|
|
|
|
registry->plugins = g_list_prepend (registry->plugins, plugin);
|
|
|
|
|
2004-03-15 15:16:04 +00:00
|
|
|
GST_DEBUG ("emitting plugin-added for filename %s", plugin->filename);
|
2004-03-13 15:27:01 +00:00
|
|
|
g_signal_emit (G_OBJECT (registry), gst_registry_signals[PLUGIN_ADDED], 0,
|
|
|
|
plugin);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_remove_plugin:
|
|
|
|
* @registry: the registry to remove the plugin from
|
|
|
|
* @plugin: the plugin to remove
|
|
|
|
*
|
|
|
|
* Remove the plugin from the registry.
|
|
|
|
*/
|
|
|
|
void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_remove_plugin (GstRegistry * registry, GstPlugin * plugin)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_REGISTRY (registry));
|
|
|
|
|
|
|
|
registry->plugins = g_list_remove (registry->plugins, plugin);
|
|
|
|
}
|
|
|
|
|
2003-05-06 22:10:29 +00:00
|
|
|
/**
|
|
|
|
* gst_registry_plugin_filter:
|
|
|
|
* @registry: registry to query
|
|
|
|
* @filter: the filter to use
|
|
|
|
* @first: only return first match
|
|
|
|
* @user_data: user data passed to the filter function
|
|
|
|
*
|
|
|
|
* Runs a filter against all plugins in the registry and returns a GList with
|
2004-03-15 15:16:04 +00:00
|
|
|
* the results. If the first flag is set, only the first match is
|
2003-05-06 22:10:29 +00:00
|
|
|
* returned (as a list with a single object).
|
|
|
|
*
|
|
|
|
* Returns: a GList of plugins, g_list_free after use.
|
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GList *
|
|
|
|
gst_registry_plugin_filter (GstRegistry * registry,
|
|
|
|
GstPluginFilter filter, gboolean first, gpointer user_data)
|
2003-04-14 18:53:03 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
return gst_filter_run (registry->plugins, (GstFilterFunc) filter, first,
|
|
|
|
user_data);
|
2003-04-14 18:53:03 +00:00
|
|
|
}
|
|
|
|
|
2003-05-06 22:10:29 +00:00
|
|
|
/**
|
|
|
|
* gst_registry_feature_filter:
|
|
|
|
* @registry: registry to query
|
|
|
|
* @filter: the filter to use
|
|
|
|
* @first: only return first match
|
|
|
|
* @user_data: user data passed to the filter function
|
|
|
|
*
|
2004-03-15 15:16:04 +00:00
|
|
|
* Runs a filter against all features of the plugins in the registry
|
|
|
|
* and returns a GList with the results.
|
|
|
|
* If the first flag is set, only the first match is
|
2003-05-06 22:10:29 +00:00
|
|
|
* returned (as a list with a single object).
|
|
|
|
*
|
|
|
|
* Returns: a GList of plugin features, g_list_free after use.
|
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GList *
|
|
|
|
gst_registry_feature_filter (GstRegistry * registry,
|
|
|
|
GstPluginFeatureFilter filter, gboolean first, gpointer user_data)
|
2003-04-14 18:53:03 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
return gst_plugin_list_feature_filter (registry->plugins, filter, first,
|
|
|
|
user_data);
|
2003-04-14 18:53:03 +00:00
|
|
|
}
|
|
|
|
|
2002-05-10 19:23:18 +00:00
|
|
|
/**
|
|
|
|
* gst_registry_find_plugin:
|
|
|
|
* @registry: the registry to search
|
|
|
|
* @name: the plugin name to find
|
|
|
|
*
|
|
|
|
* Find the plugin with the given name in the registry.
|
|
|
|
*
|
|
|
|
* Returns: The plugin with the given name or NULL if the plugin was not found.
|
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GstPlugin *
|
|
|
|
gst_registry_find_plugin (GstRegistry * registry, const gchar * name)
|
2002-05-10 19:23:18 +00:00
|
|
|
{
|
2003-04-14 18:53:03 +00:00
|
|
|
GList *walk;
|
|
|
|
GstPlugin *result = NULL;
|
2003-02-10 20:32:32 +00:00
|
|
|
|
2002-05-10 19:23:18 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
2003-02-10 20:32:32 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
walk = gst_registry_plugin_filter (registry,
|
|
|
|
(GstPluginFilter) gst_plugin_name_filter, TRUE, (gpointer) name);
|
|
|
|
if (walk)
|
2003-04-14 18:53:03 +00:00
|
|
|
result = GST_PLUGIN (walk->data);
|
2003-02-10 20:32:32 +00:00
|
|
|
|
2003-04-14 18:53:03 +00:00
|
|
|
g_list_free (walk);
|
|
|
|
|
|
|
|
return result;
|
2002-05-10 19:23:18 +00:00
|
|
|
}
|
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
/**
|
|
|
|
* gst_registry_find_feature:
|
|
|
|
* @registry: the registry to search
|
|
|
|
* @name: the pluginfeature name to find
|
|
|
|
* @type: the pluginfeature type to find
|
|
|
|
*
|
|
|
|
* Find the pluginfeature with the given name and type in the registry.
|
|
|
|
*
|
2004-03-15 15:16:04 +00:00
|
|
|
* Returns: The pluginfeature with the given name and type or NULL
|
2002-05-08 20:40:48 +00:00
|
|
|
* if the plugin was not found.
|
|
|
|
*/
|
2004-03-13 15:27:01 +00:00
|
|
|
GstPluginFeature *
|
|
|
|
gst_registry_find_feature (GstRegistry * registry, const gchar * name,
|
|
|
|
GType type)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2003-02-10 20:32:32 +00:00
|
|
|
GstPluginFeature *feature = NULL;
|
2003-04-14 18:53:03 +00:00
|
|
|
GList *walk;
|
|
|
|
GstTypeNameData data;
|
2003-02-10 20:32:32 +00:00
|
|
|
|
2002-05-08 20:40:48 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry), NULL);
|
|
|
|
g_return_val_if_fail (name != NULL, NULL);
|
2003-02-10 20:32:32 +00:00
|
|
|
|
2003-04-14 18:53:03 +00:00
|
|
|
data.name = name;
|
|
|
|
data.type = type;
|
2003-02-10 20:32:32 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
walk = gst_registry_feature_filter (registry,
|
|
|
|
(GstPluginFeatureFilter) gst_plugin_feature_type_name_filter,
|
|
|
|
TRUE, &data);
|
2003-04-14 18:53:03 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
if (walk)
|
2003-04-14 18:53:03 +00:00
|
|
|
feature = GST_PLUGIN_FEATURE (walk->data);
|
|
|
|
|
|
|
|
g_list_free (walk);
|
2003-02-10 20:32:32 +00:00
|
|
|
|
|
|
|
return feature;
|
2002-05-08 20:40:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_load_plugin:
|
|
|
|
* @registry: the registry to load the plugin from
|
|
|
|
* @plugin: the plugin to load
|
|
|
|
*
|
|
|
|
* Bring the plugin from the registry into memory.
|
|
|
|
*
|
2004-03-15 15:16:04 +00:00
|
|
|
* Returns: a value indicating the result
|
2002-05-08 20:40:48 +00:00
|
|
|
*/
|
|
|
|
GstRegistryReturn
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_load_plugin (GstRegistry * registry, GstPlugin * plugin)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2002-12-19 21:31:03 +00:00
|
|
|
GstRegistryClass *rclass;
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry),
|
|
|
|
GST_REGISTRY_PLUGIN_LOAD_ERROR);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
rclass = GST_REGISTRY_GET_CLASS (registry);
|
|
|
|
|
|
|
|
if (rclass->load_plugin)
|
|
|
|
return rclass->load_plugin (registry, plugin);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return GST_REGISTRY_PLUGIN_LOAD_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_unload_plugin:
|
|
|
|
* @registry: the registry to unload the plugin from
|
|
|
|
* @plugin: the plugin to unload
|
|
|
|
*
|
|
|
|
* Unload the plugin from the given registry.
|
|
|
|
*
|
2004-03-15 15:16:04 +00:00
|
|
|
* Returns: a value indicating the result
|
2002-05-08 20:40:48 +00:00
|
|
|
*/
|
|
|
|
GstRegistryReturn
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_unload_plugin (GstRegistry * registry, GstPlugin * plugin)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2002-12-19 21:31:03 +00:00
|
|
|
GstRegistryClass *rclass;
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry),
|
|
|
|
GST_REGISTRY_PLUGIN_LOAD_ERROR);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
rclass = GST_REGISTRY_GET_CLASS (registry);
|
|
|
|
|
|
|
|
if (rclass->unload_plugin)
|
|
|
|
return rclass->unload_plugin (registry, plugin);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return GST_REGISTRY_PLUGIN_LOAD_ERROR;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_registry_update_plugin:
|
|
|
|
* @registry: the registry to update
|
|
|
|
* @plugin: the plugin to update
|
|
|
|
*
|
|
|
|
* Update the plugin in the given registry.
|
|
|
|
*
|
2004-03-15 15:16:04 +00:00
|
|
|
* Returns: a value indicating the result
|
2002-05-08 20:40:48 +00:00
|
|
|
*/
|
|
|
|
GstRegistryReturn
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_registry_update_plugin (GstRegistry * registry, GstPlugin * plugin)
|
2002-05-08 20:40:48 +00:00
|
|
|
{
|
2002-12-19 21:31:03 +00:00
|
|
|
GstRegistryClass *rclass;
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
g_return_val_if_fail (GST_IS_REGISTRY (registry),
|
|
|
|
GST_REGISTRY_PLUGIN_LOAD_ERROR);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
2002-12-19 21:31:03 +00:00
|
|
|
rclass = GST_REGISTRY_GET_CLASS (registry);
|
|
|
|
|
|
|
|
if (rclass->update_plugin)
|
|
|
|
return rclass->update_plugin (registry, plugin);
|
2002-05-08 20:40:48 +00:00
|
|
|
|
|
|
|
return GST_REGISTRY_PLUGIN_LOAD_ERROR;
|
|
|
|
}
|