[Sugar-devel] [PATCH Jukebox 5/8] Use 'playbin2' instead of 'playbin'

Manuel Kaufmann humitos at gmail.com
Thu Oct 4 13:29:25 EDT 2012


'playbin' is obsolete and not should be used. I was told in #gstreamer
(irc.freenode.net) that 'playbin' is no longer supported, that has
some bugs and shouldn't be used anymore. It should be changed by
'playbin2'

I had to set some flags as well to keep showing the 'vis-plugin' with
'playbin2' player.

Signed-off-by: Manuel Kaufmann <humitos at gmail.com>
---
 jukeboxactivity.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index 11e1331..5c02d23 100644
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -698,7 +698,13 @@ class GstPlayer(GObject.GObject):
         self.playing = False
         self.error = False
 
-        self.player = gst.element_factory_make("playbin", "player")
+        self.player = gst.element_factory_make("playbin2", "player")
+
+        # Set the proper flags to render the vis-plugin
+        GST_PLAY_FLAG_VIS = 1 << 3
+        GST_PLAY_FLAG_TEXT = 1 << 2
+        self.player.props.flags |= GST_PLAY_FLAG_VIS
+        self.player.props.flags |= GST_PLAY_FLAG_TEXT
 
         r = gst.registry_get_default()
         l = [x for x in r.get_feature_list(gst.ElementFactory)
-- 
1.7.11.4



More information about the Sugar-devel mailing list