[brasero] Split plugin registration functions in 2



commit fe53297a1ffd1609a01eeb9e1a424e55562b57bf
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Tue Oct 27 15:16:17 2009 +0100

    Split plugin registration functions in 2
    The first one is called once at initialization still registers all the capabilities of a plugin
    The second one checks whether a plugin can operate (no missing app, library, proper version, ...) and can be called multiple times
    
    Also unload libdvdcss library after testing if it exists when loading dvdcss plugin

 libbrasero-burn/brasero-plugin-registration.h |   74 +++++---
 libbrasero-burn/brasero-plugin.h              |   18 ++
 libbrasero-burn/burn-plugin.c                 |  249 ++++++++++++++++++++++---
 libbrasero-burn/burn-process.c                |   44 -----
 libbrasero-burn/burn-process.h                |    7 -
 plugins/cdrdao/burn-cdrdao.c                  |   17 +-
 plugins/cdrdao/burn-toc2cue.c                 |   16 +-
 plugins/cdrkit/burn-genisoimage.c             |   16 +-
 plugins/cdrkit/burn-readom.c                  |   16 +-
 plugins/cdrkit/burn-wodim.c                   |   17 +-
 plugins/cdrtools/burn-cdda2wav.c              |   17 +-
 plugins/cdrtools/burn-cdrecord.c              |   16 +-
 plugins/cdrtools/burn-mkisofs.c               |   16 +-
 plugins/cdrtools/burn-readcd.c                |   16 +-
 plugins/checksum/burn-checksum-files.c        |    6 +-
 plugins/checksum/burn-checksum-image.c        |    6 +-
 plugins/dvdauthor/burn-dvdauthor.c            |   16 +-
 plugins/dvdcss/burn-dvdcss.c                  |   67 +++----
 plugins/growisofs/burn-dvd-rw-format.c        |   16 +-
 plugins/growisofs/burn-growisofs.c            |   17 +-
 plugins/local-track/burn-local-image.c        |    6 +-
 plugins/local-track/burn-uri.c                |    6 +-
 plugins/transcode/burn-normalize.c            |   29 +--
 plugins/transcode/burn-transcode.c            |    6 +-
 plugins/transcode/burn-vob.c                  |   49 ++----
 plugins/vcdimager/burn-vcdimager.c            |   16 +-
 26 files changed, 434 insertions(+), 345 deletions(-)
---
diff --git a/libbrasero-burn/brasero-plugin-registration.h b/libbrasero-burn/brasero-plugin-registration.h
index 8dd3cb9..db3d706 100644
--- a/libbrasero-burn/brasero-plugin-registration.h
+++ b/libbrasero-burn/brasero-plugin-registration.h
@@ -168,11 +168,27 @@ brasero_plugin_conf_option_choice_add (BraseroPluginConfOption *option,
 				       const gchar *string,
 				       gint value);
 
+void
+brasero_plugin_add_error (BraseroPlugin *plugin,
+                          BraseroPluginErrorType type,
+                          const gchar *detail);
+
+void
+brasero_plugin_test_gstreamer_plugin (BraseroPlugin *plugin,
+                                      const gchar *name);
+
+void
+brasero_plugin_test_app (BraseroPlugin *plugin,
+                         const gchar *name);
+
 /**
  * Boiler plate for plugin definition to save the hassle of definition.
  * To be put at the beginning of the .c file.
  */
