Implement Gst.MiniObject.Copy() manually to get the correct type from the instance

This commit is contained in:
Sebastian Dröge 2009-04-18 16:21:16 +02:00
parent 431b934fb5
commit c1eeb9c6bd
2 changed files with 12 additions and 2 deletions

View file

@ -234,10 +234,9 @@
<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" />
<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_copy']" name="hidden">1</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>

View file

@ -38,3 +38,14 @@ public void MakeWritable() {
Owned = true;
}
[DllImport ("gstreamer-0.10.dll") ]
static extern IntPtr gst_mini_object_copy (IntPtr raw);
public Gst.MiniObject Copy() {
IntPtr raw_ret = gst_mini_object_copy (Handle);
GLib.GType type = new GLib.GType (gstsharp_g_type_from_instance (raw_ret));
Gst.MiniObject ret = raw_ret == IntPtr.Zero ? null : (Gst.MiniObject) GLib.Opaque.GetOpaque (raw_ret, (Type) type, true);
return ret;
}