brasero r884 - in branches/video: . src/plugins/dvdauthor src/plugins/gstreamer



Author: philippr
Date: Thu Jun 12 16:26:42 2008
New Revision: 884
URL: http://svn.gnome.org/viewvc/brasero?rev=884&view=rev

Log:
	Added support for framerate and size

	* configure.in:
	* src/plugins/dvdauthor/Makefile.am:
	* src/plugins/gstreamer/burn-vob.c (brasero_vob_build_video_bin):

Modified:
   branches/video/ChangeLog
   branches/video/src/plugins/dvdauthor/Makefile.am
   branches/video/src/plugins/gstreamer/burn-vob.c

Modified: branches/video/src/plugins/dvdauthor/Makefile.am
==============================================================================
--- branches/video/src/plugins/dvdauthor/Makefile.am	(original)
+++ branches/video/src/plugins/dvdauthor/Makefile.am	Thu Jun 12 16:26:42 2008
@@ -18,7 +18,7 @@
 dvdauthordir = $(libdir)/brasero/plugins
 dvdauthor_LTLIBRARIES = libbrasero-dvdauthor.la
 
-libbrasero_dvdauthor_la_SOURCES = burn-dvdauthor.c burn-dvdauthor.h burn-normalize.h
+libbrasero_dvdauthor_la_SOURCES = burn-dvdauthor.c burn-dvdauthor.h
 libbrasero_dvdauthor_la_LIBADD = $(BRASERO_BASE_LIBS) $(BRASERO_LIBXML_LIBS)
 libbrasero_dvdauthor_la_LDFLAGS = -module -avoid-version
 

Modified: branches/video/src/plugins/gstreamer/burn-vob.c
==============================================================================
--- branches/video/src/plugins/gstreamer/burn-vob.c	(original)
+++ branches/video/src/plugins/gstreamer/burn-vob.c	Thu Jun 12 16:26:42 2008
@@ -489,6 +489,7 @@
 	GValue *value;
 	GstPad *srcpad;
 	GstPad *sinkpad;
+	GstElement *scale;
 	GstElement *queue;
 	GstElement *filter;
 	GstElement *encode;
@@ -515,6 +516,7 @@
 		      "max-size-time", (gint64) 0,
 		      NULL);
 
+	/* framerate and video type control */
 	framerate = gst_element_factory_make ("videorate", NULL);
 	if (framerate == NULL) {
 		g_set_error (error,
@@ -528,6 +530,17 @@
 		      "silent", TRUE,
 		      NULL);
 
+	/* size scaling */
+	scale = gst_element_factory_make ("videoscale", NULL);
+	if (scale == NULL) {
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     _("scale can't be created"));
+		goto error;
+	}
+	gst_bin_add (GST_BIN (priv->pipeline), scale);
+
 	/* create a filter */
 	filter = gst_element_factory_make ("capsfilter", NULL);
 	if (filter == NULL) {
@@ -539,36 +552,6 @@
 	}
 	gst_bin_add (GST_BIN (priv->pipeline), filter);
 
-	value = NULL;
-	result = brasero_job_tag_lookup (BRASERO_JOB (vob),
-					 BRASERO_VIDEO_OUTPUT_FRAMERATE,
-					 &value);
-
-/*	if (result == BRASERO_BURN_OK && value) {
-		gint rate;
-		GstCaps *filtercaps;
-		GValue fraction = { 0 };
-
-		rate = g_value_get_int (value);
-		g_value_init (&fraction, GST_TYPE_FRACTION);
-
-		if (rate == BRASERO_VIDEO_FRAMERATE_NTSC)
-			gst_value_set_fraction (&fraction, 30, 1.001);
-		else if (rate == BRASERO_VIDEO_FRAMERATE_PAL_SECAM)
-			gst_value_set_fraction (&fraction, 25, 1);
-
-		filtercaps = gst_caps_new_full (gst_structure_new ("video/x-raw-yuv",
-								   "framerate", G_TYPE_VALUE, &fraction,
-								   NULL),
-						gst_structure_new ("video/x-raw-rgb",
-								   "framerate", G_TYPE_VALUE, &fraction,
-								   NULL),
-						NULL);
-		g_object_set (GST_OBJECT (filter), "caps", filtercaps, NULL);
-		gst_caps_unref (filtercaps);
-	}
-*/
-
 	colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
 	if (colorspace == NULL) {
 		g_set_error (error,
@@ -589,6 +572,63 @@
 	}
 	gst_bin_add (GST_BIN (priv->pipeline), encode);
 
+	g_object_set (encode,
+		      "format", 8,
+		      NULL);
+
+	/* settings */
+	value = NULL;
+	result = brasero_job_tag_lookup (BRASERO_JOB (vob),
+					 BRASERO_VIDEO_OUTPUT_FRAMERATE,
+					 &value);
+
+	if (result == BRASERO_BURN_OK && value) {
+		gint rate;
+		GstCaps *filtercaps = NULL;
+
+		rate = g_value_get_int (value);
+
+		if (rate == BRASERO_VIDEO_FRAMERATE_NTSC) {
+			g_object_set (encode,
+				      "norm", 110,
+				      "framerate", 4,
+				      NULL);
+			filtercaps = gst_caps_new_full (gst_structure_new ("video/x-raw-yuv",
+									   "framerate", GST_TYPE_FRACTION, 30000, 1001,
+									   "width", G_TYPE_INT, 720,
+									   "height", G_TYPE_INT, 480,
+									   NULL),
+							gst_structure_new ("video/x-raw-rgb",
+									   "framerate", GST_TYPE_FRACTION, 30000, 1001,
+									   "width", G_TYPE_INT, 720,
+									   "height", G_TYPE_INT, 480,
+									   NULL),
+							NULL);
+		}
+		else if (rate == BRASERO_VIDEO_FRAMERATE_PAL_SECAM) {
+			g_object_set (encode,
+				      "norm", 112,
+				      "framerate", 3,
+				      NULL);
+			filtercaps = gst_caps_new_full (gst_structure_new ("video/x-raw-yuv",
+									   "framerate", GST_TYPE_FRACTION, 25, 1,
+									   "width", G_TYPE_INT, 720,
+									   "height", G_TYPE_INT, 576,
+									   NULL),
+							gst_structure_new ("video/x-raw-rgb",
+									   "framerate", GST_TYPE_FRACTION, 25, 1,
+									   "width", G_TYPE_INT, 720,
+									   "height", G_TYPE_INT, 576,
+									   NULL),
+							NULL);
+		}
+
+		if (filtercaps) {
+			g_object_set (GST_OBJECT (filter), "caps", filtercaps, NULL);
+			gst_caps_unref (filtercaps);
+		}
+	}
+
 	value = NULL;
 	result = brasero_job_tag_lookup (BRASERO_JOB (vob),
 					 BRASERO_VIDEO_OUTPUT_ASPECT,
@@ -609,7 +649,7 @@
 		}
 	}
 
-	gst_element_link_many (queue, framerate, colorspace, filter, encode, NULL);
+	gst_element_link_many (queue, framerate, scale, colorspace, filter, encode, NULL);
 
 	srcpad = gst_element_get_static_pad (encode, "src");
 	sinkpad = gst_element_get_request_pad (muxer, "video_%d");



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