-typedef GType	(* BraseroPluginRegisterType)	(BraseroPlugin *plugin, gchar **error);
+typedef GType	(* BraseroPluginRegisterType)	(BraseroPlugin *plugin);
+
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin);
 
 #define BRASERO_PLUGIN_BOILERPLATE(PluginName, plugin_name, PARENT_NAME, ParentName) \
 typedef struct {								\
@@ -193,37 +209,35 @@ plugin_name##_get_type (void)							\
 										\
 static void plugin_name##_class_init (PluginName##Class *klass);		\
 static void plugin_name##_init (PluginName *sp);				\
-static void plugin_name##_finalize (GObject *object);				\
-static BraseroBurnResult plugin_name##_export_caps (BraseroPlugin *plugin, gchar **error);	\
+static void plugin_name##_finalize (GObject *object);			\
+static void plugin_name##_export_caps (BraseroPlugin *plugin);	\
 G_MODULE_EXPORT GType								\
-brasero_plugin_register (BraseroPlugin *plugin, gchar **error);		\
+brasero_plugin_register (BraseroPlugin *plugin);				\
 G_MODULE_EXPORT GType								\
-brasero_plugin_register (BraseroPlugin *plugin, gchar **error)			\
-{										\
-	if (brasero_plugin_get_gtype (plugin) == G_TYPE_NONE) {			\
-		BraseroBurnResult result;					\
-		result = plugin_name##_export_caps (plugin, error);		\
-		if (result != BRASERO_BURN_OK)					\
-			return G_TYPE_NONE;					\
-	}									\
-	static const GTypeInfo our_info = {					\
-		sizeof (PluginName##Class),					\
-		NULL,								\
-		NULL,								\
-		(GClassInitFunc)plugin_name##_class_init,			\
-		NULL,								\
-		NULL,								\
-		sizeof (PluginName),						\
-		0,								\
-		(GInstanceInitFunc)plugin_name##_init,				\
-	};									\
-	plugin_name##_type = g_type_module_register_type (G_TYPE_MODULE (plugin),		\
-							  PARENT_NAME,		\
-							  G_STRINGIFY (PluginName),		\
-							  &our_info,		\
-							  0);			\
-	return plugin_name##_type;						\
-}
+brasero_plugin_register (BraseroPlugin *plugin)				\
+{														\
+	if (brasero_plugin_get_gtype (plugin) == G_TYPE_NONE) {	\
+		plugin_name##_export_caps (plugin);			\
+		static const GTypeInfo our_info = {					\
+			sizeof (PluginName##Class),					\
+			NULL,										\
+			NULL,										\
+			(GClassInitFunc)plugin_name##_class_init,			\
+			NULL,										\
+			NULL,										\
+			sizeof (PluginName),							\
+			0,											\
+			(GInstanceInitFunc)plugin_name##_init,			\
+		};												\
+		plugin_name##_type = g_type_module_register_type (G_TYPE_MODULE (plugin),		\
+								  PARENT_NAME,			\
+								  G_STRINGIFY (PluginName),		\
+								  &our_info,				\
+								  0);						\
+		return plugin_name##_type;						\
+	}													\
+	return brasero_plugin_get_gtype (plugin);				\
+}														\
 
 #define BRASERO_PLUGIN_ADD_STANDARD_CDR_FLAGS(plugin_MACRO, unsupported_MACRO)	\
 	/* Use DAO for first session since AUDIO need it to write CD-TEXT */	\
diff --git a/libbrasero-burn/brasero-plugin.h b/libbrasero-burn/brasero-plugin.h
index a945a8b..5b0cb12 100644
--- a/libbrasero-burn/brasero-plugin.h
+++ b/libbrasero-burn/brasero-plugin.h
@@ -90,6 +90,24 @@ typedef enum {
 	BRASERO_PLUGIN_RUN_AFTER_TARGET		= 1 << 2,
 } BraseroPluginProcessFlag;
 
+typedef enum {
+	BRASERO_PLUGIN_ERROR_NONE					= 0,
+	BRASERO_PLUGIN_ERROR_MODULE,
+	BRASERO_PLUGIN_ERROR_MISSING_APP,
+	BRASERO_PLUGIN_ERROR_WRONG_APP_VERSION,
+	BRASERO_PLUGIN_ERROR_SYMBOLIC_LINK_APP,
+	BRASERO_PLUGIN_ERROR_MISSING_LIBRARY,
+	BRASERO_PLUGIN_ERROR_LIBRARY_VERSION,
+	BRASERO_PLUGIN_ERROR_MISSING_GSTREAMER_PLUGIN,
+} BraseroPluginErrorType;
+
+typedef struct _BraseroPluginError BraseroPluginError;
+
+struct _BraseroPluginError {
+	BraseroPluginErrorType type;
+	gchar *detail;
+};
+
 G_END_DECLS
 
 #endif /* _BURN_PLUGIN_H_ */
diff --git a/libbrasero-burn/burn-plugin.c b/libbrasero-burn/burn-plugin.c
index ae35cb2..40f0768 100644
--- a/libbrasero-burn/burn-plugin.c
+++ b/libbrasero-burn/burn-plugin.c
@@ -37,6 +37,9 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <gmodule.h>
+#include <glib/gi18n-lib.h>
+
+#include <gst/gst.h>
 
 #include <gconf/gconf-client.h>
 
@@ -93,7 +96,7 @@ struct _BraseroPluginPrivate
 
 	GSList *options;
 
-	gchar *error;
+	GSList *errors;
 
 	GType type;
 	gchar *path;
@@ -139,6 +142,104 @@ enum
 static GTypeModuleClass* parent_class = NULL;
 static guint plugin_signals [LAST_SIGNAL] = { 0 };
 
+static void
+brasero_plugin_error_free (BraseroPluginError *error)
+{
+	g_free (error->detail);
+	g_free (error);
+}
+
+void
+brasero_plugin_add_error (BraseroPlugin *plugin,
+                          BraseroPluginErrorType type,
+                          const gchar *detail)
+{
+	BraseroPluginError *error;
+	BraseroPluginPrivate *priv;
+
+	g_return_if_fail (BRASERO_IS_PLUGIN (plugin));
+
+	priv = BRASERO_PLUGIN_PRIVATE (plugin);
+
+	error = g_new0 (BraseroPluginError, 1);
+	error->detail = g_strdup (detail);
+	error->type = type;
+
+	priv->errors = g_slist_prepend (priv->errors, error);
+}
+
+void
+brasero_plugin_test_gstreamer_plugin (BraseroPlugin *plugin,
+                                      const gchar *name)
+{
+	GstElement *element;
+
+	/* Let's see if we've got the plugins we need */
+	element = gst_element_factory_make (name, NULL);
+	if (!element)
+		brasero_plugin_add_error (plugin,
+		                          BRASERO_PLUGIN_ERROR_MISSING_GSTREAMER_PLUGIN,
+		                          name);
+	else
+		gst_object_unref (element);
+}
+
+void
+brasero_plugin_test_library (BraseroPlugin *plugin,
+                             const gchar *name)
+{
+
+}
+
+void
+brasero_plugin_test_app (BraseroPlugin *plugin,
+                         const gchar *name)
+{
+	gchar *prog_path;
+
+	/* First see if this plugin can be used, i.e. if cdrecord is in
+	 * the path */
+	prog_path = g_find_program_in_path (name);
+	if (!prog_path) {
+		brasero_plugin_add_error (plugin,
+		                          BRASERO_PLUGIN_ERROR_MISSING_APP,
+		                          name);
+		return;
+	}
+
+	if (!g_file_test (prog_path, G_FILE_TEST_IS_EXECUTABLE)) {
+		g_free (prog_path);
+		brasero_plugin_add_error (plugin,
+		                          BRASERO_PLUGIN_ERROR_MISSING_APP,
+		                          name);
+		return;
+	}
+
+	/* make sure that's not a symlink pointing to something with another
+	 * name like wodim.
+	 * NOTE: we used to test the target and see if it had the same name as
+	 * the symlink with GIO. The problem is, when the symlink pointed to
+	 * another symlink, then GIO didn't follow that other symlink. And in
+	 * the end it didn't work. So forbid all symlink. */
+	if (g_file_test (prog_path, G_FILE_TEST_IS_SYMLINK)) {
+		brasero_plugin_add_error (plugin,
+		                          BRASERO_PLUGIN_ERROR_SYMBOLIC_LINK_APP,
+		                          name);
+		g_free (prog_path);
+		return;
+	}
+	/* Make sure it's a regular file */
+	else if (!g_file_test (prog_path, G_FILE_TEST_IS_REGULAR)) {
+		brasero_plugin_add_error (plugin,
+		                          BRASERO_PLUGIN_ERROR_MISSING_APP,
+		                          name);
+		g_free (prog_path);
+		return;
+	}
+
+	g_free (prog_path);
+}
+
 void
 brasero_plugin_set_compulsory (BraseroPlugin *self,
 			       gboolean compulsory)
@@ -217,10 +318,6 @@ brasero_plugin_cleanup_definition (BraseroPlugin *self)
 	priv->copyright = NULL;
 	g_free (priv->website);
 	priv->website = NULL;
-	if (priv->error) {
-		g_free (priv->error);
-		priv->error = NULL;
-	}
 }
 
 /**
@@ -481,12 +578,60 @@ brasero_plugin_get_group (BraseroPlugin *self)
 }
 
 const gchar *
-brasero_plugin_get_error (BraseroPlugin *self)
+brasero_plugin_get_error (BraseroPlugin *plugin)
 {
+	gchar *error_string = NULL;
 	BraseroPluginPrivate *priv;
+	GString *string;
+	GSList *iter;
 
-	priv = BRASERO_PLUGIN_PRIVATE (self);
-	return priv->error;
+	g_return_val_if_fail (BRASERO_IS_PLUGIN (plugin), NULL);
+
+	priv = BRASERO_PLUGIN_PRIVATE (plugin);
+
+	string = g_string_new (NULL);
+	for (iter = priv->errors; iter; iter = iter->next) {
+		BraseroPluginError *error;
+
+		error = iter->data;
+		switch (error->type) {
+			case BRASERO_PLUGIN_ERROR_MISSING_APP:
+				g_string_append_c (string, '\n');
+				g_string_append_printf (string, _("\"%s\" could not be found in the path"), error->detail);
+				break;
+			case BRASERO_PLUGIN_ERROR_MISSING_GSTREAMER_PLUGIN:
+				g_string_append_c (string, '\n');
+				g_string_append_printf (string, _("\"%s\" Gstreamer plugin could not be found"), error->detail);
+				break;
+			case BRASERO_PLUGIN_ERROR_WRONG_APP_VERSION:
+				g_string_append_c (string, '\n');
+				g_string_append_printf (string, _("The version of \"%s\" is too old"), error->detail);
+				break;
+			case BRASERO_PLUGIN_ERROR_SYMBOLIC_LINK_APP:
+				g_string_append_c (string, '\n');
+				g_string_append_printf (string, _("\"%s\" is a symbolic link pointing to another program"), error->detail);
+				break;
+			case BRASERO_PLUGIN_ERROR_MISSING_LIBRARY:
+				g_string_append_c (string, '\n');
+				g_string_append_printf (string, _("\"%s\" could not be found"), error->detail);
+				break;
+			case BRASERO_PLUGIN_ERROR_LIBRARY_VERSION:
+				g_string_append_c (string, '\n');
+				g_string_append_printf (string, _("The version of \"%s\" is too old"), error->detail);
+				break;
+			case BRASERO_PLUGIN_ERROR_MODULE:
+				g_string_append_c (string, '\n');
+				g_string_append (string, error->detail);
+				break;
+
+			default:
+				break;
+		}
+	}
+
+	error_string = string->str;
+	g_string_free (string, FALSE);
+	return error_string;
 }
 
 static BraseroPluginFlags *
@@ -907,6 +1052,9 @@ brasero_plugin_get_gtype (BraseroPlugin *self)
 	BraseroPluginPrivate *priv;
 
 	priv = BRASERO_PLUGIN_PRIVATE (self);
+	if (priv->errors)
+		return G_TYPE_NONE;
+
 	return priv->type;
 }
 
@@ -930,7 +1078,6 @@ brasero_plugin_unload (GTypeModule *module)
 static gboolean
 brasero_plugin_load_real (BraseroPlugin *plugin) 
 {
-	gchar *error = NULL;
 	BraseroPluginPrivate *priv;
 	BraseroPluginRegisterType register_func;
 
@@ -944,7 +1091,8 @@ brasero_plugin_load_real (BraseroPlugin *plugin)
 
 	priv->handle = g_module_open (priv->path, G_MODULE_BIND_LAZY);
 	if (!priv->handle) {
-		priv->error = g_strdup (g_module_error ());
+		brasero_plugin_add_error (plugin, BRASERO_PLUGIN_ERROR_MODULE, g_module_error ());
+		BRASERO_BURN_LOG ("Module %s can't be loaded: g_module_open failed ()", priv->name);
 		return FALSE;
 	}
 
@@ -954,13 +1102,7 @@ brasero_plugin_load_real (BraseroPlugin *plugin)
 		return FALSE;
 	}
 
-	priv->type = register_func (plugin, &error);
-	if (error) {
-		if (priv->error)
-			g_free (priv->error);
-		priv->error = error;
-	}
-
+	priv->type = register_func (plugin);
 	brasero_burn_debug_setup_module (priv->handle);
 	return TRUE;
 }
@@ -1009,6 +1151,52 @@ brasero_plugin_priority_changed (GConfClient *client,
 			       brasero_plugin_get_active (self));
 }
 
+typedef void	(* BraseroPluginCheckConfig)	(BraseroPlugin *plugin);
+
+/**
+ * brasero_plugin_check_plugin_ready:
+ * @plugin: a #BraseroPlugin.
+ *
+ * Ask a plugin to check whether it can operate.
+ * brasero_plugin_can_operate () should be called
+ * afterwards to know whether it can operate or not.
+ *
+ **/
+void
+brasero_plugin_check_plugin_ready (BraseroPlugin *plugin)
+{
+	GModule *handle;
+	BraseroPluginPrivate *priv;
+	BraseroPluginCheckConfig function = NULL;
+
+	g_return_if_fail (BRASERO_IS_PLUGIN (plugin));
+	priv = BRASERO_PLUGIN_PRIVATE (plugin);
+
+	if (priv->errors) {
+		g_slist_foreach (priv->errors, (GFunc) brasero_plugin_error_free, NULL);
+		g_slist_free (priv->errors);
+		priv->errors = NULL;
+	}
+
+	handle = g_module_open (priv->path, 0);
+	if (!handle) {
+		brasero_plugin_add_error (plugin, BRASERO_PLUGIN_ERROR_MODULE, g_module_error ());
+		BRASERO_BURN_LOG ("Module %s can't be loaded: g_module_open failed ()", priv->name);
+		return;
+	}
+
+	if (!g_module_symbol (handle, "brasero_plugin_check_config", (gpointer) &function)) {
+		g_module_close (handle);
+		BRASERO_BURN_LOG ("Module %s has no check config function", priv->name);
+		return;
+	}
+
+	function (BRASERO_PLUGIN (plugin));
+
+	BRASERO_BURN_LOG ("Module %s successfully loaded", priv->name);
+	g_module_close (handle);
+}
+
 static void
 brasero_plugin_init_real (BraseroPlugin *object)
 {
@@ -1018,34 +1206,33 @@ brasero_plugin_init_real (BraseroPlugin *object)
 	GConfClient *client;
 	gchar *priority_path;
 	BraseroPluginPrivate *priv;
-	BraseroPluginRegisterType function;
+	BraseroPluginRegisterType function = NULL;
 
 	priv = BRASERO_PLUGIN_PRIVATE (object);
 
 	g_type_module_set_name (G_TYPE_MODULE (object), priv->name);
 
-	handle = g_module_open (priv->name, 0);
+	handle = g_module_open (priv->path, 0);
 	if (!handle) {
-		BRASERO_BURN_LOG ("Module can't be loaded: g_module_open failed");
+		brasero_plugin_add_error (object, BRASERO_PLUGIN_ERROR_MODULE, g_module_error ());
+		BRASERO_BURN_LOG ("Module %s (at %s) can't be loaded: g_module_open failed ()", priv->name, priv->path);
 		return;
 	}
 
 	if (!g_module_symbol (handle, "brasero_plugin_register", (gpointer) &function)) {
 		g_module_close (handle);
-		BRASERO_BURN_LOG ("Module can't be loaded: no register function");
+		BRASERO_BURN_LOG ("Module %s can't be loaded: no register function, priv->name", priv->name);
 		return;
 	}
 
-	priv->type = function (BRASERO_PLUGIN (object), &priv->error);
+	priv->type = function (object);
 	if (priv->type == G_TYPE_NONE) {
 		g_module_close (handle);
-		BRASERO_BURN_LOG ("Module encountered an error while registering its capabilities:\n%s",
-				  priv->error ? priv->error:"unknown error");
+		BRASERO_BURN_LOG ("Module %s encountered an error while registering its capabilities", priv->name);
 		return;
 	}
 
 	BRASERO_BURN_LOG ("Module %s successfully loaded", priv->name);
-	g_module_close (handle);
 
 	/* now see if we need to override the hardcoded priority of the plugin */
 	client = gconf_client_get_default ();
@@ -1078,6 +1265,11 @@ brasero_plugin_init_real (BraseroPlugin *object)
 	/* No need to emit notify:: here */
 	g_free (priority_path);
 	g_object_unref (client);
+
+	/* Check if it can operate */
+	brasero_plugin_check_plugin_ready (object);
+
+	g_module_close (handle);
 }
 
 static void
