[rhythmbox] visualizer: add a small queue between the visualizer and the sink



commit 334af10f7ff81946e25a90b6bade97be1f16fbe4
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun Nov 8 20:48:17 2009 +1000

    visualizer: add a small queue between the visualizer and the sink
    
    This decouples the visualization rendering from the video sink, which
    becomes important when the sink is syncing to a clock.  This was the
    primary difference between our tee mode visualization pipeline and what
    playbin2 uses.

 plugins/visualizer/rb-visualizer-plugin.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/plugins/visualizer/rb-visualizer-plugin.c b/plugins/visualizer/rb-visualizer-plugin.c
index a11a64b..e48c996 100644
--- a/plugins/visualizer/rb-visualizer-plugin.c
+++ b/plugins/visualizer/rb-visualizer-plugin.c
@@ -1648,6 +1648,7 @@ impl_activate (RBPlugin *plugin,
 	} else if (RB_IS_PLAYER_GST_TEE (pi->player)) {
 		GstElement *videoscale;
 		GstElement *colorspace;
+		GstElement *queue;
 		GstPad *pad;
 
 		rb_debug ("using tee-based visualization");
@@ -1670,11 +1671,14 @@ impl_activate (RBPlugin *plugin,
 		pi->capsfilter = gst_element_factory_make ("capsfilter", NULL);
 		colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
 		videoscale = gst_element_factory_make ("videoscale", NULL);
+		queue = gst_element_factory_make ("queue", NULL);
+
+		g_object_set (queue, "max-size-buffers", 3, "max-size-bytes", 0, "max-size-time", (gint64) 0, NULL);
 
 		gst_bin_add_many (GST_BIN (pi->visualizer),
-				  pi->identity, pi->capsfilter, colorspace, videoscale, pi->video_sink,
+				  pi->identity, pi->capsfilter, queue, colorspace, videoscale, pi->video_sink,
 				  NULL);
-		gst_element_link_many (pi->capsfilter, colorspace, videoscale, pi->video_sink, NULL);
+		gst_element_link_many (pi->capsfilter, queue, colorspace, videoscale, pi->video_sink, NULL);
 		/* leave identity unlinked until we have a visualizer element */
 
 		pad = gst_element_get_static_pad (pi->identity, "sink");



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