[banshee] GStreamerSharp: update to work with new 0.99.0 version



commit 3897cd076add99d0940cbfc0853701a4782b2700
Author: Stephan Sundermann <stephansundermann gmail com>
Date:   Fri Dec 20 15:04:11 2013 +0100

    GStreamerSharp: update to work with new 0.99.0 version
    
    The new 0.99.0 version of this binding targets GStreamer 1.0. This
    has been an accomplishment that took many weeks, starting from the
    Gnome .NET 2013 Hackfest in Vienna.
    
    Contributions from:
     Stephan Sundermann,
     Olivier Dufour,
     Andres G. Aragoneses

 build/m4/banshee/gstreamer.m4                      |    4 +-
 .../Banshee.GStreamerSharp.csproj                  |    3 +-
 .../Banshee.GStreamerSharp.dll.config              |    2 +-
 .../Banshee.GStreamerSharp/AudioCdRipper.cs        |  125 ++++++-----
 .../Banshee.GStreamerSharp/BpmDetector.cs          |   85 ++++----
 .../Banshee.GStreamerSharp/CddaManager.cs          |   45 ++--
 .../Banshee.GStreamerSharp/DvdManager.cs           |   74 ++++---
 .../Banshee.GStreamerSharp/GstExtensions.cs        |   51 +++++
 .../Banshee.GStreamerSharp/PlayerEngine.cs         |  228 ++++++++++----------
 .../Banshee.GStreamerSharp/Transcoder.cs           |   37 ++--
 .../Banshee.GStreamerSharp/VideoManager.cs         |   76 ++++---
 .../Banshee.GStreamerSharp/Visualization.cs        |  227 +++++++++-----------
 src/Backends/Banshee.GStreamerSharp/Makefile.am    |    1 +
 13 files changed, 515 insertions(+), 443 deletions(-)
