+2007-05-11 Stefan Kost <ensonic@users.sf.net>
+
+ * gst/gstplugin.c (gst_plugin_load_file):
+ * gst/gstregistry.c (GST_CAT_DEFAULT,
+ gst_registry_lookup_feature_locked, gst_registry_scan_path_level):
+ Print a g_warning if there was an error when loading a plugins during
+ registry scan. The shuld help beginners starting with gst-plugin
+ template.
+
2007-05-10 Wim Taymans <wim@fluendo.com>
* plugins/elements/gstqueue.c: (gst_queue_class_init),
*
* One registry holds the metadata of a set of plugins.
* All registries build the #GstRegistryPool.
- *
+ *
* <emphasis role="bold">Design:</emphasis>
*
* The #GstRegistry object is a list of plugins and some functions for dealing
#define GST_CAT_DEFAULT GST_CAT_REGISTRY
-/* the one instance of the default registry and the mutex protecting the
+/* the one instance of the default registry and the mutex protecting the
* variable. */
static GStaticMutex _gst_registry_mutex = G_STATIC_MUTEX_INIT;
static GstRegistry *_gst_registry_default = NULL;
* @name: a #GstPluginFeature name
*
* Find a #GstPluginFeature with @name in @registry.
- *
+ *
* Returns: a #GstPluginFeature with its refcount incremented, use
* gst_object_unref() after usage.
*
GstPlugin *plugin;
GstPlugin *newplugin;
gboolean changed = FALSE;
+ GError *err = NULL;
dir = g_dir_open (path, 0, NULL);
if (!dir)
GST_LOG_OBJECT (registry, "marking plugin %p as registered as %s",
plugin, filename);
plugin->registered = TRUE;
- /* Update the file path on which we've seen this cached plugin
+ /* Update the file path on which we've seen this cached plugin
* to ensure the registry cache will reflect up to date information */
if (strcmp (plugin->filename, filename) != 0) {
g_free (plugin->filename);
G_GINT64_FORMAT, plugin->file_mtime, file_status.st_mtime,
(gint64) plugin->file_size, (gint64) file_status.st_size);
gst_registry_remove_plugin (gst_registry_get_default (), plugin);
- newplugin = gst_plugin_load_file (filename, NULL);
+ newplugin = gst_plugin_load_file (filename, &err);
if (newplugin) {
GST_DEBUG_OBJECT (registry, "marking new plugin %p as registered",
newplugin);
newplugin->registered = TRUE;
gst_object_unref (newplugin);
+ } else {
+ if (err) {
+ /* Report error to user, and free error */
+ g_warning ("Failed to load plugin: %s", err->message);
+ g_error_free (err);
+ err = NULL;
+ }
}
changed = TRUE;
}
} else {
GST_DEBUG_OBJECT (registry, "file %s not yet in registry", filename);
- newplugin = gst_plugin_load_file (filename, NULL);
+ newplugin = gst_plugin_load_file (filename, &err);
if (newplugin) {
newplugin->registered = TRUE;
gst_object_unref (newplugin);
changed = TRUE;
+ } else {
+ if (err) {
+ /* Report error to user, and free error */
+ g_warning ("Failed to load plugin: %s", err->message);
+ g_error_free (err);
+ err = NULL;
+ }
}
}