Fix MiniObject bindings

This commit is contained in:
Sebastian Dröge 2009-04-12 20:55:11 +02:00
parent 652b922790
commit 4a716f3ba2
2 changed files with 25 additions and 2 deletions

View file

@ -167,7 +167,16 @@
<attr path="/api/namespace/boxed[@name='MiniObject']" name="opaque">true</attr>
<attr path="/api/namespace/boxed[@name='MiniObject']" name="abstract">1</attr>
<remove-attr path="/api/namespace/boxed[@name='MiniObject']" name="parent" />
<remove-node path="/api/namespace/boxed[@name='MiniObject']/constructor[@cname='gst_mini_object_new']" />
<attr path="/api/namespace/boxed[@name='MiniObject']/field[@name='Refcount']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='MiniObject']/field[@name='Flags']" name="writeable">true</attr>
<attr path="/api/namespace/boxed[@name='MiniObject']/field[@name='Flags']" name="type">GstMiniObjectFlags</attr>
<attr path="/api/namespace/boxed[@name='MiniObject']/method[@cname='gst_mini_object_copy']" name="owned">true</attr>
<attr path="/api/namespace/boxed[@name='MiniObject']/method[@cname='gst_mini_object_make_writable']" name="hidden">1</attr>
<attr path="/api/namespace/boxed[@name='MiniObject']/method[@cname='gst_mini_object_replace']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@name='MiniObjectCopyFunction']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@name='MiniObjectFinalizeFunction']" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='Object']/field[@name='Refcount']" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='Object']/method[@name='DefaultError']" name="hidden">1</attr>

View file

@ -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;
}