brasero r1367 - in trunk: . src src/plugins/checksum src/plugins/local-track src/plugins/transcode



Author: philippr
Date: Sat Oct 11 18:34:48 2008
New Revision: 1367
URL: http://svn.gnome.org/viewvc/brasero?rev=1367&view=rev

Log:
	Improved processing plugin handling

	* src/burn-caps.c (brasero_burn_caps_sort_modifiers),
	(brasero_caps_add_processing_plugins_to_task),
	(brasero_burn_caps_new_task):
	* src/burn-plugin.h:
	* src/plugins/checksum/burn-checksum-files.c
	(brasero_checksum_files_export_caps):
	* src/plugins/checksum/burn-checksum-image.c
	(brasero_checksum_image_export_caps):
	* src/plugins/local-track/burn-local-image.c
	(brasero_local_track_export_caps):
	* src/plugins/transcode/burn-normalize.c
	(brasero_normalize_export_caps):

Modified:
   trunk/ChangeLog
   trunk/src/burn-caps.c
   trunk/src/burn-plugin.h
   trunk/src/plugins/checksum/burn-checksum-files.c
   trunk/src/plugins/checksum/burn-checksum-image.c
   trunk/src/plugins/local-track/burn-local-image.c
   trunk/src/plugins/transcode/burn-normalize.c

Modified: trunk/src/burn-caps.c
==============================================================================
--- trunk/src/burn-caps.c	(original)
+++ trunk/src/burn-caps.c	Sat Oct 11 18:34:48 2008
@@ -1190,8 +1190,8 @@
 	BraseroPlugin *plug_a = BRASERO_PLUGIN (a);
 	BraseroPlugin *plug_b = BRASERO_PLUGIN (b);
 
-	return brasero_plugin_get_priority (plug_a) -
-	       brasero_plugin_get_priority (plug_b);
+	return brasero_plugin_get_priority (plug_b) -
+	       brasero_plugin_get_priority (plug_a);
 }
 
 static GSList *
@@ -1232,7 +1232,7 @@
 			continue;
 
 		brasero_plugin_get_process_flags (plugin, &flags);
-		if (!(flags & position))
+		if ((flags & position) != position)
 			continue;
 
 		type = brasero_plugin_get_gtype (plugin);
@@ -1419,7 +1419,7 @@
 
 	/* reverse the list of links to have them in the right order */
 	list = g_slist_reverse (list);
-	position = BRASERO_PLUGIN_RUN_FIRST;
+	position = BRASERO_PLUGIN_RUN_PREPROCESSING;
 	group_id = self->priv->group_id;
 
 	brasero_burn_session_get_input_type (session, &plugin_input);
@@ -1433,13 +1433,6 @@
 
 		link = iter->data;
 
-		if (last_caps->type.type == BRASERO_TRACK_TYPE_DISC && !iter->next) {
-			/* if we are recording then the last caps is considered
-			 * to be the one before the DISC caps since the latter
-			 * can't have processing plugin */
-			position |= BRASERO_PLUGIN_RUN_LAST;
-		}
-
 		/* determine the plugin output */
 		if (iter->next) {
 			BraseroCapsLink *next_link;
@@ -1525,29 +1518,22 @@
 		BRASERO_BURN_LOG_TYPE (&plugin_input, "input");
 		BRASERO_BURN_LOG_TYPE (&plugin_output, "output");
 
-		position = BRASERO_PLUGIN_RUN_NEVER;
+		position = BRASERO_PLUGIN_RUN_BEFORE_TARGET;
 
 		/* the output of the plugin will become the input of the next */
 		memcpy (&plugin_input, &plugin_output, sizeof (BraseroTrackType));
 	}
 	g_slist_free (list);
 
