Make sure Gst.Bus.SyncHandler handlers are not garbage collected too early
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 1 Oct 2009 14:10:44 +0000 (16:10 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 1 Oct 2009 14:10:44 +0000 (16:10 +0200)
gstreamer-sharp/Bus.custom
gstreamer-sharp/Gstreamer.metadata

index 873232eadb9695cfc9c732ba880dba26ed4b2b51..b668954bcb91be48cbc96bcf3d53167e33848fb7 100644 (file)
@@ -19,3 +19,15 @@ public bool AsyncSignalFunc (Gst.Message message) {
   bool ret = raw_ret;
   return ret;
 }
+
+[DllImport ("libgstreamer-0.10.dll", CallingConvention = CallingConvention.Cdecl) ]
+static extern void gst_bus_set_sync_handler (IntPtr raw, GstSharp.BusSyncHandlerNative func, IntPtr data);
+private GstSharp.BusSyncHandlerWrapper sync_handler = null;
+
+public Gst.BusSyncHandler SyncHandler {
+  set  {
+    GstSharp.BusSyncHandlerWrapper value_wrapper = new GstSharp.BusSyncHandlerWrapper (value);
+    sync_handler = value_wrapper;
+    gst_bus_set_sync_handler (Handle, value_wrapper.NativeDelegate, IntPtr.Zero);
+  }
+}
index 7209b210092026803b9cee99343705229fc94a36..6902e0d6b178ed7ebbdb24c8634aad1be83a445e 100644 (file)
@@ -99,6 +99,7 @@
   <attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_async_signal_func']" name="hidden">1</attr>
   <attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_add_signal_watch_full']" name="name">AddSignalWatch</attr>
   <attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_poll']/return-type" name="owned">true</attr>
+  <attr path="/api/namespace/object[@name='Bus']/method[@cname='gst_bus_set_sync_handler']" name="hidden">1</attr>
 
   <attr path="/api/namespace/enum[@name='BusFlags']/member[@cname='GST_BUS_FLAG_LAST']" name="name">Last</attr>
   <attr path="/api/namespace/enum[@name='BusFlags']/member[@cname='GST_BUS_FLUSHING']" name="value">MiniObjectFlags.Last &lt;&lt; 0</attr>