@@ -1122,9 +1314,10 @@ brasero_plugin_finalize (GObject *object)
 		g_object_unref (client);
 	}
 
-	if (priv->error) {
-		g_free (priv->error);
-		priv->error = NULL;
+	if (priv->errors) {
+		g_slist_foreach (priv->errors, (GFunc) brasero_plugin_error_free, NULL);
+		g_slist_free (priv->errors);
+		priv->errors = NULL;
 	}
 
 	G_OBJECT_CLASS (parent_class)->finalize (object);
diff --git a/libbrasero-burn/burn-process.c b/libbrasero-burn/burn-process.c
index 8ba237a..35c65d6 100644
--- a/libbrasero-burn/burn-process.c
+++ b/libbrasero-burn/burn-process.c
@@ -99,50 +99,6 @@ struct _BraseroProcessPrivate {
 
 static GObjectClass *parent_class = NULL;
 
-/* This is a helper function for plugins at load time */
-
-gboolean
-brasero_process_check_path (const gchar *name,
-			    gchar **error)
-{
-	gchar *prog_path;
-
-	/* First see if this plugin can be used, i.e. if cdrecord is in
-	 * the path */
-	prog_path = g_find_program_in_path (name);
-	if (!prog_path) {
-		*error = g_strdup_printf (_("\"%s\" could not be found in the path"), name);
-		return BRASERO_BURN_ERR;
-	}
-
-	if (!g_file_test (prog_path, G_FILE_TEST_IS_EXECUTABLE)) {
-		g_free (prog_path);
-		*error = g_strdup_printf (_("\"%s\" could not be found in the path"), name);
-		return BRASERO_BURN_ERR;
-	}
-
-	/* make sure that's not a symlink pointing to something with another
-	 * name like wodim.
-	 * NOTE: we used to test the target and see if it had the same name as
-	 * the symlink with GIO. The problem is, when the symlink pointed to
-	 * another symlink, then GIO didn't follow that other symlink. And in
-	 * the end it didn't work. So forbid all symlink. */
-	if (g_file_test (prog_path, G_FILE_TEST_IS_SYMLINK)) {
-		*error = g_strdup_printf (_("\"%s\" is a symbolic link pointing to another program. Use the target program instead"), name);
-		g_free (prog_path);
-		return BRASERO_BURN_ERR;
-	}
-	/* Make sure it's a regular file */
-	else if (!g_file_test (prog_path, G_FILE_TEST_IS_REGULAR)) {
-		*error = g_strdup_printf (_("\"%s\" could not be found in the path"), name);
-		g_free (prog_path);
-		return BRASERO_BURN_ERR;
-	}
-
-	g_free (prog_path);
-	return BRASERO_BURN_OK;
-}
-
 void
 brasero_process_deferred_error (BraseroProcess *self,
 				GError *error)
diff --git a/libbrasero-burn/burn-process.h b/libbrasero-burn/burn-process.h
index 04fdc09..655cba9 100644
--- a/libbrasero-burn/burn-process.h
+++ b/libbrasero-burn/burn-process.h
@@ -77,13 +77,6 @@ void
 brasero_process_deferred_error (BraseroProcess *process,
 				GError *error);
 
-/**
- * helper function for plugins
- */
-gboolean
-brasero_process_check_path (const gchar *name,
-			    gchar **error);
-
 void
 brasero_process_set_working_directory (BraseroProcess *process,
 				       const gchar *directory);
diff --git a/plugins/cdrdao/burn-cdrdao.c b/plugins/cdrdao/burn-cdrdao.c
index d722a1b..250c1e0 100644
--- a/plugins/cdrdao/burn-cdrdao.c
+++ b/plugins/cdrdao/burn-cdrdao.c
@@ -606,12 +606,11 @@ brasero_cdrdao_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_cdrdao_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_cdrdao_export_caps (BraseroPlugin *plugin)
 {
 	GSList *input;
 	GSList *output;
-	BraseroBurnResult result;
 	BraseroPluginConfOption *use_raw; 
 	const BraseroMedia media_w = BRASERO_MEDIUM_CD|
 				     BRASERO_MEDIUM_WRITABLE|
@@ -631,11 +630,6 @@ brasero_cdrdao_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       20);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("cdrdao", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	/* that's for cdrdao images: CDs only as input */
 	input = brasero_caps_disc_new (BRASERO_MEDIUM_CD|
 				       BRASERO_MEDIUM_ROM|
@@ -699,5 +693,10 @@ brasero_cdrdao_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_add_conf_option (plugin, use_raw);
 
 	brasero_plugin_register_group (plugin, _(CDRDAO_DESCRIPTION));
-	return BRASERO_BURN_OK;
+}
+
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "cdrdao");
 }
diff --git a/plugins/cdrdao/burn-toc2cue.c b/plugins/cdrdao/burn-toc2cue.c
index 67f55fe..d4632fd 100644
--- a/plugins/cdrdao/burn-toc2cue.c
+++ b/plugins/cdrdao/burn-toc2cue.c
@@ -320,10 +320,9 @@ brasero_toc2cue_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_toc2cue_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_toc2cue_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -333,11 +332,6 @@ brasero_toc2cue_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       0);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("toc2cue", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	input = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					BRASERO_IMAGE_FORMAT_CDRDAO);
 