-	if (last_caps->type.type != BRASERO_TRACK_TYPE_DISC) {
-		GSList *result;
+	/* add the post processing plugins */
+	list = brasero_caps_add_processing_plugins_to_task (session,
+							    NULL,
+							    last_caps,
+							    &output,
+							    BRASERO_PLUGIN_RUN_AFTER_TARGET);
+	retval = g_slist_concat (retval, list);
 
-		/* imaging to a file so we never run the processing plugin on
-		 * the fly in this case so as to allow the last plugin to output
-		 * correctly to a file */
-		/* NOTE: if it's not a disc we didn't modified the output
-		 * subtype */
-		result = brasero_caps_add_processing_plugins_to_task (session,
-								      NULL,
-								      last_caps,
-								      &output,
-								      BRASERO_PLUGIN_RUN_LAST);
-		retval = g_slist_concat (retval, result);
-	}
-	else if (blanking) {
+	if (last_caps->type.type == BRASERO_TRACK_TYPE_DISC && blanking) {
 		retval = g_slist_insert_before (retval,
 						g_slist_last (retval),
 						blanking);

Modified: trunk/src/burn-plugin.h
==============================================================================
--- trunk/src/burn-plugin.h	(original)
+++ trunk/src/burn-plugin.h	Sat Oct 11 18:34:48 2008
@@ -95,11 +95,14 @@
 typedef enum {
 	BRASERO_PLUGIN_RUN_NEVER		= 0,
 
-	/* run before the plugin */
-	BRASERO_PLUGIN_RUN_FIRST		= 1,
+	/* pre-process initial track */
+	BRASERO_PLUGIN_RUN_PREPROCESSING	= 1,
 
-	/* run after the plugin */
-	BRASERO_PLUGIN_RUN_LAST			= 1 << 1,
+	/* run before final image/disc is created */
+	BRASERO_PLUGIN_RUN_BEFORE_TARGET	= 1 << 1,
+
+	/* run after final image/disc is created: post-processing */
+	BRASERO_PLUGIN_RUN_AFTER_TARGET		= 1 << 2,
 } BraseroPluginProcessFlag;
 
 GType

Modified: trunk/src/plugins/checksum/burn-checksum-files.c
==============================================================================
--- trunk/src/plugins/checksum/burn-checksum-files.c	(original)
+++ trunk/src/plugins/checksum/burn-checksum-files.c	Sat Oct 11 18:34:48 2008
@@ -1231,9 +1231,10 @@
 	brasero_plugin_process_caps (plugin, input);
 	g_slist_free (input);
 
+	/* we can run on initial track or later for whatever a DATA track */
 	brasero_plugin_set_process_flags (plugin,
-					  BRASERO_PLUGIN_RUN_FIRST|
-					  BRASERO_PLUGIN_RUN_LAST);
+					  BRASERO_PLUGIN_RUN_PREPROCESSING|
+					  BRASERO_PLUGIN_RUN_BEFORE_TARGET);
 
 	/* For discs, we can only check each files on a disc against an md5sum 
 	 * file (provided we managed to mount the disc).

Modified: trunk/src/plugins/checksum/burn-checksum-image.c
==============================================================================
--- trunk/src/plugins/checksum/burn-checksum-image.c	(original)
+++ trunk/src/plugins/checksum/burn-checksum-image.c	Sat Oct 11 18:34:48 2008
@@ -702,9 +702,10 @@
 					BRASERO_PLUGIN_IO_ACCEPT_PIPE,
 					BRASERO_IMAGE_FORMAT_BIN);
 	brasero_plugin_process_caps (plugin, input);
+
 	brasero_plugin_set_process_flags (plugin,
-					  BRASERO_PLUGIN_RUN_FIRST|
-					  BRASERO_PLUGIN_RUN_LAST);
+					  BRASERO_PLUGIN_RUN_PREPROCESSING|
+					  BRASERO_PLUGIN_RUN_BEFORE_TARGET);
 
 	brasero_plugin_check_caps (plugin,
 				   BRASERO_CHECKSUM_MD5|

Modified: trunk/src/plugins/local-track/burn-local-image.c
==============================================================================
--- trunk/src/plugins/local-track/burn-local-image.c	(original)
+++ trunk/src/plugins/local-track/burn-local-image.c	Sat Oct 11 18:34:48 2008
@@ -983,7 +983,7 @@
 	brasero_plugin_process_caps (plugin, caps);
 	g_slist_free (caps);
 
-	brasero_plugin_set_process_flags (plugin, BRASERO_PLUGIN_RUN_FIRST);
+	brasero_plugin_set_process_flags (plugin, BRASERO_PLUGIN_RUN_PREPROCESSING);
 
 	return BRASERO_BURN_OK;
 }

Modified: trunk/src/plugins/transcode/burn-normalize.c
==============================================================================
--- trunk/src/plugins/transcode/burn-normalize.c	(original)
+++ trunk/src/plugins/transcode/burn-normalize.c	Sat Oct 11 18:34:48 2008
@@ -580,7 +580,9 @@
 	input = brasero_caps_audio_new (BRASERO_PLUGIN_IO_ACCEPT_FILE,
 					BRASERO_AUDIO_FORMAT_UNDEFINED);
 	brasero_plugin_process_caps (plugin, input);
-	brasero_plugin_set_process_flags (plugin, BRASERO_PLUGIN_RUN_FIRST);
+
+	/* We should run first */
+	brasero_plugin_set_process_flags (plugin, BRASERO_PLUGIN_RUN_PREPROCESSING);
 	g_slist_free (input);
 
 	return BRASERO_BURN_OK;



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