From 4a716f3ba2266377175715588c0909c69e6b768f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 12 Apr 2009 20:55:11 +0200 Subject: [PATCH] Fix MiniObject bindings --- gstreamer-sharp/Gstreamer.metadata | 11 ++++++++++- gstreamer-sharp/MiniObject.custom | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/gstreamer-sharp/Gstreamer.metadata b/gstreamer-sharp/Gstreamer.metadata index 4fcc5a1..b35cf57 100644 --- a/gstreamer-sharp/Gstreamer.metadata +++ b/gstreamer-sharp/Gstreamer.metadata @@ -167,7 +167,16 @@ true 1 - + 1 + true + GstMiniObjectFlags + true + 1 + 1 + + 1 + + 1 1 1 diff --git a/gstreamer-sharp/MiniObject.custom b/gstreamer-sharp/MiniObject.custom index 4706791..0d641a1 100644 --- a/gstreamer-sharp/MiniObject.custom +++ b/gstreamer-sharp/MiniObject.custom @@ -1,4 +1,4 @@ -protected MiniObject () : base (IntPtr.Zero) +protected MiniObject () : base () { } @@ -25,3 +25,17 @@ private static extern IntPtr gstsharp_g_value_type (ref GLib.Value val); private static extern IntPtr gst_value_get_mini_object (ref GLib.Value v); [DllImport ("gstreamer-0.10.dll") ] private static extern void gst_value_set_mini_object (ref GLib.Value v, IntPtr o); + +/* FIXME: This is not optimal! */ +public void MakeWritable() { + if (IsWritable) + return; + + IntPtr copy = gst_mini_object_copy (Raw); + Raw = copy; + /* ^--- Takes a second ref, not good */ + Unref (Raw); + /* ^--- Sets Owned = false, wrong! */ + Owned = true; +} + -- 2.7.4