---
diff --git a/build/m4/banshee/gstreamer.m4 b/build/m4/banshee/gstreamer.m4
index cb90074..729a69f 100644
--- a/build/m4/banshee/gstreamer.m4
+++ b/build/m4/banshee/gstreamer.m4
@@ -1,9 +1,11 @@
 AC_DEFUN([BANSHEE_CHECK_GSTREAMER],
 [
+       GSTREAMER_SHARP_REQUIRED_VERSION=0.99.0
+
        AC_ARG_ENABLE(gst_sharp, AC_HELP_STRING([--enable-gst-sharp], [Enable Gst# backend]), , 
enable_gst_sharp="no")
 
        if test "x$enable_gst_sharp" = "xyes"; then
-               PKG_CHECK_MODULES(GST_SHARP, gstreamer-sharp-0.10)
+               PKG_CHECK_MODULES(GST_SHARP, gstreamer-sharp-1.0 >= $GSTREAMER_SHARP_REQUIRED_VERSION)
                AC_SUBST(GST_SHARP_LIBS)
                AM_CONDITIONAL(ENABLE_GST_SHARP, true)
 
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.csproj 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.csproj
index f848f4b..96794ee 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.csproj
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.csproj
@@ -32,7 +32,7 @@
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Core" />
-    <Reference Include="gstreamer-sharp, Version=0.9.2.0, Culture=neutral, PublicKeyToken=4956b48baf980190">
+    <Reference Include="gstreamer-sharp, Version=0.99.0.0, Culture=neutral, PublicKeyToken=4956b48baf980190">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\bin\bin\gstreamer-sharp.dll</HintPath>
     </Reference>
@@ -75,6 +75,7 @@
     <Compile Include="Banshee.GStreamerSharp\VideoManager.cs" />
     <Compile Include="Banshee.GStreamerSharp\Visualization.cs" />
     <Compile Include="Banshee.GStreamerSharp\DvdManager.cs" />
+    <Compile Include="Banshee.GStreamerSharp\GstExtensions.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config
index 2fdea6b..62f455f 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config
@@ -3,5 +3,5 @@
   <dllmap dll="libgdk-3-0.dll" target="libgdk-3-0.dll" os="windows"/>
   <!-- FIXME: map to a .dylib in Mac? -->
 
-  <dllmap dll="libgstfft-0.10.dll" target="libgstfft-0.10.so"/>
+  <dllmap dll="libgstfft-1.0-0.dll" target="libgstfft-1.0.so" os="!windows" />
 </configuration>
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/AudioCdRipper.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/AudioCdRipper.cs
index da484fc..ea4c222 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/AudioCdRipper.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/AudioCdRipper.cs
@@ -1,10 +1,14 @@
 //
 // AudioCdRipper.cs
 //
-// Author:
+// Authors:
 //   Olivier Dufour <olivier duff gmail com>
+//   Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
 // Copyright (c) 2011 Olivier Dufour
+// Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -100,19 +104,19 @@ namespace Banshee.GStreamerSharp
         void OnTick (object o, System.Timers.ElapsedEventArgs args)
         {
             Format format = Format.Time;
-            State state;
+            State state, pending;
             long position;
 
-            pipeline.GetState (out state, 0);
+            pipeline.GetState (out state, out pending, 0);
             if (state != State.Playing) {
                 return;
             }
 
-            if (!cddasrc.QueryPosition (ref format, out position)) {
+            if (!cddasrc.QueryPosition (format, out position)) {
                 return;
             }
 
-            RaiseProgress (current_track, TimeSpan.FromSeconds (position / (long)Clock.Second));
+            RaiseProgress (current_track, TimeSpan.FromSeconds (position / (long)Constants.SECOND));
         }
 
         public void Finish ()
@@ -161,8 +165,8 @@ namespace Banshee.GStreamerSharp
             tags.Add (TagMergeMode.Replace, CommonTags.AlbumDiscNumber, (uint)track.DiscNumber);
             tags.Add (TagMergeMode.Replace, CommonTags.AlbumDiscCount, (uint)track.DiscCount);
 
-            tags.Add (TagMergeMode.Replace, Gst.Tag.Date, track.Year);
-            tags.Add (TagMergeMode.Replace, Gst.Tag.Date, track.ReleaseDate);
+            tags.Add (TagMergeMode.Replace, CommonTags.Date, track.Year);
+            tags.Add (TagMergeMode.Replace, CommonTags.Date, track.ReleaseDate);
 
             tags.Add (TagMergeMode.Replace, CommonTags.Composer, track.Composer);
             tags.Add (TagMergeMode.Replace, CommonTags.Copyright, track.Copyright);
@@ -175,60 +179,66 @@ namespace Banshee.GStreamerSharp
             return tags;
         }
 
+        private GLib.GType ToGType (Type t)
+        {
+            return (GLib.GType)t;
+        }
+
         public void RipTrack (int trackIndex, TrackInfo track, SafeUri outputUri, out bool taggingSupported)
         {
             taggingSupported = false;
             TrackReset ();
             current_track = track;
 
-            using (TagList tags = MakeTagList (track)) {
-                output_path = String.Format ("{0}.{1}", outputUri.LocalPath, output_extension);
+            TagList tags = MakeTagList (track);
+            output_path = String.Format ("{0}.{1}", outputUri.LocalPath, output_extension);
 
-                // Avoid overwriting an existing file
-                int i = 1;
-                while (Banshee.IO.File.Exists (new SafeUri (output_path))) {
-                    output_path = String.Format ("{0} ({1}).{2}", outputUri.LocalPath, i++, 
output_extension);
-                }
+            // Avoid overwriting an existing file
+            int i = 1;
+            while (Banshee.IO.File.Exists (new SafeUri (output_path))) {
+                output_path = String.Format ("{0} ({1}).{2}", outputUri.LocalPath, i++, output_extension);
+            }
 
-                Log.DebugFormat ("GStreamer ripping track {0} to {1}", trackIndex, output_path);
+            Log.DebugFormat ("GStreamer ripping track {0} to {1}", trackIndex, output_path);
 
-                if (!ConstructPipeline ()) {
-                    return;
-                }
+            if (!ConstructPipeline ()) {
+                return;
+            }
 
-                // initialize the pipeline, set the sink output location
-                filesink.SetState (State.Null);
-                filesink ["location"] = output_path;
+            // initialize the pipeline, set the sink output location
+            filesink.SetState (State.Null);
+            filesink ["location"] = output_path;
 
-                var version = new System.Version (Banshee.ServiceStack.Application.Version);
+            var version = new System.Version (Banshee.ServiceStack.Application.Version);
 
-                // find an element to do the tagging and set tag data
-                foreach (Element element in encoder.GetAllByInterface (typeof (TagSetter))) {
-                    TagSetter tag_setter = element as TagSetter;
-                    if (tag_setter != null) {
-                        tag_setter.AddTag (TagMergeMode.ReplaceAll, Tag.Encoder,
-                            new Gst.GLib.Value (String.Format ("Banshee {0}", 
Banshee.ServiceStack.Application.Version)));
-                        tag_setter.AddTag (TagMergeMode.ReplaceAll, Tag.EncoderVersion,
-                            new Gst.GLib.Value ( (version.Major << 16) | (version.Minor << 8) | 
version.Build));
 
-                        if (tags != null) {
-                            tag_setter.AddTag (tags, TagMergeMode.Append);
-                        }
+            // find an element to do the tagging and set tag data
+            foreach (Element element in encoder.IterateAllByInterface (TagSetterAdapter.GType)) {
+                ITagSetter tag_setter = element as ITagSetter;
 
-                        /*if (banshee_is_debugging ()) {
-                            bt_tag_list_dump (gst_tag_setter_get_tag_list (tag_setter));
-                        }*/
+                if (tag_setter != null) {
+                    tag_setter.AddTagValue (TagMergeMode.ReplaceAll, Constants.TAG_ENCODER,
+                        new GLib.Value (String.Format ("Banshee {0}", 
Banshee.ServiceStack.Application.Version)));
+                    tag_setter.AddTagValue (TagMergeMode.ReplaceAll, Constants.TAG_VERSION,
+                        new GLib.Value ( (version.Major << 16) | (version.Minor << 8) | version.Build));
 
-                        // We'll warn the user in the UI if we can't tag the encoded audio files
-                        taggingSupported = true;
+                    if (tags != null) {
+                        tag_setter.MergeTags (tags, TagMergeMode.Append);
                     }
-                }
 
-                // Begin the rip
-                cddasrc ["track"] = trackIndex + 1;
-                pipeline.SetState (State.Playing);
-                timer.Start ();
+                    /*if (banshee_is_debugging ()) {
+                        bt_tag_list_dump (gst_tag_setter_get_tag_list (tag_setter));
+                    }*/
+
+                    // We'll warn the user in the UI if we can't tag the encoded audio files
+                    taggingSupported = true;
+                }
             }
+
+            // Begin the rip
+            cddasrc ["track"] = trackIndex + 1;
+            pipeline.SetState (State.Playing);
+            timer.Start ();
         }
 
         bool ConstructPipeline ()
@@ -241,7 +251,7 @@ namespace Banshee.GStreamerSharp
                 return false;
             }
 
-            cddasrc = ElementFactory.MakeFromUri (URIType.Src, "cdda://1", "cddasrc");
+            cddasrc = Element.MakeFromUri (URIType.Src, "cdda://1", "cddasrc");
             if (cddasrc == null) {
                 RaiseError (current_track, Catalog.GetString ("Could not initialize element from cdda URI"));
                 return false;
@@ -249,12 +259,12 @@ namespace Banshee.GStreamerSharp
 
             cddasrc ["device"] = device;
 
-            if (cddasrc.HasProperty ("paranoia-mode")) {
+            try {
                 cddasrc ["paranoia-mode"] = paranoia_mode;
-            }
+            } catch (Gst.PropertyNotFoundException) { }
 
             try {
-            encoder = (Bin)Parse.BinFromDescription (encoder_pipeline, true);
+                encoder = Parse.BinFromDescription (encoder_pipeline, true);
             } catch (Exception e) {
                 string err = Catalog.GetString ("Could not create encoder pipeline : {0}");
                 RaiseError (current_track, String.Format (err, e.Message));
@@ -267,7 +277,7 @@ namespace Banshee.GStreamerSharp
                 return false;
             }
 
-            queue ["max-size-time"] = 120 * Gst.Clock.Second;
+            queue ["max-size-time"] = 120L * Gst.Constants.SECOND;
 
             filesink = ElementFactory.Make ("filesink", "filesink");
             if (filesink == null) {
@@ -288,25 +298,22 @@ namespace Banshee.GStreamerSharp
 
         private string ProbeMimeType ()
         {
-            Iterator elem_iter = ((Bin)encoder).ElementsRecurse;
             string preferred_mimetype = null;
-            IEnumerator en = elem_iter.GetEnumerator ();
 
-            while (en.MoveNext ()) {
-                Element element = (Element)en.Current;
-                Iterator pad_iter = element.SrcPads;
+            foreach (Element element in encoder.IterateRecurse ()) {
+                Iterator pad_iter = element.IterateSrcPads ();
                 IEnumerator enu = pad_iter.GetEnumerator ();
 
                 while (enu.MoveNext ()) {
                     Pad pad = (Pad)enu.Current;
-                    Caps caps = pad.Caps;
+                    Caps caps = pad.QueryCaps ();
                     Structure str = (caps != null ? caps [0] : null);
 
                     if (str != null) {
                         string mimetype = str.Name;
                         int mpeg_layer;
 
-                        Gst.GLib.Value val = str.GetValue ("mpegversion");
+                        GLib.Value val = str.GetValue ("mpegversion");
 
                         // Prefer and adjust audio/mpeg, leaving MP3 as audio/mpeg
                         if (mimetype.StartsWith ("audio/mpeg")) {
@@ -371,10 +378,10 @@ namespace Banshee.GStreamerSharp
                     break;
 
                 case MessageType.Error:
-                    Enum error_type;
-                    string err_msg, debug;
-                    msg.ParseError (out error_type, out err_msg, out debug);
-                    RaiseError (current_track, String.Format ("{0} : {1}", err_msg, debug));
+                    GLib.GException err;
+                    string debug;
+                    msg.ParseError (out err, out debug);
+                    RaiseError (current_track, String.Format ("{0} : {1}", err.Message, debug));
                     timer.Stop ();
                     break;
             }
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/BpmDetector.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/BpmDetector.cs
index 05dcdb0..586ed2d 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/BpmDetector.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/BpmDetector.cs
@@ -1,10 +1,14 @@
 //
 // BpmDetector.cs
 //
-// Author:
+// Authors:
 //   Gabriel Burt <gburt novell com>
+//   Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
 // Copyright (C) 2008-2011 Novell, Inc.
+// Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -45,8 +49,6 @@ using Banshee.MediaEngine;
 using Banshee.ServiceStack;
 using Banshee.Configuration;
 using Banshee.Preferences;
-using Gst.CorePlugins;
-using Gst.BasePlugins;
 
 namespace Banshee.GStreamerSharp
 {
@@ -56,20 +58,20 @@ namespace Banshee.GStreamerSharp
         Dictionary<int, int> bpm_histogram = new Dictionary<int, int> ();
 
         Pipeline pipeline;
-        FileSrc filesrc;
-        FakeSink fakesink;
+        Element filesrc;
+        Element fakesink;
 
         public event BpmEventHandler FileFinished;
 
         public BpmDetector ()
         {
             try {
-                pipeline = new Pipeline ();
-                filesrc          = new FileSrc ();
-                var decodebin    = new DecodeBin2 ();
+                pipeline = new Pipeline ("the pipeline");
+                filesrc          = ElementFactory.Make ("filesrc", "the filesrc");
+                var decodebin    = ElementFactory.Make ("decodebin", "the decodebin");
                 var audioconvert = Make ("audioconvert");
                 var bpmdetect    = Make ("bpmdetect");
-                fakesink         = new FakeSink ();
+                fakesink         = ElementFactory.Make ("fakesink", "the fakesink");
 
                 pipeline.Add (filesrc, decodebin, audioconvert, bpmdetect, fakesink);
 
@@ -79,29 +81,28 @@ namespace Banshee.GStreamerSharp
                 }
 
                 // decodebin and audioconvert are linked dynamically when the decodebin creates a new pad
-                decodebin.NewDecodedPad += delegate(object o, DecodeBin2.NewDecodedPadArgs args) {
+                decodebin.PadAdded += (o,args) => {
                     var audiopad = audioconvert.GetStaticPad ("sink");
                     if (audiopad.IsLinked) {
                         return;
                     }
 
-                    using (var caps = args.Pad.Caps) {
-                        using (var str = caps[0]) {
-                            if (!str.Name.Contains ("audio"))
-                                return;
-                        }
-                    }
+                    var caps = args.NewPad.QueryCaps ();
+                    if (caps == null)
+                        return;
+
+                    var str = caps[0];
+                    if (!str.Name.Contains ("audio"))
+                        return;
 
-                    args.Pad.Link (audiopad);
+                    args.NewPad.Link (audiopad);
                 };
 
                 if (!Element.Link (audioconvert, bpmdetect, fakesink)) {
                     Log.Error ("Could not link pipeline elements");
                     throw new Exception ();
                 }
-
                 pipeline.Bus.AddWatch (OnBusMessage);
-                //gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (detector->pipeline)), 
bbd_pipeline_bus_callback, detector);
             } catch (Exception e) {
                 Log.Exception (e);
                 throw new ApplicationException (Catalog.GetString ("Could not create BPM detection 
driver."), e);
@@ -112,39 +113,39 @@ namespace Banshee.GStreamerSharp
         {
             switch (msg.Type) {
             case MessageType.Tag:
-                Pad pad;
-                TagList tag_list;
-                msg.ParseTag (out pad, out tag_list);
+                TagList tag_list = msg.ParseTag ();
 
                 foreach (var name in tag_list.Tags) {
                     if (name == "beats-per-minute") {
-                        if (tag_list.GetTagSize (name) < 1) continue;
-                        var tag = tag_list.GetTag (name);
-                        foreach (var val in tag) {
-                            if (val is double) {
-                                double bpm = (double)val;
-                                int rounded = (int) Math.Round (bpm);
-                                if (!bpm_histogram.ContainsKey(rounded)) {
-                                    bpm_histogram[rounded] = 1;
-                                } else {
-                                    bpm_histogram[rounded]++;
+                        if (tag_list.GetTagSize (name) < 1) {
+                            continue;
+                        }
+                        tag_list.Foreach (delegate(TagList list, string tagname) {
+                            for (uint i = 0; i < tag_list.GetTagSize (tagname); i++) {
+                                GLib.Value val = tag_list.GetValueIndex (tagname, i);
+                                if (val.Val is double) {
+                                    double bpm = (double)val;
+                                    int rounded = (int)Math.Round (bpm);
+                                    if (!bpm_histogram.ContainsKey (rounded)) {
+                                        bpm_histogram [rounded] = 1;
+                                    } else {
+                                        bpm_histogram [rounded]++;
+                                    }
                                 }
+                                val.Dispose ();
                             }
-                            break;
-                        }
+                        });
                     }
                 }
-
-                tag_list.Dispose ();
                 break;
 
             case MessageType.Error:
-                Enum error_type;
-                string err_msg, debug;
-                msg.ParseError (out error_type, out err_msg, out debug);
+                string debug;
+                GLib.GException error;
+                msg.ParseError (out error, out debug);
 
                 IsDetecting = false;
-                Log.ErrorFormat ("BPM Detection error", err_msg);
+                Log.ErrorFormat ("BPM Detection error: {0}", error.Message);
                 break;
 
             case MessageType.Eos:
@@ -197,7 +198,7 @@ namespace Banshee.GStreamerSharp
                 Log.DebugFormat ("GStreamer running beat detection on {0}", path);
                 IsDetecting = true;
                 fakesink.SetState (State.Null);
-                filesrc.Location = path;
+                filesrc ["location"] = path;
                 pipeline.SetState (State.Playing);
             } catch (Exception e) {
                 Log.Exception (e);
@@ -212,7 +213,7 @@ namespace Banshee.GStreamerSharp
 
         private static Gst.Element Make (string name)
         {
-            var e = ElementFactory.Make (name);
+            var e = ElementFactory.Make (name, "the " + name);
             if (e == null) {
                 Log.ErrorFormat ("BPM Detector unable to make element '{0}'", name);
                 throw new Exception ();
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/CddaManager.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/CddaManager.cs
index 94e9050..065af8e 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/CddaManager.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/CddaManager.cs
@@ -1,10 +1,14 @@
 //
 // CddaManager.cs
 //
-// Author:
+// Authors:
 //   Olivier Dufour <olivier duff gmail com>
+//   Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
-// Copyright 2011
+// Copyright (C) 2011 Olivier Dufour
+// Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -23,11 +27,11 @@
 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
+
 using System;
 
 using Gst;
-using Gst.Cdda;
-using Gst.BasePlugins;
+using Gst.Audio;
 
 using Hyena;
 
@@ -35,7 +39,7 @@ namespace Banshee.GStreamerSharp
 {
     public class CddaManager
     {
-        public CddaManager (PlayBin2 playbin)
+        public CddaManager (Element playbin)
         {
             if (playbin != null) {
                 playbin.AddNotification ("source", OnSourceChanged);
@@ -46,54 +50,53 @@ namespace Banshee.GStreamerSharp
             get; set;
         }
 
-        private CddaBaseSrc GetCddaSource (Element playbin)
+        private AudioCdSrc GetCddaSource (Element playbin)
         {
-            CddaBaseSrc source = null;
+            AudioCdSrc source = null;
 
             if (playbin == null) {
                 return null;
             }
 
-            source = playbin ["source"] as CddaBaseSrc;
+            source = playbin ["source"] as AudioCdSrc;
 
             return source;
         }
 
-        private void OnSourceChanged (object o, Gst.GLib.NotifyArgs args)
+        private void OnSourceChanged (object o, GLib.NotifyArgs args)
         {
             if (Device == null) {
                 return;
             }
+            var playbin = o as Element;
 
-            var cdda_src = GetCddaSource (o as PlayBin2);
+            var cdda_src = GetCddaSource (playbin);
             if (cdda_src == null) {
                 return;
             }
 
             // CddaBaseSrc elements should always have this property
-            if (cdda_src.HasProperty ("device")) {
-                Log.DebugFormat ("cdda: setting device property on source ({0})", Device);
-                cdda_src ["device"] = Device;
-            }
+            Log.DebugFormat ("cdda: setting device property on source ({0})", Device);
+            cdda_src ["device"] = Device;
 
             // If the GstCddaBaseSrc is cdparanoia, it will have this property, so set it
-            if (cdda_src.HasProperty ("paranoia-mode")) {
+            try {
                 cdda_src ["paranoia-mode"] = 0;
-            }
+            } catch (Gst.PropertyNotFoundException) { }
         }
 
-        bool SeekToTrack (PlayBin2 playbin, int track)
+        bool SeekToTrack (Element playbin, int track)
         {
             Format format = Format.Undefined;
-            CddaBaseSrc cdda_src = null;
-            State state;
+            Element cdda_src = null;
+            State state, pending;
 
             format = Util.FormatGetByNick ("track");
             if (format == Format.Undefined) {
                 return false;
             }
 
-            playbin.GetState (out state, 0);
+            playbin.GetState (out state, out pending, 0);
             if (state < State.Paused) {
                 // We can only seek if the pipeline is playing or paused, otherwise
                 // we just allow playbin to do its thing, which will re-start the
@@ -115,7 +118,7 @@ namespace Banshee.GStreamerSharp
             return false;
         }
 
-        public bool HandleURI (PlayBin2 playbin, string uri)
+        public bool HandleURI (Element playbin, string uri)
         {
             // Processes URIs like cdda://<track-number>#<device-node> and overrides
             // track transitioning through playbin if playback was already happening
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/DvdManager.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/DvdManager.cs
index 951ecea..3448e05 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/DvdManager.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/DvdManager.cs
@@ -1,10 +1,14 @@
 //
 // DvdManager.cs
 //
-// Author:
+// Authors:
 //   Olivier Dufour <olivier duff gmail com>
+//   Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
-// Copyright 2011 Olivier Dufour
+// Copyright (C) 2011 Olivier Dufour
+// Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -26,9 +30,7 @@
 using System;
 
 using Gst;
-using Gst.BasePlugins;
-using Gst.Cdda;
-using Gst.Interfaces;
+using Gst.Video;
 
 using Hyena;
 
@@ -36,14 +38,14 @@ namespace Banshee.GStreamerSharp
 {
     public class DvdManager
     {
-        public DvdManager (PlayBin2 playbin)
+        public DvdManager (Element playbin)
         {
             if (playbin != null) {
                 playbin.AddNotification ("source", OnSourceChanged);
             }
         }
 
-        Navigation Navigation {
+        INavigation Navigation {
             get; set;
         }
 
@@ -68,25 +70,24 @@ namespace Banshee.GStreamerSharp
             return source;
         }
 
-        private void OnSourceChanged (object o, Gst.GLib.NotifyArgs args)
+        private void OnSourceChanged (object o, GLib.NotifyArgs args)
         {
             if (Device == null) {
                 return;
             }
 
-            var dvd_src = GetDvdSource (o as PlayBin2);
+            var playbin = o as Element;
+            var dvd_src = GetDvdSource (playbin);
             if (dvd_src == null) {
                 return;
             }
 
             // dvd source elements should always have this property
-            if (dvd_src.HasProperty ("device")) {
-                Log.DebugFormat ("dvd: setting device property on source ({0})", Device);
-                dvd_src ["device"] = Device;
-            }
+            dvd_src ["device"] = Device;
+            Log.DebugFormat ("dvd: setting device property on source ({0})", Device);
         }
 
-        public bool HandleURI (PlayBin2 playbin, string uri)
+        public bool HandleURI (Element playbin, string uri)
         {
             // Processes URIs like dvd://<device-node> and overrides
             // track transitioning through playbin if playback was already happening
@@ -132,17 +133,18 @@ namespace Banshee.GStreamerSharp
             return false;
         }
 
-        public void HandleCommandsChanged (PlayBin2 playbin)
+        public void HandleCommandsChanged (Element playbin)
         {
             InDvdMenu = false;
             // Get available command to know if player is in menu
-            Gst.Query query = NavigationQuery.NewCommands ();
+            // FIXME: GlobalVideo should be Gst.Video.Global
+            Gst.Query query = GlobalVideo.NavigationQueryNewCommands ();
 
             NavigationCommand[] cmds;
             if (Navigation == null) {
                 FindNavigation (playbin);
             }
-            if (!(((Element)Navigation).Query (query) && NavigationQuery.ParseCommands (query, out cmds))) {
+            if (!(((Element)Navigation).Query (query) && NavigationAdapter.ParseCommands (query, out cmds))) 
{
                 return;
             }
             foreach (NavigationCommand cmd in cmds) {
@@ -160,11 +162,11 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void FindNavigation (PlayBin2 playbin)
+        public void FindNavigation (Element playbin)
         {
             Element video_sink = null;
             Element navigation = null;
-            Navigation previous_navigation;
+            INavigation previous_navigation;
 
             previous_navigation = Navigation;
             video_sink = playbin ["video-sink"] as Element;
@@ -177,14 +179,13 @@ namespace Banshee.GStreamerSharp
             }
 
             navigation = (video_sink is Bin)
-                ? ((Bin)video_sink).GetByInterface (typeof (NavigationAdapter))
+                ? ((Bin)video_sink).GetByInterface (NavigationAdapter.GType)
                 : video_sink;
 
-            Navigation = navigation as Navigation;
-
+            Navigation = navigation as INavigation;
         }
 
-        public void NotifyMouseMove (PlayBin2 playbin, double x, double y)
+        public void NotifyMouseMove (Element playbin, double x, double y)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -194,7 +195,7 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void NotifyMouseButtonPressed (PlayBin2 playbin, int button, double x, double y)
+        public void NotifyMouseButtonPressed (Element playbin, int button, double x, double y)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -204,7 +205,7 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void NotifyMouseButtonReleased (PlayBin2 playbin, int button, double x, double y)
+        public void NotifyMouseButtonReleased (Element playbin, int button, double x, double y)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -214,7 +215,7 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void NavigateToLeftMenu (PlayBin2 playbin)
+        public void NavigateToLeftMenu (Element playbin)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -224,7 +225,7 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void NavigateToRightMenu (PlayBin2 playbin)
+        public void NavigateToRightMenu (Element playbin)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -234,7 +235,7 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void NavigateToUpMenu (PlayBin2 playbin)
+        public void NavigateToUpMenu (Element playbin)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -244,7 +245,7 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void NavigateToDownMenu (PlayBin2 playbin)
+        public void NavigateToDownMenu (Element playbin)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -254,17 +255,18 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void NavigateToMenu (PlayBin2 playbin)
+        public void NavigateToMenu (Element playbin)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
             }
             if (Navigation != null) {
-                Navigation.SendCommand (NavigationCommand.DvdMenu);
+                // Menu1 == DvdMenu 
http://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/gst-libs/gst/video/navigation.h?h=1.0#n96 
+                Navigation.SendCommand (NavigationCommand.Menu1);
             }
         }
 
-        public void ActivateCurrentMenu (PlayBin2 playbin)
+        public void ActivateCurrentMenu (Element playbin)
         {
             if (Navigation == null) {
                 FindNavigation (playbin);
@@ -274,19 +276,19 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        public void GoToNextChapter (PlayBin2 playbin)
+        public void GoToNextChapter (Element playbin)
         {
             long index;
             Format format = Util.FormatGetByNick ("chapter");
-            playbin.QueryPosition (ref format, out index);
+            playbin.QueryPosition (format, out index);
             playbin.Seek (1.0, format, SeekFlags.Flush, SeekType.Set, index + 1, SeekType.None, 0L);
         }
 
-        public void GoToPreviousChapter (PlayBin2 playbin)
+        public void GoToPreviousChapter (Element playbin)
         {
             long index;
             Format format = Util.FormatGetByNick ("chapter");
-            playbin.QueryPosition (ref format, out index);
+            playbin.QueryPosition (format, out index);
             playbin.Seek (1.0, format, SeekFlags.Flush, SeekType.Set, index - 1, SeekType.None, 0L);
         }
     }
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/GstExtensions.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/GstExtensions.cs
new file mode 100644
index 0000000..07a74b6
--- /dev/null
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/GstExtensions.cs
@@ -0,0 +1,51 @@
+//
+// GstExtensions.cs
+//
+// Author:
+//   Andrés G. Aragoneses <knocte gmail com>
+//
+// Copyright 2013 Andrés G. Aragoneses
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using Gst;
+
+namespace Banshee.GStreamerSharp
+{
+    internal static class GstExtensions
+    {
+        internal static uint AddWatch (this Bus bus, BusFunc func)
+        {
+            //https://developer.gnome.org/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-DEFAULT:CAPS
+            int G_PRIORITY_DEFAULT = 0;
+            //FIXME: use AddWatch() when it is bindable
+            return bus.AddWatchFull (G_PRIORITY_DEFAULT, func);
+            //gst_bus_add_watch (gst_pipeline_get_bus (GST_PIPELINE (detector->pipeline)), 
bbd_pipeline_bus_callback, detector);
+        }
+
+        //TODO: use Add(params..) from the binding when it's available
+        internal static void Add (this Bin sink, params Element[] elements)
+        {
+            foreach (var elt in elements) {
+                sink.Add (elt);
+            }
+        }
+    }
+}
+
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
index 55b63ac..d73eb6c 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
@@ -1,10 +1,14 @@
 //
 // PlayerEngine.cs
 //
-// Author:
+// Authors:
 //   Gabriel Burt <gburt novell com>
+//   Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
 // Copyright (C) 2010 Novell, Inc.
+// Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -37,9 +41,6 @@ using Mono.Unix;
 
 using Gst;
 using Gst.PbUtils;
-using Gst.BasePlugins;
-using Gst.CorePlugins;
-using Gst.Interfaces;
 
 using Hyena;
 using Hyena.Data;
@@ -51,12 +52,13 @@ using Banshee.MediaEngine;
 using Banshee.ServiceStack;
 using Banshee.Configuration;
 using Banshee.Preferences;
+using Gst.Video;
 
 namespace Banshee.GStreamerSharp
 {
     public class PlayerEngine : Banshee.MediaEngine.PlayerEngine, IEqualizer, IVisualizationDataSource
     {
-        private class AudioSinkBin : Bin
+        internal class AudioSinkBin : Bin
         {
             Element hw_audio_sink;
             Element volume;
@@ -65,7 +67,7 @@ namespace Banshee.GStreamerSharp
             Element preamp;
             Element first;
             GhostPad visible_sink;
-            Tee audiotee;
+            Element audiotee;
             object pipeline_lock = new object ();
 
             public AudioSinkBin (IntPtr o) : base(o)
@@ -80,7 +82,7 @@ namespace Banshee.GStreamerSharp
                 first = hw_audio_sink;
 
                 // Our audio sink is a tee, so plugins can attach their own pipelines
-                audiotee = ElementFactory.Make ("tee", "audiotee") as Tee;
+                audiotee = ElementFactory.Make ("tee", "audiotee");
                 if (audiotee == null) {
                     Log.Error ("Can not create audio tee!");
                 } else {
@@ -101,12 +103,14 @@ namespace Banshee.GStreamerSharp
                 }
 
                 equalizer = ElementFactory.Make ("equalizer-10bands", "equalizer-10bands");
+
                 if (equalizer != null) {
                     Element eq_audioconvert = ElementFactory.Make ("audioconvert", "audioconvert");
                     Element eq_audioconvert2 = ElementFactory.Make ("audioconvert", "audioconvert2");
                     preamp = ElementFactory.Make ("volume", "preamp");
 
-                    Add (eq_audioconvert, preamp, equalizer, eq_audioconvert2);
+                    this.Add (eq_audioconvert, preamp, equalizer, eq_audioconvert2);
+
                     Element.Link (eq_audioconvert, preamp, equalizer, eq_audioconvert2, first);
 
                     first = eq_audioconvert;
@@ -116,7 +120,7 @@ namespace Banshee.GStreamerSharp
                 // Link the first tee pad to the primary audio sink queue
                 Pad sinkpad = first.GetStaticPad ("sink");
                 Pad pad = RequestTeePad ();
-                audiotee.AllocPad = pad;
+                audiotee["alloc-pad"] = pad;
                 pad.Link (sinkpad);
                 first = audiotee;
 
@@ -132,18 +136,21 @@ namespace Banshee.GStreamerSharp
                 // the Ready state before they'll contain an actual sink.
                 sink.SetState (State.Ready);
 
-                if (sink.HasProperty ("volume")) {
+                try {
+                    var volume = sink ["volume"];
                     volumeProvider = sink;
-                    Log.DebugFormat ("Sink {0} has native volume.", volumeProvider.Name);
-                } else {
+                    Log.DebugFormat ("Sink {0} has native volume: {1}", volumeProvider.Name, volume);
+                } catch (Gst.PropertyNotFoundException) {
                     var sinkBin = sink as Bin;
                     if (sinkBin != null) {
-                        foreach (Element e in sinkBin.ElementsRecurse) {
-                            if (e.HasProperty ("volume")) {
+                        foreach (Element e in sinkBin.IterateRecurse ()) {
+                            try {
+                                var volume = e ["volume"];
                                 volumeProvider = e;
-                                Log.DebugFormat ("Found volume provider {0} in {1}.",
-                                    volumeProvider.Name, sink.Name);
-                            }
+                                Log.DebugFormat ("Found volume provider {0} in {1}: {2}",
+                                    volumeProvider.Name, sink.Name, volume);
+                                break;
+                            } catch (Gst.PropertyNotFoundException) { }
                         }
                     }
                 }
@@ -178,16 +185,16 @@ namespace Banshee.GStreamerSharp
                 get { return rgvolume != null; }
                 set {
                     if (value && rgvolume == null) {
-                        visible_sink.SetBlocked (true, InsertReplayGain);
+                        visible_sink.AddProbe (PadProbeType.Idle, InsertReplayGain);
                         Log.Debug ("Enabled ReplayGain volume scaling.");
                     } else if (!value && rgvolume != null) {
-                        visible_sink.SetBlocked (false, RemoveReplayGain);
+                        visible_sink.AddProbe (PadProbeType.Idle, RemoveReplayGain);
                         Log.Debug ("Disabled ReplayGain volume scaling.");
                     }
                 }
             }
 
-            void InsertReplayGain (Pad pad, bool blocked)
+            PadProbeReturn InsertReplayGain (Pad pad, PadProbeInfo info)
             {
                 lock (pipeline_lock) {
                     if (rgvolume == null) {
@@ -199,10 +206,10 @@ namespace Banshee.GStreamerSharp
                         first = rgvolume;
                     }
                 }
-                visible_sink.SetBlocked (false, (_, __) => { });
+                return PadProbeReturn.Remove;
             }
 
-            void RemoveReplayGain (Pad pad, bool blocked)
+            PadProbeReturn RemoveReplayGain (Pad pad, PadProbeInfo info)
             {
                 lock (pipeline_lock) {
                     if (rgvolume != null) {
@@ -214,7 +221,7 @@ namespace Banshee.GStreamerSharp
                         visible_sink.SetTarget (first.GetStaticPad ("sink"));
                     }
                 }
-                visible_sink.SetBlocked (false, (_, __) => { });
+                return PadProbeReturn.Remove;
             }
 
 
@@ -240,11 +247,17 @@ namespace Banshee.GStreamerSharp
 
             public int [] BandRange {
                 get {
+                    // 
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-equalizer-10bands.html#GstIirEqualizer10Bands--band0
+                    return new [] { -24, 12 };
+
+                    /* TODO: should we check for band0::gain like it was done before? if yes, use 
paramspec.min|max retrieval
                     int min = -1;
                     int max = -1;
 
+                    
//http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-equalizer-10bands.html
                     PropertyInfo pspec = new PropertyInfo();
 
+
                     if (equalizer.HasProperty ("band0::gain")) {
                         pspec = equalizer.GetPropertyInfo ("band0::gain");
                     } else if (equalizer.HasProperty ("band0")) {
@@ -255,8 +268,7 @@ namespace Banshee.GStreamerSharp
                         min = (int)((double)pspec.Min);
                         max = (int)((double)pspec.Max);
                     }
-
-                    return new int [] { min, max };
+                    */
                 }
             }
 
@@ -275,9 +287,9 @@ namespace Banshee.GStreamerSharp
                     uint[] ret = new uint[count];
 
                     if (equalizer != null) {
-                        ChildProxy equalizer_child_proxy = ChildProxyAdapter.GetObject (equalizer);
+                        IChildProxy equalizer_child_proxy = ChildProxyAdapter.GetObject (equalizer);
                         for (uint i = 0; i < count; i++) {
-                            Gst.Object band = equalizer_child_proxy.GetChildByIndex (i);
+                            Gst.Object band = (Gst.Object)equalizer_child_proxy.GetChildByIndex (i);
                             ret [i] = (uint)(double)band ["freq"];
                         }
                     }
@@ -292,14 +304,14 @@ namespace Banshee.GStreamerSharp
                     if (band >= GetNBands ()) {
                         throw new ArgumentOutOfRangeException ("band", "Attempt to set out-of-range 
equalizer band");
                     }
-                    Gst.Object the_band = ChildProxyAdapter.GetObject (equalizer).GetChildByIndex (band);
+                    Gst.Object the_band = (Gst.Object)ChildProxyAdapter.GetObject 
(equalizer).GetChildByIndex (band);
                     the_band ["gain"] = value;
                 }
             }
 
             public Pad RequestTeePad ()
             {
-                var pad = audiotee.GetRequestPad ("src%d");
+                var pad = audiotee.GetRequestPad ("src_%u");
                 if (pad == null) {
                     throw new InvalidOperationException ("Could not retrieve tee pad");
                 }
@@ -308,7 +320,7 @@ namespace Banshee.GStreamerSharp
         }
 
 
-        PlayBin2 playbin;
+        Element playbin;
         AudioSinkBin audio_sink;
         uint iterate_timeout_id = 0;
         List<string> missing_details = new List<string> ();
@@ -342,7 +354,7 @@ namespace Banshee.GStreamerSharp
             }
 
             Gst.Application.Init ();
-            playbin = new PlayBin2 ();
+            playbin = ElementFactory.Make ("playbin", "the playbin");
 
             next_track_set = new ManualResetEvent (false);
 
@@ -355,12 +367,11 @@ namespace Banshee.GStreamerSharp
                 Volume = (ushort)PlayerEngineService.VolumeSchema.Get ();
             }
 
-            Pad teepad = audio_sink.RequestTeePad ();
-            visualization = new Visualization (audio_sink, teepad);
+            visualization = new Visualization (audio_sink);
 
             playbin.AddNotification ("volume", OnVolumeChanged);
             playbin.Bus.AddWatch (OnBusMessage);
-            playbin.AboutToFinish += OnAboutToFinish;
+            playbin.Connect ("about-to-finish", OnAboutToFinish);
 
             cdda_manager = new CddaManager (playbin);
             dvd_manager = new DvdManager (playbin);
@@ -417,7 +428,7 @@ namespace Banshee.GStreamerSharp
             OnEventChanged (PlayerEvent.PrepareVideoWindow);
         }
 
-        void OnAboutToFinish (object o, Gst.GLib.SignalArgs args)
+        void OnAboutToFinish (object o, GLib.SignalArgs args)
         {
             // This is needed to make Shuffle-by-* work.
             // Shuffle-by-* uses the LastPlayed field to determine what track in the grouping to play next.
@@ -451,7 +462,7 @@ namespace Banshee.GStreamerSharp
                 return;
             }
 
-            playbin.Uri = uri.AbsoluteUri;
+            playbin ["uri"] = uri.AbsoluteUri;
 
             if (maybeVideo) {
                 LookupForSubtitle (uri);
@@ -466,8 +477,7 @@ namespace Banshee.GStreamerSharp
             if (accurate_seek) {
                 seek_flags |= SeekFlags.Accurate;
             }
-               
-            playbin.Seek (Format.Time, seek_flags, (long)(position * Gst.Clock.MSecond));
+            playbin.SeekSimple (Format.Time, seek_flags, (((long)position) * Constants.MSECOND));
             OnEventChanged (PlayerEvent.Seek);
         }
 
@@ -490,30 +500,27 @@ namespace Banshee.GStreamerSharp
                     break;
 
                 case MessageType.Buffering:
-                    int buffer_percent;
-                    msg.ParseBuffering (out buffer_percent);
+                    int buffer_percent = msg.ParseBuffering ();
                     HandleBuffering (buffer_percent);
                     break;
 
                 case MessageType.Tag:
-                    Pad pad;
-                    TagList tag_list;
-                    msg.ParseTag (out pad, out tag_list);
-
-                    HandleTag (pad, tag_list);
+                    TagList tag_list = msg.ParseTag ();
+                    tag_list.Foreach (HandleTag);
                     break;
 
                 case MessageType.Error:
-                    Enum error_type;
-                    string err_msg, debug;
-                    msg.ParseError (out error_type, out err_msg, out debug);
+                    GLib.GException err;
+                    string debug;
+                    msg.ParseError (out err, out debug);
 
-                    HandleError (error_type, err_msg, debug);
+                    HandleError (err);
                     break;
 
                 case MessageType.Element:
-                    if (MissingPluginMessage.IsMissingPluginMessage (msg)) {
-                        string detail = MissingPluginMessage.GetInstallerDetail (msg);
+
+                    if (GlobalPbUtil.IsMissingPluginMessage (msg)) {
+                        string detail = GlobalPbUtil.MissingPluginMessageGetInstallerDetail (msg);
 
                         if (detail == null)
                             return false;
@@ -526,16 +533,19 @@ namespace Banshee.GStreamerSharp
                         Log.DebugFormat ("Saving missing element details ('{0}')", detail);
                         missing_details.Add (detail);
 
-                        Log.Error ("Missing GStreamer Plugin", MissingPluginMessage.GetDescription (msg), 
true);
+                        Log.Error ("Missing GStreamer Plugin", 
GlobalPbUtil.MissingPluginMessageGetDescription (msg), true);
 
                         InstallPluginsContext install_context = new InstallPluginsContext ();
-                        Install.InstallPlugins (missing_details.ToArray (), install_context, 
OnInstallPluginsReturn);
-                    } else if (msg.Src == playbin && msg.Structure.Name == "playbin2-stream-changed") {
-                        HandleStreamChanged ();
-                    } else if (NavigationMessage.MessageGetType (msg) == 
NavigationMessageType.CommandsChanged) {
+                        GlobalPbUtil.InstallPluginsAsync (missing_details.ToArray (), install_context, 
OnInstallPluginsReturn);
+                    } else if (NavigationAdapter.MessageGetType (msg) == 
NavigationMessageType.CommandsChanged) {
                         dvd_manager.HandleCommandsChanged (playbin);
                     }
                     break;
+
+                case MessageType.StreamStart:
+                    HandleStreamStart ();
+                    break;
+
                 case MessageType.Application:
                     string name;
                     Structure s = msg.Structure;
@@ -556,12 +566,12 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        private void OnVolumeChanged (object o, Gst.GLib.NotifyArgs args)
+        private void OnVolumeChanged (object o, GLib.NotifyArgs args)
         {
             OnEventChanged (PlayerEvent.Volume);
         }
 
-        private void HandleStreamChanged ()
+        private void HandleStreamStart ()
         {
             // Set the current track as fully played before signaling EndOfStream.
             ServiceManager.PlayerEngine.IncrementLastPlayed (1.0);
@@ -569,15 +579,15 @@ namespace Banshee.GStreamerSharp
             OnEventChanged (PlayerEvent.StartOfStream);
         }
 
-        private void HandleError (Enum domain, string error_message, string debug)
+        private void HandleError (GLib.GException ex)
         {
             TrackInfo failed_track = CurrentTrack;
             Close (true);
 
-            error_message = error_message ?? Catalog.GetString ("Unknown Error");
+            var error_message = String.IsNullOrEmpty (ex.Message) ? Catalog.GetString ("Unknown Error") : 
ex.Message;
 
-            if (domain is ResourceError) {
-                ResourceError domain_code = (ResourceError)domain;
+            if (ex.Domain == Global.ResourceErrorQuark ()) {
+                ResourceError domain_code = (ResourceError)ex.Code;
                 if (failed_track != null) {
                     switch (domain_code) {
                     case ResourceError.NotFound:
@@ -588,8 +598,8 @@ namespace Banshee.GStreamerSharp
                     }
                 }
                 Log.Error (String.Format ("GStreamer resource error: {0}", domain_code), false);
-            } else if (domain is StreamError) {
-                StreamError domain_code = (StreamError)domain;
+            } else if (ex.Domain == Global.StreamErrorQuark ()) {
+                StreamError domain_code = (StreamError)ex.Code;
                 if (failed_track != null) {
                     switch (domain_code) {
                     case StreamError.CodecNotFound:
@@ -601,8 +611,8 @@ namespace Banshee.GStreamerSharp
                 }
 
                 Log.Error (String.Format ("GStreamer stream error: {0}", domain_code), false);
-            } else if (domain is CoreError) {
-                CoreError domain_code = (CoreError)domain;
+            } else if (ex.Domain == Global.CoreErrorQuark ()) {
+                CoreError domain_code = (CoreError)ex.Code;
                 if (failed_track != null) {
                     switch (domain_code) {
                     case CoreError.MissingPlugin:
@@ -614,10 +624,10 @@ namespace Banshee.GStreamerSharp
                 }
 
                 if (domain_code != CoreError.MissingPlugin) {
-                    Log.Error (String.Format ("GStreamer core error: {0}", (CoreError)domain), false);
+                    Log.Error (String.Format ("GStreamer core error: {0}", domain_code), false);
                 }
-            } else if (domain is LibraryError) {
-                Log.Error (String.Format ("GStreamer library error: {0}", (LibraryError)domain), false);
+            } else if (ex.Domain == Global.LibraryErrorQuark ()) {
+                Log.Error (String.Format ("GStreamer library error: {0}", ex.Code), false);
             }
 
             OnEventChanged (new PlayerEventErrorArgs (error_message));
@@ -644,22 +654,13 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        private void HandleTag (Pad pad, TagList tag_list)
+        private void HandleTag (TagList tag_list, string tagname)
         {
-            foreach (string tag in tag_list.Tags) {
-                if (String.IsNullOrEmpty (tag)) {
-                    continue;
-                }
-
-                if (tag_list.GetTagSize (tag) < 1) {
-                    continue;
-                }
-
-                List tags = tag_list.GetTag (tag);
-
-                foreach (object o in tags) {
-                    OnTagFound (new StreamTag () { Name = tag, Value = o });
-                }
+            for (uint i = 0; i < tag_list.GetTagSize (tagname); i++) {
+                GLib.Value val = tag_list.GetValueIndex (tagname, i);
+                Log.Debug ("Found Tag: " + tagname + " Value: " + val.Val);
+                OnTagFound (new StreamTag () { Name = tagname, Value = val.Val });
+                val.Dispose ();
             }
         }
 
@@ -703,7 +704,7 @@ namespace Banshee.GStreamerSharp
                 playbin.SetState (Gst.State.Ready);
             }
 
-            playbin.Uri = uri.AbsoluteUri;
+            playbin ["uri"] = uri.AbsoluteUri;
             if (maybeVideo) {
                 // Lookup for subtitle files with same name/folder
                 LookupForSubtitle (uri);
@@ -716,10 +717,10 @@ namespace Banshee.GStreamerSharp
             SafeUri suburi;
             int dot;
             // Always enable rendering of subtitles
-            int flags;
-            flags = (int)playbin.Flags;
+            uint flags;
+            flags = (uint)playbin["flags"];
             flags |= (1 << 2);//GST_PLAY_FLAG_TEXT
-            playbin.Flags = (ObjectFlags)flags;
+            playbin ["flags"] = flags;
 
             Log.Debug ("[subtitle]: looking for subtitles for video file");
             scheme = uri.Scheme;
@@ -739,7 +740,7 @@ namespace Banshee.GStreamerSharp
                 suburi = new SafeUri (subfile);
                 if (Banshee.IO.File.Exists (suburi)) {
                     Log.DebugFormat ("[subtitle]: Found subtitle file: {0}", subfile);
-                    playbin.Suburi = subfile;
+                    playbin ["suburi"] = subfile;
                     return;
                 }
             }
@@ -765,10 +766,19 @@ namespace Banshee.GStreamerSharp
 
         public override string GetSubtitleDescription (int index)
         {
-            return playbin.GetTextTags (index)
-             .GetTag (Gst.Tag.LanguageCode)
-             .Cast<string> ()
-             .FirstOrDefault (t => t != null);
+            var list = (TagList)playbin.Emit ("get-text-tags", new object[] { index });
+
+            if (list == null)
+                return String.Empty;
+
+            string code;
+            if (!list.GetString (Constants.TAG_LANGUAGE_CODE, out code))
+                return String.Empty;
+
+            var name = Gst.Tags.GlobalTag.TagGetLanguageName (code);
+            Log.Debug ("Subtitle language code " + code + " resolved to " + name);
+
+            return name;
         }
 
         public override ushort Volume {
@@ -790,8 +800,8 @@ namespace Banshee.GStreamerSharp
         public override uint Position {
             get {
                 long pos;
-                playbin.QueryPosition (ref query_format, out pos);
-                return (uint) ((ulong)pos / Gst.Clock.MSecond);
+                playbin.QueryPosition (query_format, out pos);
+                return (uint) ((ulong)pos / Constants.MSECOND);
             }
             set { Seek (value); }
         }
@@ -799,8 +809,8 @@ namespace Banshee.GStreamerSharp
         public override uint Length {
             get {
                 long duration;
-                playbin.QueryDuration (ref query_format, out duration);
-                return (uint) ((ulong)duration / Gst.Clock.MSecond);
+                playbin.QueryDuration (query_format, out duration);
+                return (uint) ((ulong)duration / Constants.MSECOND);
             }
         }
 
@@ -871,7 +881,7 @@ namespace Banshee.GStreamerSharp
         }
 
         public override int SubtitleCount {
-            get { return playbin.NText; }
+            get { return (int)playbin ["n-text"]; }
         }
 
         public override int SubtitleIndex {
@@ -882,11 +892,11 @@ namespace Banshee.GStreamerSharp
 
                 if (value == -1) {
                     flags &= ~(1 << 2);//GST_PLAY_FLAG_TEXT
-                    playbin.Flags = (ObjectFlags)flags;
+                    playbin ["flags"] = flags;
                 } else {
                     flags |= (1 << 2);//GST_PLAY_FLAG_TEXT
-                    playbin.Flags = (ObjectFlags)flags;
-                    playbin.CurrentText = value;
+                    playbin ["flags"] = flags;
+                    playbin ["current-text"] = value;
                 }
             }
         }
@@ -894,32 +904,32 @@ namespace Banshee.GStreamerSharp
         public override SafeUri SubtitleUri {
             set {
                 long pos = -1;
-                State state;
+                State state, pending;
                 Format format = Format.Bytes;
                 bool paused = false;
 
                 // GStreamer playbin does not support setting the suburi during playback
                 // so we have to stop/play and seek
-                playbin.GetState (out state, 0);
+                playbin.GetState (out state, out pending, 0);
                 paused = (state == State.Paused);
                 if (state >= State.Paused) {
-                    playbin.QueryPosition (ref format, out pos);
+                    playbin.QueryPosition (format, out pos);
                     playbin.SetState (State.Ready);
                     // Wait for the state change to complete
-                    playbin.GetState (out state, 0);
+                    playbin.GetState (out state, out pending, 0);
                 }
 
-                playbin.Suburi = value.AbsoluteUri;
+                playbin ["suburi"] = value.AbsoluteUri;
                 playbin.SetState (paused ? State.Paused : State.Playing);
 
                 // Wait for the state change to complete
-                playbin.GetState (out state, 0);
+                playbin.GetState (out state, out pending, 0);
 
                 if (pos != -1) {
-                    playbin.Seek (format, SeekFlags.Flush | SeekFlags.KeyUnit, pos);
+                    playbin.SeekSimple (format, SeekFlags.Flush | SeekFlags.KeyUnit, pos);
                 }
             }
-            get { return new SafeUri (playbin.Suburi); }
+            get { return new SafeUri ((string)playbin ["suburi"]); }
         }
 
 #region DVD support
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Transcoder.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Transcoder.cs
index 0836655..6ffca34 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Transcoder.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Transcoder.cs
@@ -1,11 +1,15 @@
 //
 // Transcoder.cs
 //
-// Author:
+// Authors:
 //   Aaron Bockover <abockover novell com>
-//  Olivier Dufour <olivier duff gmail com>
+//   Olivier Dufour <olivier duff gmail com>
+//   Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
 // Copyright (C) 2008 Novell, Inc.
+// Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -58,7 +62,7 @@ namespace Banshee.GStreamerSharp
                 Element resample_elem;
                 Pad encoder_pad;
 
-                sink_elem = ElementFactory.MakeFromUri (URIType.Sink, output_uri, "sink");
+                sink_elem = Element.MakeFromUri (URIType.Sink, output_uri, "sink");
                 if (sink_elem == null) {
                     throw new Exception (Catalog.GetString ("Could not create sink element"));
                 }
@@ -85,7 +89,7 @@ namespace Banshee.GStreamerSharp
                     throw new Exception (Catalog.GetString ("Could not get sink pad from encoder"));
                 }
 
-                Add (conv_elem, resample_elem, encoder_elem, sink_elem);
+                this.Add (conv_elem, resample_elem, encoder_elem, sink_elem);
                 Element.Link (conv_elem, resample_elem, encoder_elem, sink_elem);
 
                 AddPad (new GhostPad ("sink", encoder_pad));
@@ -118,8 +122,8 @@ namespace Banshee.GStreamerSharp
             Format format = Format.Time;
             long position, duration;
 
-            if (!pipeline.QueryDuration (ref format, out duration) ||
-                !sink_bin.QueryPosition (ref format, out position)) {
+            if (!pipeline.QueryDuration (format, out duration) ||
+                !sink_bin.QueryPosition (format, out position)) {
                 return;
             }
 
@@ -176,15 +180,15 @@ namespace Banshee.GStreamerSharp
 
             pipeline = new Gst.Pipeline ("pipeline");
 
-            source_elem = ElementFactory.MakeFromUri (URIType.Src, current_track.Uri.AbsoluteUri, "source");
+            source_elem = Element.MakeFromUri (URIType.Src, current_track.Uri.AbsoluteUri, "source");
             if (source_elem == null) {
                 RaiseError (current_track, Catalog.GetString ("Could not create source element"));
                 return false;
             }
 
-            decoder_elem = ElementFactory.Make ("decodebin2", "decodebin2");
+            decoder_elem = ElementFactory.Make ("decodebin", "the decodebin");
             if (decoder_elem == null) {
-                RaiseError (current_track, Catalog.GetString ("Could not create decodebin2 plugin"));
+                RaiseError (current_track, Catalog.GetString ("Could not create decodebin plugin"));
                 return false;
             }
 
@@ -212,7 +216,6 @@ namespace Banshee.GStreamerSharp
 
         private void OnPadAdded (object sender, PadAddedArgs args)
         {
-            Caps caps;
             Structure str;
             Pad audiopad;
 
@@ -222,14 +225,14 @@ namespace Banshee.GStreamerSharp
                 return;
             }
 
-            caps = args.Pad.Caps;
+            Caps caps = args.NewPad.Caps;
             str = caps [0];
 
             if(!str.Name.Contains ("audio")) {
                 return;
             }
-           
-            args.Pad.Link (audiopad);
+
+            args.NewPad.Link (audiopad);
         }
 
         private bool OnBusMessage (Bus bus, Message msg)
@@ -244,12 +247,12 @@ namespace Banshee.GStreamerSharp
                     break;
 
                 case MessageType.Error:
-                    Enum error_type;
-                    string err_msg, debug;
+                    GLib.GException ex;
+                    string debug;
                     is_transcoding = false;
                     timer.Stop ();
-                    msg.ParseError (out error_type, out err_msg, out debug);
-                    RaiseError (current_track, String.Format ("{0} : {1}", err_msg, debug));
+                    msg.ParseError (out ex, out debug);
+                    RaiseError (current_track, String.Format ("{0} : {1}", ex.Message, debug));
                     timer.Stop ();
                     break;
 
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/VideoManager.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/VideoManager.cs
index 6f2c243..aba78a6 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/VideoManager.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/VideoManager.cs
@@ -4,9 +4,11 @@
 // Authors:
 //  Olivier Dufour <olivier duff gmail com>
 //  Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
 // Copyright (C) 2011 Olivier Dufour
 // Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -41,21 +43,20 @@ using Banshee.MediaProfiles;
 using Banshee.Configuration.Schema;
 
 using Gst;
-using Gst.BasePlugins;
-using Gst.Interfaces;
+using Gst.Video;
 
 namespace Banshee.GStreamerSharp
 {
     public class VideoManager
     {
-        PlayBin2 playbin;
+        Element playbin;
         VideoDisplayContextType video_display_context_type;
         IntPtr video_window;
         ulong? video_window_xid;
-        XOverlayAdapter xoverlay;
+        VideoOverlayAdapter xoverlay;
         object video_mutex = new object ();
 
-        public VideoManager (PlayBin2 playbin)
+        public VideoManager (Element playbin)
         {
             this.playbin = playbin;
         }
@@ -65,6 +66,7 @@ namespace Banshee.GStreamerSharp
             Element videosink;
             video_display_context_type = VideoDisplayContextType.GdkWindow;
 
+            //FIXME BEFORE PUSHING NEW GST# BACKEND: is gconfvideosink gone in 1.0? it is not there in the 
unmanaged backend 
             videosink = ElementFactory.Make ("gconfvideosink", "videosink");
             if (videosink == null) {
                 videosink = ElementFactory.Make ("autovideosink", "videosink");
@@ -76,12 +78,13 @@ namespace Banshee.GStreamerSharp
                     }
                 }
             }
-            
+
             playbin ["video-sink"] = videosink;
 
             // FIXME: the 2 lines below (SyncHandler and ElementAdded), if uncommented, cause hangs, and they
             //        don't seem to be useful at this point anyway, remove?
-            //playbin.Bus.SyncHandler = (bus, message) => {return bus.SyncSignalHandler (message); };
+            //a) playbin.Bus.SyncHandler = (bus, message) => { return bus.SyncSignalHandler (message); };
+            //b) playbin.Bus.EnableSyncMessageEmission ();
             playbin.Bus.SyncMessage += OnSyncMessage;
             //if (videosink is Bin) { ((Bin)videosink).ElementAdded += OnVideoSinkElementAdded; }
 
@@ -106,17 +109,19 @@ namespace Banshee.GStreamerSharp
         {
             Message message = args.Message;
 
-            if (message.Type != MessageType.Element)
+            var src = message.Src as Element;
+            if (src == null) {
                 return;
+            }
 
-            if (message.Structure == null || message.Structure.Name != "prepare-xwindow-id") {
+            if (!GlobalVideo.IsVideoOverlayPrepareWindowHandleMessage (message)) {
                 return;
             }
 
             bool found_xoverlay = FindXOverlay ();
 
             if (found_xoverlay) {
-                xoverlay.XwindowId = video_window_xid.Value;
+                xoverlay.WindowHandle = video_window_xid.Value;
             }
         }
 
@@ -143,7 +148,7 @@ namespace Banshee.GStreamerSharp
                 return false;
             }
 
-            xoverlay.XwindowId = video_window_xid.Value;
+            xoverlay.WindowHandle = video_window_xid.Value;
             return true;
         }
 
@@ -153,7 +158,7 @@ namespace Banshee.GStreamerSharp
             Element xoverlay_element;
             bool    found_xoverlay;
 
-            video_sink = playbin.VideoSink;
+            video_sink = (Element)playbin ["video-sink"];
 
             lock (video_mutex) {
 
@@ -163,23 +168,28 @@ namespace Banshee.GStreamerSharp
                 }
 
                 xoverlay_element = video_sink is Bin
-                    ? ((Bin)video_sink).GetByInterface (new XOverlayAdapter ().GType)
+                    ? ((Bin)video_sink).GetByInterface (VideoOverlayAdapter.GType)
                     : video_sink;
 
                 if (xoverlay_element == null) {
                     return false;
                 }
-                xoverlay = new XOverlayAdapter (xoverlay_element.Handle);
+
+                xoverlay = new VideoOverlayAdapter (xoverlay_element.Handle);
 
                 if (!PlatformDetection.IsWindows) {
                     // We can't rely on aspect ratio from dshowvideosink
-                    if (xoverlay != null && xoverlay_element.HasProperty ("force-aspect-ratio")) {
-                        xoverlay_element ["force-aspect-ratio"] = true;
+                    if (xoverlay != null) {
+                        try {
+                            xoverlay_element ["force-aspect-ratio"] = true;
+                        } catch (PropertyNotFoundException) { }
                     }
                 }
 
-                if (xoverlay != null && xoverlay_element.HasProperty ("handle-events")) {
-                    xoverlay_element ["handle-events"] = false;
+                if (xoverlay != null) {
+                    try {
+                        xoverlay_element ["handle-events"] = false;
+                    } catch (PropertyNotFoundException) { }
                 }
 
                 found_xoverlay = (xoverlay != null) ? true : false;
@@ -190,25 +200,28 @@ namespace Banshee.GStreamerSharp
 
         public void ParseStreamInfo ()
         {
-            //int audios_streams;
+            int audios_streams;
             int video_streams;
-            //int text_streams;
+            int text_streams;
             Pad vpad = null;
 
-            //audios_streams = playbin.NAudio;
-            video_streams = playbin.NVideo;
-            //text_streams = playbin.NText;
+            audios_streams = (int)playbin["n-audio"];
+            video_streams = (int)playbin ["n-video"];
+            text_streams = (int)playbin["n-text"];
 
             if (video_streams > 0) {
                 int i;
                 /* Try to obtain a video pad */
-                for (i = 0; i < video_streams && vpad == null; i++) {
-                    vpad = playbin.GetVideoPad (i);
+                for (i = 0; i < video_streams; i++) {
+                    vpad = (Pad)playbin.Emit ("get-video-pad", new object [] { i });
+                    if (vpad != null) {
+                        break;
+                    }
                 }
             }
 
             if (vpad != null) {
-                Caps caps = vpad.NegotiatedCaps;
+                Caps caps = vpad.CurrentCaps;
                 if (caps != null) {
                     OnCapsSet (vpad, null);
                 }
@@ -216,11 +229,11 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        private void OnCapsSet (object o, Gst.GLib.NotifyArgs args)
+        private void OnCapsSet (object o, GLib.NotifyArgs args)
         {
             Structure s = null;
             int width, height, fps_n, fps_d, par_n, par_d;
-            Caps caps = ((Pad)o).NegotiatedCaps;
+            Caps caps = ((Pad)o).CurrentCaps;
 
             width = height = fps_n = fps_d = 0;
             if (caps == null) {
@@ -228,7 +241,7 @@ namespace Banshee.GStreamerSharp
             }
 
             /* Get video decoder caps */
-            s = caps [0];
+            s = caps.GetStructure (0);
             if (s != null) {
                 /* We need at least width/height and framerate */
                 if (!(s.HasField ("framerate") && s.HasField ("width") && s.HasField ("height"))) {
@@ -237,12 +250,12 @@ namespace Banshee.GStreamerSharp
                 Fraction f = new Fraction (s.GetValue ("framerate"));
                 fps_n = f.Numerator;
                 fps_d = f.Denominator;
-                Gst.GLib.Value val;
+                GLib.Value val;
                 width = (int)s.GetValue ("width");
                 height = (int)s.GetValue ("height");
                 /* Get the PAR if available */
                 val = s.GetValue ("pixel-aspect-ratio");
-                if (!val.Equals (Gst.GLib.Value.Empty)) {
+                if (!val.Equals (GLib.Value.Empty)) {
                     Fraction par = new Fraction (val);
                     par_n = par.Numerator;
                     par_d = par.Denominator;
@@ -281,6 +294,7 @@ namespace Banshee.GStreamerSharp
         {
             switch (System.Environment.OSVersion.Platform) {
                 case PlatformID.Unix:
+                    //FIXME: we should maybe stop relying on x11 
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideooverlay.html#GstVideoOverlay
                     video_window_xid = (ulong)gdk_x11_window_get_xid (window);
                 break;
                 case PlatformID.Win32NT:
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs 
b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs
index d413918..0b8cd7f 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs
@@ -1,10 +1,14 @@
 //
 // Visualization.cs
 //
-// Author:
+// Authors:
 //   olivier dufour <olivier duff gmail com>
+//   Andrés G. Aragoneses <knocte gmail com>
+//   Stephan Sundermann <stephansundermann gmail com>
 //
 // Copyright (C) 2011 olivier dufour.
+// Copyright (C) 2013 Andrés G. Aragoneses
+// Copyright (C) 2013 Stephan Sundermann
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -31,7 +35,6 @@ using System.Runtime.InteropServices;
 
 using Gst;
 using Gst.Base;
-using Gst.CorePlugins;
 
 using Hyena;
 
@@ -46,16 +49,9 @@ namespace Banshee.GStreamerSharp
         Adapter vis_buffer;
         bool active;
         bool vis_thawing;
-        IntPtr vis_fft;
-        GstFFTF32Complex[] vis_fft_buffer;
+        Gst.FFT.FFTF32 vis_fft;
+        Gst.FFT.FFTF32Complex[] vis_fft_buffer;
         float[] vis_fft_sample_buffer;
-        uint wanted_size;
-
-        [StructLayout(LayoutKind.Sequential)]
-        struct GstFFTF32Complex {
-          public float r;
-          public float i;
-        };
 
         enum FFTWindow
         {
@@ -66,96 +62,78 @@ namespace Banshee.GStreamerSharp
           Blackman
         }
 
-        [DllImport ("libgstfft-0.10.dll")]
-        private static extern IntPtr gst_fft_f32_new (int len, bool inverse);
-
-        [DllImport ("libgstfft-0.10.dll")]
-        private static extern void gst_fft_f32_window (IntPtr self, [MarshalAs (UnmanagedType.LPArray)] 
float [] timedata, FFTWindow window);
-
-        [DllImport ("libgstfft-0.10.dll")]
-        private static extern void gst_fft_f32_fft (IntPtr self, [MarshalAs (UnmanagedType.LPArray)] float 
[] timedata, [MarshalAs (UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct)] GstFFTF32Complex [] 
freqdata);
-
-        [DllImport ("libgstfft-0.10.dll")]
-        private static extern void gst_fft_f32_free (IntPtr self);
-
-        public Visualization (Bin audiobin, Pad teepad)
+        internal Visualization (PlayerEngine.AudioSinkBin audiobin)
         {
             // The basic pipeline we're constructing is:
             // .audiotee ! queue ! audioresample ! audioconvert ! fakesink
 
             Element converter, resampler;
-            Queue audiosinkqueue;
+            Element audiosinkqueue;
             Pad pad;
 
             vis_buffer = null;
-            vis_fft = gst_fft_f32_new (SLICE_SIZE * 2, false);
-            vis_fft_buffer = new GstFFTF32Complex [SLICE_SIZE + 1];
+            vis_fft = new Gst.FFT.FFTF32 (SLICE_SIZE * 2, false);
+            vis_fft_buffer = new Gst.FFT.FFTF32Complex [SLICE_SIZE + 1];
             vis_fft_sample_buffer = new float [SLICE_SIZE];
             
             // Core elements, if something fails here, it's the end of the world
-            audiosinkqueue = (Queue)ElementFactory.Make ("queue", "vis-queue");
-        
+            audiosinkqueue = ElementFactory.Make ("queue", "vis-queue");
+
             pad = audiosinkqueue.GetStaticPad ("sink");
-            pad.AddEventProbe (new PadEventProbeCallback (EventProbe));
-        
+            pad.AddProbe (PadProbeType.EventDownstream, EventProbe);
+
             resampler = ElementFactory.Make ("audioresample", "vis-resample");
             converter = ElementFactory.Make ("audioconvert", "vis-convert");
-            FakeSink fakesink = ElementFactory.Make ("fakesink", "vis-sink") as FakeSink;
-        
-            // channels * slice size * float size = size of chunks we want
-            wanted_size = (uint)(2 * SLICE_SIZE * sizeof(float));
-        
+            Element fakesink = ElementFactory.Make ("fakesink", "vis-sink");
+
             if (audiosinkqueue == null || resampler == null || converter == null || fakesink == null) {
                 Log.Debug ("Could not construct visualization pipeline, a fundamental element could not be 
created");
                 return;
             }
-        
+
+            
//http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-plugins/html/gstreamer-plugins-queue.html#GstQueueLeaky
+            const int GST_QUEUE_LEAK_DOWNSTREAM = 2;
+
             // Keep around the 5 most recent seconds of audio so that when resuming
             // visualization we have something to show right away.
-            audiosinkqueue.Leaky = Queue.LeakyType.Downstream;
-            audiosinkqueue.MaxSizeBuffers = 0;
-            audiosinkqueue.MaxSizeBytes = 0;
-            audiosinkqueue.MaxSizeTime = Clock.Second * 5;
-            
-            fakesink.Handoff += PCMHandoff;
-        
-        
+            audiosinkqueue ["leaky"] = GST_QUEUE_LEAK_DOWNSTREAM;
+            audiosinkqueue ["max-size-buffers"] = 0;
+            audiosinkqueue ["max-size-bytes"] = 0;
+            audiosinkqueue ["max-size-time"] = ((long)Constants.SECOND) * 5L;
+
+            fakesink.Connect ("handoff", PCMHandoff);
+
             // This enables the handoff signal.
-            fakesink.SignalHandoffs = true;
+            fakesink ["signal-handoffs"] = true;
             // Synchronize so we see vis at the same time as we hear it.
-            fakesink.Sync = true;
+            fakesink ["sync"] = true;
             // Drop buffers if they come in too late.  This is mainly used when
             // thawing the vis pipeline.
-            fakesink.MaxLateness = (long)(Clock.Second / 120);
+            fakesink ["max-lateness"] = ((long)Constants.SECOND / 120L);
             // Deliver buffers one frame early.  This allows for rendering
             // time.  (TODO: It would be great to calculate this on-the-fly so
             // we match the rendering time.
-            fakesink.TsOffset = -(long)(Clock.Second / 60);
+            fakesink ["ts-offset"] = -((long)Constants.SECOND / 60L);
             // Don't go to PAUSED when we freeze the pipeline.
-            fakesink.Async = false;
-            
+            fakesink ["async"] = false;
+
             audiobin.Add (audiosinkqueue, resampler, converter, fakesink);
-            
+
             pad = audiosinkqueue.GetStaticPad ("sink");
+            Pad teepad = audiobin.RequestTeePad ();
             teepad.Link (pad);
-            
+
+            teepad.Dispose ();
+            pad.Dispose ();
+
             Element.Link (audiosinkqueue, resampler, converter);
-            
+
             converter.LinkFiltered (fakesink, caps);
-            
+
             vis_buffer = new Adapter ();
             vis_resampler = resampler;
             vis_thawing = false;
             active = false;
-        
-            // Disable the pipeline till we hear otherwise from managed land.
-            Blocked = true;
-        }
-
-        ~Visualization ()
-        {
-            if (vis_fft != IntPtr.Zero)
-                gst_fft_f32_free (vis_fft);
         }
 
         public bool Active
@@ -167,29 +145,36 @@ namespace Banshee.GStreamerSharp
         }
 
         private Caps caps = Caps.FromString (
-            "audio/x-raw-float, " +
+            "audio/x-raw, " +
+            //FIXME: is this correct way to port this? 
https://github.com/GNOME/banshee/commit/e40923df1bc55129832dff5ca2c782f5040b412f#diff-7c442526ef990528be03ffbca9921ec3R38
+            "format = (string) " + Gst.Audio.GlobalAudio.AudioFormatToString (Gst.Audio.AudioFormat.F32) + 
", " +
             "rate = (int) 44100, " +
-            "channels = (int) 2, " +
-            "endianness = (int) BYTE_ORDER, " +
-            "width = (int) 32");
+            "channels = (int) 2");
 
-        private void BlockCallback (Pad pad, bool blocked)
-        {
-            if (!blocked) {
-                // Set thawing mode (discards buffers that are too old from the queue).
-                vis_thawing = true;
-            }
-        }
-        
+        ulong? block_probe = null;
         private bool Blocked
         {
             set {
                 if (vis_resampler == null)
                     return;
+
                 Pad queue_sink = vis_resampler.GetStaticPad ("src");
-                queue_sink.SetBlocked (value, new PadBlockCallback (BlockCallback));
+                if (value) {
+                    if (!block_probe.HasValue) {
+                        block_probe = queue_sink.AddProbe (PadProbeType.Block, (o, i) => PadProbeReturn.Ok);
+                    }
+                } else {
+                    if (block_probe.HasValue) {
+                        queue_sink.RemoveProbe (block_probe.Value);
+                        block_probe = null;
+                    }
+
+                    // Set thawing mode (discards buffers that are too old from the queue).
+                    vis_thawing = true;
+                }
             }
         }
+
         private event VisualizationDataHandler OnDataAvailable = null;
         public event VisualizationDataHandler DataAvailable {
             add {
@@ -215,14 +200,15 @@ namespace Banshee.GStreamerSharp
             }
         }
 
-        private void PCMHandoff (object o, FakeSink.HandoffArgs args)
+        private void PCMHandoff (object o, GLib.SignalArgs args)
         {
-            Gst.Buffer data;
-        
+            byte[] data;
+            uint wanted_size;
+
             if (OnDataAvailable == null) {
                 return;
             }
-        
+
             if (vis_thawing) {
                 // Flush our buffers out.
                 vis_buffer.Clear ();
@@ -231,23 +217,25 @@ namespace Banshee.GStreamerSharp
                 vis_thawing = false;
             }
         
-            Structure structure = args.Buffer.Caps [0];
-            int channels = (int)structure.GetValue ("channels");
+            Caps caps = ((Gst.Pad)args.Args [1]).CurrentCaps;
+
+
+            Structure structure = caps [0];
+            int channels = (int)structure.GetValue ("channels").Val;
         
             wanted_size = (uint)(channels * SLICE_SIZE * sizeof (float));
 
             //TODO see if buffer need a copy or not
             //but copy is no available in gst# ;(
-            vis_buffer.Push (args.Buffer);
+            vis_buffer.Push ((Gst.Buffer)args.Args[0]);
             int i, j;
-            while ((data = vis_buffer.Peek (wanted_size)) != null) {
-                float[] buff = new float[data.Size];
-                Marshal.Copy (data.Data, buff, 0, (int) data.Size);
+            while ((data = vis_buffer.Map ()) != null) {
+                float[] buff = new float[data.Length];
                 float[] deinterlaced = new float [channels * SLICE_SIZE];
                 float[] specbuf = new float [SLICE_SIZE * 2];
 
                 System.Array.Copy (specbuf, vis_fft_sample_buffer, SLICE_SIZE);
-                
+
                 for (i = 0; i < SLICE_SIZE; i++) {
                     float avg = 0.0f;
         
@@ -257,83 +245,72 @@ namespace Banshee.GStreamerSharp
                         deinterlaced[j * SLICE_SIZE + i] = sample;
                         avg += sample;
                     }
-        
+
                     avg /= channels;
                     specbuf[i + SLICE_SIZE] = avg;
                 }
-        
+
                 System.Array.Copy (vis_fft_sample_buffer, 0, specbuf, SLICE_SIZE, SLICE_SIZE);
-        
-                gst_fft_f32_window (vis_fft, specbuf, FFTWindow.Hamming);
-                gst_fft_f32_fft (vis_fft, specbuf, vis_fft_buffer);
-        
+
+                vis_fft.Window (specbuf, Gst.FFT.FFTWindow.Hamming);
+                vis_fft.Fft (specbuf, vis_fft_buffer);
+
                 for (i = 0; i < SLICE_SIZE; i++) {
                     float val;
-        
-                    GstFFTF32Complex cplx = vis_fft_buffer[i];
-        
-                    val = cplx.r * cplx.r + cplx.i * cplx.i;
+
+                    Gst.FFT.FFTF32Complex cplx = vis_fft_buffer[i];
+
+                    val = cplx.R * cplx.R + cplx.I * cplx.I;
                     val /= SLICE_SIZE * SLICE_SIZE;
                     val = (float)(10.0f * System.Math.Log10 ((double)val));
-        
+
                     val = (val + 60.0f) / 60.0f;
                     if (val < 0.0f)
                         val = 0.0f;
-        
+
                     specbuf[i] = val;
                 }
-        
+
                 float [] flat = new float[channels * SLICE_SIZE];
                 System.Array.Copy (deinterlaced, flat, flat.Length);
-        
+
                 float [][] cbd = new float[channels][];
                 for (int k = 0; k < channels; k++) {
                     float [] channel = new float[SLICE_SIZE];
                     System.Array.Copy (flat, k * SLICE_SIZE, channel, 0, SLICE_SIZE);
                     cbd [k] = channel;
                 }
-        
+
                 float [] spec = new float [SLICE_SIZE];
                 System.Array.Copy (specbuf, spec, SLICE_SIZE);
-        
+
                 try {
                     OnDataAvailable (cbd, new float[][] { spec });
                 } catch (System.Exception e) {
                     Log.Exception ("Uncaught exception during visualization data post.", e);
                 }
-        
+
                 vis_buffer.Flush ((uint)wanted_size);
             }
         }
-        
-        bool EventProbe (Pad pad, Event padEvent)
+
+        PadProbeReturn EventProbe (Pad pad, PadProbeInfo info)
         {
+            if (info.Type == PadProbeType.EventDownstream)
+                return PadProbeReturn.Pass;
+
+            var padEvent = info.Event;
             switch (padEvent.Type) {
                 case EventType.FlushStart:
                 case EventType.FlushStop:
                 case EventType.Seek:
-                case EventType.NewSegment:
+                case EventType.Segment:
                 case EventType.CustomDownstream:
                     vis_thawing = true;
                 break;
             }
-        
-            if (active)
-                return true;
-        
-            switch (padEvent.Type) {
-                case EventType.Eos:
-                case EventType.CustomDownstreamOob:
-                    Blocked = false;
-                    break;
-            
-                case EventType.NewSegment:
-                case EventType.CustomDownstream:
-                    Blocked = true;
-                    break;
-            }
-        
-            return true;
+
+            return PadProbeReturn.Pass;
         }
     }
 }
diff --git a/src/Backends/Banshee.GStreamerSharp/Makefile.am b/src/Backends/Banshee.GStreamerSharp/Makefile.am
index 507d814..76257b0 100644
--- a/src/Backends/Banshee.GStreamerSharp/Makefile.am
+++ b/src/Backends/Banshee.GStreamerSharp/Makefile.am
@@ -8,6 +8,7 @@ SOURCES =  \
        Banshee.GStreamerSharp/BpmDetector.cs \
        Banshee.GStreamerSharp/CddaManager.cs \
        Banshee.GStreamerSharp/DvdManager.cs \
+       Banshee.GStreamerSharp/GstExtensions.cs \
        Banshee.GStreamerSharp/PlayerEngine.cs \
        Banshee.GStreamerSharp/Transcoder.cs \
        Banshee.GStreamerSharp/VideoManager.cs \



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