GST_PLUGIN_PATH gets split into the user registry some debugging output in registry rebuilding don't go into =build, ...

Original commit message from CVS:
* GST_PLUGIN_PATH gets split into the user registry
* some debugging output in registry rebuilding
* don't go into =build, =inst, etc
* i really don't know what the current idiom is for the plugin test suites, disabling for now

still pending issues: what to do when other plugin paths are passed on the command
line for existing registries. if the existing registries were built against those
paths, the time checks work, but if not they will need to be rebuilt. i have a feeling
they should be rebuilt in any case, but it's a tricky issue.
This commit is contained in:
Andy Wingo 2002-05-10 03:27:42 +00:00
parent 246b03c75d
commit fbbdca6996
4 changed files with 30 additions and 11 deletions

View file

@ -356,7 +356,7 @@ init_post (void)
plugin_path = g_getenv("GST_PLUGIN_PATH");
split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, _global_registry);
split_and_iterate (plugin_path, G_SEARCHPATH_SEPARATOR_S, add_path_func, _user_registry);
/* register core plugins */
_gst_plugin_register_static (&plugin_desc);
@ -465,7 +465,7 @@ init_popt_callback (poptContext context, enum poptCallbackReason reason,
gst_scheduler_factory_set_default_name (arg);
break;
case ARG_REGISTRY:
gst_registry_option_set (arg);
GST_XML_REGISTRY (_global_registry)->location = g_strdup (arg);
break;
default:
g_warning ("option %d not recognized", option->val);

View file

@ -244,21 +244,35 @@ plugin_times_older_than(GList *paths, time_t regtime)
return TRUE;
}
static void
plugin_added_func (GstRegistry *registry, GstPlugin *plugin, gpointer user_data)
{
GST_INFO (GST_CAT_PLUGIN_LOADING, "added plugin %s with %d features\n", plugin->name, plugin->numfeatures);
}
static gboolean
gst_xml_registry_open_func (GstXMLRegistry *registry, GstXMLRegistryMode mode)
{
gulong handler_id;
GList *paths = GST_REGISTRY (registry)->paths;
if (mode == GST_XML_REGISTRY_READ) {
if (!plugin_times_older_than (paths, get_time (registry->location))) {
GST_INFO (GST_CAT_GST_INIT, "Registry out of date, rebuilding...");
gst_registry_rebuild (GST_REGISTRY (registry));
gst_registry_save (GST_REGISTRY (registry));
handler_id = g_signal_connect (G_OBJECT (registry), "plugin_added",
G_CALLBACK (plugin_added_func), NULL);
if (!plugin_times_older_than (paths, get_time (registry->location))) {
GST_INFO (GST_CAT_GST_INIT, "Registry still out of date, something is wrong...");
return FALSE;
gst_registry_rebuild (GST_REGISTRY (registry));
g_signal_handler_disconnect (registry, handler_id);
if (GST_REGISTRY (registry)->flags & GST_REGISTRY_WRITABLE) {
gst_registry_save (GST_REGISTRY (registry));
if (!plugin_times_older_than (paths, get_time (registry->location))) {
GST_INFO (GST_CAT_GST_INIT, "Registry still out of date, something is wrong...");
return FALSE;
}
}
}
@ -1120,6 +1134,11 @@ gst_xml_registry_rebuild_recurse (GstXMLRegistry *registry, const gchar *directo
while ((dirent = g_dir_read_name (dir))) {
gchar *dirname;
if (*dirent == '=') {
/* =build, =inst, etc. -- automake distcheck directories */
continue;
}
dirname = g_strjoin ("/", directory, dirent, NULL);
gst_xml_registry_rebuild_recurse (registry, dirname);
g_free(dirname);
@ -1158,6 +1177,8 @@ gst_xml_registry_rebuild (GstRegistry *registry)
while (walk) {
gchar *path = (gchar *) walk->data;
GST_INFO (GST_CAT_PLUGIN_LOADING, "Rebuilding registry %p in directory %s...", registry, path);
gst_xml_registry_rebuild_recurse (xmlregistry, path);
walk = g_list_next (walk);

View file

@ -2,8 +2,7 @@ GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml
# FIXME : tests need fixing
testprogs = static # dynamic linked loading registry static2
# filterdir = $(libdir)/gst
testprogs = # static # dynamic linked loading registry static2
AM_CFLAGS = $(GST_CFLAGS)
LIBS = $(GST_LIBS)

View file

@ -2,8 +2,7 @@ GST_PLUGIN_PATH=$(shell cd $(top_builddir) && pwd)
TESTS_ENVIRONMENT = GST_PLUGIN_PATH=$(GST_PLUGIN_PATH) GST_REGISTRY=$(GST_PLUGIN_PATH)/testsuite/test-registry.xml
# FIXME : tests need fixing
testprogs = static # dynamic linked loading registry static2
# filterdir = $(libdir)/gst
testprogs = # static # dynamic linked loading registry static2
AM_CFLAGS = $(GST_CFLAGS)
LIBS = $(GST_LIBS)