@@ -349,6 +343,10 @@ brasero_toc2cue_export_caps (BraseroPlugin *plugin, gchar **error)
 	g_slist_free (input);
 
 	brasero_plugin_register_group (plugin, _(CDRDAO_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "toc2cue");
 }
diff --git a/plugins/cdrkit/burn-genisoimage.c b/plugins/cdrkit/burn-genisoimage.c
index 3ea6f66..f42ae3e 100644
--- a/plugins/cdrkit/burn-genisoimage.c
+++ b/plugins/cdrkit/burn-genisoimage.c
@@ -518,10 +518,9 @@ brasero_genisoimage_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_genisoimage_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_genisoimage_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -532,11 +531,6 @@ brasero_genisoimage_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       1);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("genisoimage", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	brasero_plugin_set_flags (plugin,
 				  BRASERO_MEDIUM_CDR|
 				  BRASERO_MEDIUM_CDRW|
@@ -586,6 +580,10 @@ brasero_genisoimage_export_caps (BraseroPlugin *plugin, gchar **error)
 	g_slist_free (output);
 
 	brasero_plugin_register_group (plugin, _(CDRKIT_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "genisoimage");
 }
diff --git a/plugins/cdrkit/burn-readom.c b/plugins/cdrkit/burn-readom.c
index abddf56..a1d6109 100644
--- a/plugins/cdrkit/burn-readom.c
+++ b/plugins/cdrkit/burn-readom.c
@@ -438,10 +438,9 @@ brasero_readom_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_readom_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_readom_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -451,11 +450,6 @@ brasero_readom_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       1);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("readom", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	/* that's for clone mode only The only one to copy audio */
 	output = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					 BRASERO_IMAGE_FORMAT_CLONE);
@@ -497,6 +491,10 @@ brasero_readom_export_caps (BraseroPlugin *plugin, gchar **error)
 	g_slist_free (input);
 
 	brasero_plugin_register_group (plugin, _(CDRKIT_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "readom");
 }
diff --git a/plugins/cdrkit/burn-wodim.c b/plugins/cdrkit/burn-wodim.c
index e644481..2368844 100644
--- a/plugins/cdrkit/burn-wodim.c
+++ b/plugins/cdrkit/burn-wodim.c
@@ -1211,8 +1211,8 @@ brasero_wodim_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_wodim_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_wodim_export_caps (BraseroPlugin *plugin)
 {
 	BraseroPluginConfOption *immed, *minbuf;
 	const BraseroMedia media = BRASERO_MEDIUM_CD|
@@ -1239,7 +1239,6 @@ brasero_wodim_export_caps (BraseroPlugin *plugin, gchar **error)
 				      BRASERO_MEDIUM_HAS_AUDIO|
 				      BRASERO_MEDIUM_HAS_DATA|
 				      BRASERO_MEDIUM_BLANK;
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -1250,11 +1249,6 @@ brasero_wodim_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       0);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("wodim", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	/* for recording */
 	input = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_PIPE|
 					BRASERO_PLUGIN_IO_ACCEPT_FILE,
@@ -1406,5 +1400,10 @@ brasero_wodim_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_add_conf_option (plugin, immed);
 
 	brasero_plugin_register_group (plugin, _(CDRKIT_DESCRIPTION));
-	return BRASERO_BURN_OK;
+}
+
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "wodim");
 }
