[banshee/gst#] [gst#] Fix excepion because bad cast and missing ctor



commit c6acc057b8e1a30ac5ce04455b400d6e5c320b29
Author: Olivier Dufour <olivier duff gmail com>
Date:   Wed Jun 8 23:21:21 2011 +0200

    [gst#] Fix excepion because bad cast and missing ctor

 .../Banshee.GStreamerSharp.dll.config              |    2 +-
 .../Banshee.GStreamerSharp/PlayerEngine.cs         |    7 +++-
 .../Banshee.GStreamerSharp/Visualization.cs        |   38 +++++++++++--------
 3 files changed, 29 insertions(+), 18 deletions(-)
---
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config
index 81165cf..f1e43cc 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp.dll.config
@@ -1,5 +1,5 @@
 <configuration>
   <dllmap dll="libgdk.dll" target="libgdk-x11-2.0.so" os="!windows"/>
   <dllmap dll="libgdk.dll" target="libgdk-win32-2.0-0.dll" os="windows"/>
-  <dllmap dll="libgstbase-0.10.dll" target="libgstbase-0.10.so.0"/>
+  <dllmap dll="libgstfft-0.10.dll" target="libgstfft-0.10.so"/>
 </configuration>
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
index 735c5ed..783f886 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/PlayerEngine.cs
@@ -65,6 +65,11 @@ namespace Banshee.GStreamerSharp
             Element audiotee;
             object pipeline_lock = new object ();
 
+            public AudioSinkBin (IntPtr o) : base(o)
+            {
+
+            }
+
             public AudioSinkBin (string elementName) : base(elementName)
             {
                 hw_audio_sink = SelectAudioSink ();
@@ -914,4 +919,4 @@ namespace Banshee.GStreamerSharp
         );
 
     }
-}
\ No newline at end of file
+}
diff --git a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs
index 60f6a3c..24d0900 100644
--- a/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs
+++ b/src/Backends/Banshee.GStreamerSharp/Banshee.GStreamerSharp/Visualization.cs
@@ -68,16 +68,16 @@ namespace Banshee.GStreamerSharp
           Blackman
         }
 
-        [DllImport ("libgstbase-0.10.dll")]
+        [DllImport ("libgstfft-0.10.dll")]
         private static extern GstFFTF32 gst_fft_f32_new (int len, bool inverse);
 
-        [DllImport ("libgstbase-0.10.dll")]
+        [DllImport ("libgstfft-0.10.dll")]
         private static extern void gst_fft_f32_window (GstFFTF32 self, [MarshalAs (UnmanagedType.LPArray)] float [] timedata, FFTWindow window);
 
-        [DllImport ("libgstbase-0.10.dll")]
+        [DllImport ("libgstfft-0.10.dll")]
         private static extern void gst_fft_f32_fft (GstFFTF32 self, [MarshalAs (UnmanagedType.LPArray)] float [] timedata, [MarshalAs (UnmanagedType.LPArray, ArraySubType=UnmanagedType.Struct)] GstFFTF32Complex [] freqdata);
 
-        [DllImport ("libgstbase-0.10.dll")]
+        [DllImport ("libgstfft-0.10.dll")]
         private static extern void gst_fft_f32_free (GstFFTF32 self);
 
         public Visualization (Bin audiobin, Pad teepad)
@@ -85,7 +85,8 @@ namespace Banshee.GStreamerSharp
             // The basic pipeline we're constructing is:
             // .audiotee ! queue ! audioresample ! audioconvert ! fakesink
         
-            Element converter, resampler, audiosinkqueue;
+            Element converter, resampler;
+            Queue audiosinkqueue;
             Pad pad;
 
             vis_buffer = null;
@@ -94,7 +95,7 @@ namespace Banshee.GStreamerSharp
             vis_fft_sample_buffer = new float [SLICE_SIZE];
             
             // Core elements, if something fails here, it's the end of the world
-            audiosinkqueue = ElementFactory.Make ("queue", "vis-queue");
+            audiosinkqueue = (Queue)ElementFactory.Make ("queue", "vis-queue");
         
             pad = audiosinkqueue.GetStaticPad ("sink");
             pad.AddEventProbe (new PadEventProbeCallback (EventProbe));
@@ -113,27 +114,27 @@ namespace Banshee.GStreamerSharp
         
             // Keep around the 5 most recent seconds of audio so that when resuming
             // visualization we have something to show right away.
-            audiosinkqueue ["leaky"] = 2;
-            audiosinkqueue ["max-size-buffers"] = 0;
-            audiosinkqueue ["max-size-bytes"] = 0;
-            audiosinkqueue ["max-size-time"] = Clock.Second * 5;
+            audiosinkqueue.Leaky = Queue.LeakyType.Downstream;
+            audiosinkqueue.MaxSizeBuffers = 0;
+            audiosinkqueue.MaxSizeBytes = 0;
+            audiosinkqueue.MaxSizeTime = Clock.Second * 5;
             
             fakesink.Handoff += PCMHandoff;
         
         
             // This enables the handoff signal.
-            fakesink ["signal-handoffs"] = true;
+            fakesink.SignalHandoffs = 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 ["max-lateness"] = Clock.Second / 120;
+            fakesink.MaxLateness = (long)(Clock.Second / 120);
             // 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 ["ts-offset"] = -(long)(Clock.Second / 60);
+            fakesink.TsOffset = -(long)(Clock.Second / 60);
             // Don't go to PAUSED when we freeze the pipeline.
-            fakesink ["async"] = false;
+            fakesink.Async = false;
             
             audiobin.Add (audiosinkqueue, resampler, converter, fakesink);
             
@@ -152,7 +153,12 @@ namespace Banshee.GStreamerSharp
             // Disable the pipeline till we hear otherwise from managed land.
             Blocked = true;
         }
-        
+
+        ~Visualization ()
+        {
+            gst_fft_f32_free (vis_fft);
+        }
+
         public bool Active
         {
             set {



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