[rhythmbox] Move visualizer plugin to clutter-gst 2.0 series and GStreamer 1.0.



commit fb50d0fe80242c2614367c49201fc3a1f24b6cbd
Author: Iain Lane <iain lane canonical com>
Date:   Tue Nov 27 11:57:58 2012 +0000

    Move visualizer plugin to clutter-gst 2.0 series and GStreamer 1.0.
    
    'ffmpegcolorspace' is now replaced by 'videoconvert'.
    
    Use gst_element_link_filtered to link videoconvert to the sink, filtered
    by the given caps.

 configure.ac                              |   11 +++++------
 plugins/visualizer/rb-visualizer-page.c   |   24 ++++++++++++------------
 plugins/visualizer/rb-visualizer-plugin.c |    8 ++++----
 3 files changed, 21 insertions(+), 22 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0711a51..c1efff1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -693,16 +693,15 @@ AC_SUBST(DMAPSHARING_LIBS)
 dnl ================================================================
 dnl clutter for visualizer plugin
 dnl ================================================================
-dnl AC_ARG_ENABLE(visualizer,
-dnl               AC_HELP_STRING([--disable-visualizer],
-dnl                              [Disable visualizer plugin support]),,
-dnl               enable_visualizer=auto)
-enable_visualizer=no
+AC_ARG_ENABLE(visualizer,
+              AC_HELP_STRING([--disable-visualizer],
+                             [Disable visualizer plugin support]),,
+              enable_visualizer=auto)
 if test "x$enable_visualizer" != "xno"; then
        PKG_CHECK_MODULES(CLUTTER,
                          clutter-1.0 >= 1.8                    \
                          clutter-x11-1.0 >= 1.8                \
-                         clutter-gst-1.0 >= 1.4                \
+                         clutter-gst-2.0                               \
                          clutter-gtk-1.0 >= 1.0                \
                          mx-1.0 >= 1.0.1,
                          have_clutter=yes,
diff --git a/plugins/visualizer/rb-visualizer-page.c b/plugins/visualizer/rb-visualizer-page.c
index dffd5bc..98639a5 100644
--- a/plugins/visualizer/rb-visualizer-page.c
+++ b/plugins/visualizer/rb-visualizer-page.c
@@ -338,9 +338,8 @@ impl_constructed (GObject *object)
 {
        RBVisualizerPage *page;
        ClutterInitError err;
-       GstElement *colorspace;
+       GstElement *videoconvert;
        GstElement *realsink;
-       GstElement *capsfilter;
        GstCaps *caps;
        GstPad *pad;
 
@@ -368,18 +367,19 @@ impl_constructed (GObject *object)
        realsink = gst_element_factory_make ("cluttersink", NULL);
        g_object_set (realsink, "texture", page->texture, NULL);
 
-       colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
-       /* capsfilter to force rgb format (without this we end up using ayuv)  - XXX check this in 0.11 */
-       capsfilter = gst_element_factory_make ("capsfilter", NULL);
-       caps = gst_caps_from_string ("video/x-raw,format=(string)xRGB");
-       g_object_set (capsfilter, "caps", caps, NULL);
-       gst_caps_unref (caps);
+       videoconvert = gst_element_factory_make ("videoconvert", NULL);
 
-       gst_bin_add_many (GST_BIN (page->sink), colorspace, capsfilter, realsink, NULL);
-       gst_element_link (colorspace, capsfilter);
-       gst_element_link (capsfilter, realsink);
+       /* force rgb format (without this we end up using ayuv)  -
+        * XXX check this in 0.11 */
+       caps = gst_caps_from_string ("video/x-raw,format=(string)RGB");
 
-       pad = gst_element_get_static_pad (colorspace, "sink");
+       gst_bin_add_many (GST_BIN (page->sink),
+                                videoconvert, realsink, NULL);
+
+       gst_element_link_filtered(videoconvert, realsink, caps);
+       gst_caps_unref(caps);
+
+       pad = gst_element_get_static_pad (videoconvert, "sink");
        gst_element_add_pad (page->sink, gst_ghost_pad_new ("sink", pad));
        gst_object_unref (pad);
 
diff --git a/plugins/visualizer/rb-visualizer-plugin.c b/plugins/visualizer/rb-visualizer-plugin.c
index 6ae98b8..d810463 100644
--- a/plugins/visualizer/rb-visualizer-plugin.c
+++ b/plugins/visualizer/rb-visualizer-plugin.c
@@ -291,16 +291,16 @@ start_visualizer_cb (RBVisualizerPage *page, RBVisualizerPlugin *plugin)
                        rb_debug ("playback hasn't started yet");
                }
        } else {
-               GstElement *colorspace;
+               GstElement *videoconvert;
                GstElement *queue;
 
-               colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
+               videoconvert = gst_element_factory_make ("videoconvert", 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 (plugin->visualizer), queue, colorspace, plugin->sink, NULL);
-               gst_element_link_many (plugin->capsfilter, queue, colorspace, plugin->sink, NULL);
+               gst_bin_add_many (GST_BIN (plugin->visualizer), queue, videoconvert, plugin->sink, NULL);
+               gst_element_link_many (plugin->capsfilter, queue, videoconvert, plugin->sink, NULL);
 
                rb_debug ("adding visualizer bin to the pipeline");
                rb_player_gst_tee_add_tee (RB_PLAYER_GST_TEE (plugin->player),


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