diff --git a/plugins/cdrtools/burn-cdda2wav.c b/plugins/cdrtools/burn-cdda2wav.c
index 727090d..dfc5cd6 100644
--- a/plugins/cdrtools/burn-cdda2wav.c
+++ b/plugins/cdrtools/burn-cdda2wav.c
@@ -399,10 +399,9 @@ brasero_cdda2wav_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_cdda2wav_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_cdda2wav_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -412,12 +411,6 @@ brasero_cdda2wav_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       0);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("cdda2wav", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
-	/* Caps */
 	output = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE /*|BRASERO_PLUGIN_IO_ACCEPT_PIPE*/, /* Keep on the fly on hold until it gets proper testing */
 					 BRASERO_AUDIO_FORMAT_RAW|
 	                                 BRASERO_METADATA_INFO);
@@ -434,6 +427,10 @@ brasero_cdda2wav_export_caps (BraseroPlugin *plugin, gchar **error)
 	g_slist_free (input);
 
 	brasero_plugin_register_group (plugin, _(CDRTOOLS_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "cdda2wav");
 }
diff --git a/plugins/cdrtools/burn-cdrecord.c b/plugins/cdrtools/burn-cdrecord.c
index 38e8cc3..2c1f7f6 100644
--- a/plugins/cdrtools/burn-cdrecord.c
+++ b/plugins/cdrtools/burn-cdrecord.c
@@ -1145,8 +1145,8 @@ brasero_cdrecord_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_cdrecord_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_cdrecord_export_caps (BraseroPlugin *plugin)
 {
 	BraseroPluginConfOption *immed, *minbuf;
 	const BraseroMedia media = BRASERO_MEDIUM_CD|
@@ -1172,7 +1172,6 @@ brasero_cdrecord_export_caps (BraseroPlugin *plugin, gchar **error)
 				      BRASERO_MEDIUM_HAS_AUDIO|
 				      BRASERO_MEDIUM_HAS_DATA|
 				      BRASERO_MEDIUM_BLANK;
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -1183,11 +1182,6 @@ brasero_cdrecord_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       1);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("cdrecord", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	/* for recording */
 	input = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_PIPE|
 					BRASERO_PLUGIN_IO_ACCEPT_FILE,
@@ -1407,6 +1401,10 @@ brasero_cdrecord_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_add_conf_option (plugin, immed);
 
 	brasero_plugin_register_group (plugin, _(CDRTOOLS_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "cdrecord");
 }
diff --git a/plugins/cdrtools/burn-mkisofs.c b/plugins/cdrtools/burn-mkisofs.c
index d9745ce..0bc399b 100644
--- a/plugins/cdrtools/burn-mkisofs.c
+++ b/plugins/cdrtools/burn-mkisofs.c
@@ -523,10 +523,9 @@ brasero_mkisofs_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_mkisofs_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_mkisofs_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -536,11 +535,6 @@ brasero_mkisofs_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       0);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("mkisofs", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	brasero_plugin_set_flags (plugin,
 				  BRASERO_MEDIUM_CDR|
 				  BRASERO_MEDIUM_CDRW|
@@ -590,6 +584,10 @@ brasero_mkisofs_export_caps (BraseroPlugin *plugin, gchar **error)
 	g_slist_free (output);
 
 	brasero_plugin_register_group (plugin, _(CDRTOOLS_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "mkisofs");
 }
diff --git a/plugins/cdrtools/burn-readcd.c b/plugins/cdrtools/burn-readcd.c
index ca6fcf6..68b746f 100644
--- a/plugins/cdrtools/burn-readcd.c
+++ b/plugins/cdrtools/burn-readcd.c
@@ -448,10 +448,9 @@ brasero_readcd_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_readcd_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_readcd_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -461,11 +460,6 @@ brasero_readcd_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       0);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("readcd", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	/* that's for clone mode only The only one to copy audio */
 	output = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					 BRASERO_IMAGE_FORMAT_CLONE);
@@ -507,6 +501,10 @@ brasero_readcd_export_caps (BraseroPlugin *plugin, gchar **error)
 	g_slist_free (input);
 
 	brasero_plugin_register_group (plugin, _(CDRTOOLS_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "readcd");
 }
diff --git a/plugins/checksum/burn-checksum-files.c b/plugins/checksum/burn-checksum-files.c
index a65464c..efea627 100644
--- a/plugins/checksum/burn-checksum-files.c
+++ b/plugins/checksum/burn-checksum-files.c
@@ -1453,8 +1453,8 @@ brasero_checksum_files_class_init (BraseroChecksumFilesClass *klass)
 	job_class->clock_tick = brasero_checksum_files_clock_tick;
 }
 
-static BraseroBurnResult
-brasero_checksum_files_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_checksum_files_export_caps (BraseroPlugin *plugin)
 {
 	GSList *input;
 	BraseroPluginConfOption *checksum_type;
@@ -1516,6 +1516,4 @@ brasero_checksum_files_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_add_conf_option (plugin, checksum_type);
 
 	brasero_plugin_set_compulsory (plugin, FALSE);
-
-	return BRASERO_BURN_OK;
 }
diff --git a/plugins/checksum/burn-checksum-image.c b/plugins/checksum/burn-checksum-image.c
index 1d4a3ad..da01746 100644
--- a/plugins/checksum/burn-checksum-image.c
+++ b/plugins/checksum/burn-checksum-image.c
@@ -817,8 +817,8 @@ brasero_checksum_image_class_init (BraseroChecksumImageClass *klass)
 	job_class->clock_tick = brasero_checksum_image_clock_tick;
 }
 
-static BraseroBurnResult
-brasero_checksum_image_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_checksum_image_export_caps (BraseroPlugin *plugin)
 {
 	GSList *input;
 	BraseroPluginConfOption *checksum_type;
@@ -864,6 +864,4 @@ brasero_checksum_image_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_add_conf_option (plugin, checksum_type);
 
 	brasero_plugin_set_compulsory (plugin, FALSE);
-
-	return BRASERO_BURN_OK;
 }
diff --git a/plugins/dvdauthor/burn-dvdauthor.c b/plugins/dvdauthor/burn-dvdauthor.c
index 0e65047..7a109f5 100644
--- a/plugins/dvdauthor/burn-dvdauthor.c
+++ b/plugins/dvdauthor/burn-dvdauthor.c
@@ -361,10 +361,9 @@ brasero_dvd_author_class_init (BraseroDvdAuthorClass *klass)
 	process_class->post = brasero_dvd_author_post;
 }
 
-static BraseroBurnResult
-brasero_dvd_author_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_dvd_author_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -375,11 +374,6 @@ brasero_dvd_author_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       1);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("dvdauthor", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					BRASERO_AUDIO_FORMAT_AC3|
 					BRASERO_AUDIO_FORMAT_MP2|
@@ -427,6 +421,10 @@ brasero_dvd_author_export_caps (BraseroPlugin *plugin, gchar **error)
 				  BRASERO_MEDIUM_HAS_DATA,
 				  BRASERO_BURN_FLAG_NONE,
 				  BRASERO_BURN_FLAG_NONE);
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "dvdauthor");
 }
diff --git a/plugins/dvdcss/burn-dvdcss.c b/plugins/dvdcss/burn-dvdcss.c
index d1ada4f..3467576 100644
--- a/plugins/dvdcss/burn-dvdcss.c
+++ b/plugins/dvdcss/burn-dvdcss.c
@@ -82,10 +82,10 @@ typedef struct _BraseroDvdcssPrivate BraseroDvdcssPrivate;
 static GObjectClass *parent_class = NULL;
 
 static gboolean
-brasero_dvdcss_library_init (GError **error)
+brasero_dvdcss_library_init (BraseroPlugin *plugin)
 {
-	GModule *module;
 	gpointer address;
+	GModule *module;
 	gchar *dvdcss_interface_2 = NULL;
 
 	if (css_ready)
@@ -98,53 +98,46 @@ brasero_dvdcss_library_init (GError **error)
 
 	if (!g_module_symbol (module, "dvdcss_interface_2", &address))
 		goto error_version;
-
 	dvdcss_interface_2 = address;
+
 	if (!g_module_symbol (module, "dvdcss_open", &address))
-		goto error_loading;
+		goto error_version;
 	dvdcss_open = address;
 
 	if (!g_module_symbol (module, "dvdcss_close", &address))
-		goto error_loading;
+		goto error_version;
 	dvdcss_close = address;
 
 	if (!g_module_symbol (module, "dvdcss_read", &address))
-		goto error_loading;
+		goto error_version;
 	dvdcss_read = address;
 
 	if (!g_module_symbol (module, "dvdcss_seek", &address))
-		goto error_loading;
+		goto error_version;
 	dvdcss_seek = address;
 
 	if (!g_module_symbol (module, "dvdcss_error", &address))
-		goto error_loading;
+		goto error_version;
 	dvdcss_error = address;
 
+	if (plugin) {
+		g_module_close (module);
+		return TRUE;
+	}
+
 	css_ready = TRUE;
 	return TRUE;
 
 error_doesnt_exist:
-	g_set_error (error,
-		     BRASERO_BURN_ERROR,
-		     BRASERO_BURN_ERROR_GENERAL,
-		     _("Encrypted DVD: please install libdvdcss version 1.2.x"));
+	brasero_plugin_add_error (plugin,
+	                          BRASERO_PLUGIN_ERROR_MISSING_LIBRARY,
+	                          "libdvdcss.so.2");
 	return FALSE;
 
 error_version:
-	g_set_error (error,
-		     BRASERO_BURN_ERROR,
-		     BRASERO_BURN_ERROR_GENERAL,
-		     _("libdvdcss version %s is not supported.\nPlease install libdvdcss version 1.2.x"),
-		     dvdcss_interface_2);
-	g_module_close (module);
-	return FALSE;
-
-
-error_loading:
-	g_set_error (error,
-		     BRASERO_BURN_ERROR,
-		     BRASERO_BURN_ERROR_GENERAL,
-		     _("libdvdcss could not be loaded properly"));
+	brasero_plugin_add_error (plugin,
+	                          BRASERO_PLUGIN_ERROR_LIBRARY_VERSION,
+	                          "libdvdcss.so.2");
 	g_module_close (module);
 	return FALSE;
 }
@@ -565,7 +558,7 @@ brasero_dvdcss_start (BraseroJob *job,
 	if (priv->thread)
 		return BRASERO_BURN_RUNNING;
 
-	if (!brasero_dvdcss_library_init (error))
+	if (!brasero_dvdcss_library_init (NULL))
 		return BRASERO_BURN_ERR;
 
 	g_mutex_lock (priv->mutex);
@@ -672,10 +665,9 @@ brasero_dvdcss_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_dvdcss_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_dvdcss_export_caps (BraseroPlugin *plugin)
 {
-	GError *gerror = NULL;
 	GSList *output;
 	GSList *input;
 
@@ -686,15 +678,6 @@ brasero_dvdcss_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       0);
 
-	/* see if libdvdcss can be initted */
-	if (!brasero_dvdcss_library_init (&gerror)) {
-		if (gerror) {
-			*error = g_strdup (gerror->message);
-			g_error_free (gerror);
-		}
-		return BRASERO_BURN_ERR;
-	}
-
 	/* to my knowledge, css can only be applied to pressed discs so no need
 	 * to specify anything else but ROM */
 	output = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_FILE|
@@ -711,6 +694,10 @@ brasero_dvdcss_export_caps (BraseroPlugin *plugin, gchar **error)
 
 	g_slist_free (input);
 	g_slist_free (output);
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_dvdcss_library_init (plugin);
 }
diff --git a/plugins/growisofs/burn-dvd-rw-format.c b/plugins/growisofs/burn-dvd-rw-format.c
index 25b665a..a7876d9 100644
--- a/plugins/growisofs/burn-dvd-rw-format.c
+++ b/plugins/growisofs/burn-dvd-rw-format.c
@@ -170,8 +170,8 @@ brasero_dvd_rw_format_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_dvd_rw_format_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_dvd_rw_format_export_caps (BraseroPlugin *plugin)
 {
 	/* NOTE: sequential and restricted are added later on demand */
 	const BraseroMedia media = BRASERO_MEDIUM_DVD|
@@ -182,7 +182,6 @@ brasero_dvd_rw_format_export_caps (BraseroPlugin *plugin, gchar **error)
 				   BRASERO_MEDIUM_HAS_DATA|
 				   BRASERO_MEDIUM_UNFORMATTED|
 				   BRASERO_MEDIUM_BLANK;
-	BraseroBurnResult result;
 	GSList *output;
 
 	brasero_plugin_define (plugin,
@@ -191,11 +190,6 @@ brasero_dvd_rw_format_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       4);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("dvd+rw-format", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	output = brasero_caps_disc_new (media|
 					BRASERO_MEDIUM_BDRE|
 					BRASERO_MEDIUM_PLUS|
@@ -219,6 +213,10 @@ brasero_dvd_rw_format_export_caps (BraseroPlugin *plugin, gchar **error)
 					BRASERO_BURN_FLAG_NONE);
 
 	brasero_plugin_register_group (plugin, _(GROWISOFS_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "dvd+rw-format");
 }
diff --git a/plugins/growisofs/burn-growisofs.c b/plugins/growisofs/burn-growisofs.c
index 63cf4b2..4590574 100644
--- a/plugins/growisofs/burn-growisofs.c
+++ b/plugins/growisofs/burn-growisofs.c
@@ -733,12 +733,11 @@ brasero_growisofs_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_growisofs_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_growisofs_export_caps (BraseroPlugin *plugin)
 {
 	BraseroPluginConfOption *use_dao;
 	gboolean use_dao_gconf_key;
-	BraseroBurnResult result;
 	GSList *input_symlink;
 	GSList *input_joliet;
 	GConfClient *client;
@@ -751,11 +750,6 @@ brasero_growisofs_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       7);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("growisofs", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	/* growisofs can write images to any type of BD/DVD-R as long as it's blank */
 	input = brasero_caps_image_new (BRASERO_PLUGIN_IO_ACCEPT_PIPE|
 					BRASERO_PLUGIN_IO_ACCEPT_FILE,
@@ -931,6 +925,11 @@ brasero_growisofs_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_add_conf_option (plugin, use_dao); 
 
 	brasero_plugin_register_group (plugin, _(GROWISOFS_DESCRIPTION));
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "growisofs");
 }
+
diff --git a/plugins/local-track/burn-local-image.c b/plugins/local-track/burn-local-image.c
index ade53a5..adb2144 100644
--- a/plugins/local-track/burn-local-image.c
+++ b/plugins/local-track/burn-local-image.c
@@ -898,8 +898,8 @@ brasero_local_track_init (BraseroLocalTrack *obj)
 	priv->cond = g_cond_new ();
 }
 
-static BraseroBurnResult
-brasero_local_track_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_local_track_export_caps (BraseroPlugin *plugin)
 {
 	GSList *caps;
 
@@ -948,6 +948,4 @@ brasero_local_track_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_set_process_flags (plugin, BRASERO_PLUGIN_RUN_PREPROCESSING);
 
 	brasero_plugin_set_compulsory (plugin, FALSE);
-
-	return BRASERO_BURN_OK;
 }
diff --git a/plugins/local-track/burn-uri.c b/plugins/local-track/burn-uri.c
index ed54478..0a139ed 100644
--- a/plugins/local-track/burn-uri.c
+++ b/plugins/local-track/burn-uri.c
@@ -734,8 +734,8 @@ brasero_burn_uri_init (BraseroBurnURI *obj)
 	priv->cond = g_cond_new ();
 }
 
-static BraseroBurnResult
-brasero_burn_uri_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_burn_uri_export_caps (BraseroPlugin *plugin)
 {
 	GSList *caps;
 
@@ -758,6 +758,4 @@ brasero_burn_uri_export_caps (BraseroPlugin *plugin, gchar **error)
 	g_slist_free (caps);
 
 	brasero_plugin_set_process_flags (plugin, BRASERO_PLUGIN_RUN_PREPROCESSING);
-
-	return BRASERO_BURN_OK;
 }
diff --git a/plugins/transcode/burn-normalize.c b/plugins/transcode/burn-normalize.c
index d349098..bc20044 100644
--- a/plugins/transcode/burn-normalize.c
+++ b/plugins/transcode/burn-normalize.c
@@ -636,11 +636,10 @@ brasero_normalize_class_init (BraseroNormalizeClass *klass)
 	job_class->stop = brasero_normalize_stop;
 }
 
-static BraseroBurnResult
-brasero_normalize_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_normalize_export_caps (BraseroPlugin *plugin)
 {
 	GSList *input;
-	GstElement *element;
 
 	brasero_plugin_define (plugin,
 			       N_("Normalize"),
@@ -648,23 +647,6 @@ brasero_normalize_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       0);
 
-	/* Let's see if we've got the plugins we need */
-	element = gst_element_factory_make ("rgvolume", NULL);
-	if (!element) {
-		*error = g_strdup_printf (_("%s element could not be created"),
-					  "\"Rgvolume\"");
-		return BRASERO_BURN_ERR;
-	}
-	gst_object_unref (element);
-
-	element = gst_element_factory_make ("rganalysis", NULL);
-	if (!element) {
-		*error = g_strdup_printf (_("%s element could not be created"),
-					  "\"Rganalysis\"");
-		return BRASERO_BURN_ERR;
-	}
-	gst_object_unref (element);
-
 	/* Add dts to make sure that when they are mixed with regular songs
 	 * this plugin will be called for the regular tracks */
 	input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
@@ -686,6 +668,11 @@ brasero_normalize_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_set_process_flags (plugin, BRASERO_PLUGIN_RUN_PREPROCESSING);
 
 	brasero_plugin_set_compulsory (plugin, FALSE);
+}
 
-	return BRASERO_BURN_OK;
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_gstreamer_plugin (plugin, "rgvolume");
+	brasero_plugin_test_gstreamer_plugin (plugin, "rganalysis");
 }
diff --git a/plugins/transcode/burn-transcode.c b/plugins/transcode/burn-transcode.c
index 5acb857..9de09a7 100644
--- a/plugins/transcode/burn-transcode.c
+++ b/plugins/transcode/burn-transcode.c
@@ -1742,8 +1742,8 @@ brasero_transcode_finalize (GObject *object)
 	G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static BraseroBurnResult
-brasero_transcode_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_transcode_export_caps (BraseroPlugin *plugin)
 {
 	GSList *input;
 	GSList *output;
@@ -1789,6 +1789,4 @@ brasero_transcode_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_link_caps (plugin, output, input);
 	g_slist_free (output);
 	g_slist_free (input);
-
-	return BRASERO_BURN_OK;
 }
diff --git a/plugins/transcode/burn-vob.c b/plugins/transcode/burn-vob.c
index 5aaccef..81a6b9b 100644
--- a/plugins/transcode/burn-vob.c
+++ b/plugins/transcode/burn-vob.c
@@ -1275,45 +1275,11 @@ brasero_vob_class_init (BraseroVobClass *klass)
 	job_class->stop = brasero_vob_stop;
 }
 
-static BraseroBurnResult
-brasero_vob_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_vob_export_caps (BraseroPlugin *plugin)
 {
 	GSList *input;
 	GSList *output;
-	GstElement *element;
-
-	/* Let's see if we've got the plugins we need */
-	element = gst_element_factory_make ("ffenc_mpeg2video", NULL);
-	if (!element) {
-		*error = g_strdup_printf (_("%s element could not be created"),
-					  "\"ffenc_mpeg2video\"");
-		return BRASERO_BURN_ERR;
-	}
-	gst_object_unref (element);
-
-	element = gst_element_factory_make ("ffenc_ac3", NULL);
-	if (!element) {
-		*error = g_strdup_printf (_("%s element could not be created"),
-					  "\"ffenc_ac3\"");
-		return BRASERO_BURN_ERR;
-	}
-	gst_object_unref (element);
-
-	element = gst_element_factory_make ("ffenc_mp2", NULL);
-	if (!element) {
-		*error = g_strdup_printf (_("%s element could not be created"),
-					  "\"ffenc_mp2\"");
-		return BRASERO_BURN_ERR;
-	}
-	gst_object_unref (element);
-
-	element = gst_element_factory_make ("mplex", NULL);
-	if (!element) {
-		*error = g_strdup_printf (_("%s element could not be created"),
-					  "\"mplex\"");
-		return BRASERO_BURN_ERR;
-	}
-	gst_object_unref (element);
 
 	brasero_plugin_define (plugin,
 			       "transcode2vob",
@@ -1359,5 +1325,14 @@ brasero_vob_export_caps (BraseroPlugin *plugin, gchar **error)
 	brasero_plugin_link_caps (plugin, output, input);
 	g_slist_free (output);
 	g_slist_free (input);
-	return BRASERO_BURN_OK;
+}
+
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	/* Let's see if we've got the plugins we need */
+	brasero_plugin_test_gstreamer_plugin (plugin, "ffenc_mpeg2video");
+	brasero_plugin_test_gstreamer_plugin (plugin, "ffenc_ac3");
+	brasero_plugin_test_gstreamer_plugin (plugin, "ffenc_mp2");
+	brasero_plugin_test_gstreamer_plugin (plugin, "mplex");
 }
diff --git a/plugins/vcdimager/burn-vcdimager.c b/plugins/vcdimager/burn-vcdimager.c
index 026c0f1..888b4f8 100644
--- a/plugins/vcdimager/burn-vcdimager.c
+++ b/plugins/vcdimager/burn-vcdimager.c
@@ -471,10 +471,9 @@ brasero_vcd_imager_class_init (BraseroVcdImagerClass *klass)
 	process_class->post = brasero_job_finished_session;
 }
 
-static BraseroBurnResult
-brasero_vcd_imager_export_caps (BraseroPlugin *plugin, gchar **error)
+static void
+brasero_vcd_imager_export_caps (BraseroPlugin *plugin)
 {
-	BraseroBurnResult result;
 	GSList *output;
 	GSList *input;
 
@@ -485,11 +484,6 @@ brasero_vcd_imager_export_caps (BraseroPlugin *plugin, gchar **error)
 			       "Philippe Rouquier",
 			       1);
 
-	/* First see if this plugin can be used */
-	result = brasero_process_check_path ("vcdimager", error);
-	if (result != BRASERO_BURN_OK)
-		return result;
-
 	input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					BRASERO_AUDIO_FORMAT_MP2|
 					BRASERO_AUDIO_FORMAT_44100|
@@ -531,6 +525,10 @@ brasero_vcd_imager_export_caps (BraseroPlugin *plugin, gchar **error)
 				  BRASERO_MEDIUM_HAS_AUDIO,
 				  BRASERO_BURN_FLAG_NONE,
 				  BRASERO_BURN_FLAG_NONE);
-	return BRASERO_BURN_OK;
 }
 
+G_MODULE_EXPORT void
+brasero_plugin_check_config (BraseroPlugin *plugin)
+{
+	brasero_plugin_test_app (plugin, "vcdimager");
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]