From: Sebastian Dröge Date: Thu, 8 Jul 2010 14:24:15 +0000 (+0200) Subject: gstreamer-0.10: Use generic delegates for the Gst.Iterator functions X-Git-Tag: 0.9.3~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b4d053db51edaf2206c628bdfe13f87f00e1d4a;p=thirdparty%2Fvala.git gstreamer-0.10: Use generic delegates for the Gst.Iterator functions This fixes memory leaks among other things when using the iterators. --- diff --git a/vapi/gstreamer-0.10.vapi b/vapi/gstreamer-0.10.vapi index c840e16d3..f4a93f8a7 100644 --- a/vapi/gstreamer-0.10.vapi +++ b/vapi/gstreamer-0.10.vapi @@ -611,12 +611,12 @@ namespace Gst { public weak Gst.Iterator pushed; public GLib.Type type; [CCode (has_construct_function = false)] - public Iterator (uint size, GLib.Type type, GLib.Mutex @lock, ref uint32 master_cookie, Gst.IteratorNextFunction next, Gst.IteratorItemFunction item, Gst.IteratorResyncFunction resync, Gst.IteratorFreeFunction free); + public Iterator (uint size, GLib.Type type, GLib.Mutex @lock, ref uint32 master_cookie, Gst.IteratorNextFunction next, Gst.IteratorItemFunction item, Gst.IteratorResyncFunction resync, Gst.IteratorFreeFunction free); public T find_custom (GLib.CompareFunc func, T user_data); - public Gst.IteratorResult fold ([CCode (delegate_target_pos = 2.1)] Gst.IteratorFoldFunction func, out Gst.Value ret); + public Gst.IteratorResult fold ([CCode (delegate_target_pos = 2.1)] Gst.IteratorFoldFunction func, out Gst.Value ret); public Gst.IteratorResult @foreach (GLib.Func func); [CCode (has_construct_function = false)] - public Iterator.list (GLib.Type type, GLib.Mutex @lock, ref uint32 master_cookie, GLib.List list, void* owner, Gst.IteratorItemFunction item, Gst.IteratorDisposeFunction free); + public Iterator.list (GLib.Type type, GLib.Mutex @lock, ref uint32 master_cookie, GLib.List list, void* owner, Gst.IteratorItemFunction item, Gst.IteratorDisposeFunction free); public Gst.IteratorResult next (out T elem); public void push (Gst.Iterator other); public void resync (); @@ -2246,13 +2246,13 @@ namespace Gst { [CCode (cheader_filename = "gst/gst.h", has_target = false)] public delegate void IteratorDisposeFunction (void* owner); [CCode (cheader_filename = "gst/gst.h")] - public delegate bool IteratorFoldFunction (void* item, ref Gst.Value ret); + public delegate bool IteratorFoldFunction (T item, ref Gst.Value ret); [CCode (cheader_filename = "gst/gst.h", has_target = false)] public delegate void IteratorFreeFunction (Gst.Iterator it); [CCode (cheader_filename = "gst/gst.h", has_target = false)] - public delegate Gst.IteratorItem IteratorItemFunction (Gst.Iterator it, void* item); + public delegate Gst.IteratorItem IteratorItemFunction (Gst.Iterator it, out T item); [CCode (cheader_filename = "gst/gst.h", has_target = false)] - public delegate Gst.IteratorResult IteratorNextFunction (Gst.Iterator it, out void* result); + public delegate Gst.IteratorResult IteratorNextFunction (Gst.Iterator it, out T result); [CCode (cheader_filename = "gst/gst.h", has_target = false)] public delegate void IteratorResyncFunction (Gst.Iterator it); [CCode (cheader_filename = "gst/gst.h")] diff --git a/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata b/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata index 22eb5c820..8cb0a24d4 100644 --- a/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata +++ b/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata @@ -232,8 +232,11 @@ GstIterator.resync hidden="1" GstIterator.item hidden="1" GstIterator.pushed nullable="1" GstIterator.master_cookie type_name="pointer" +gst_iterator_new.next type_arguments="T" +gst_iterator_new.item type_arguments="T" +gst_iterator_new_list.item type_arguments="T" gst_iterator_next.elem type_name="T" is_out="1" transfer_ownership="1" -gst_iterator_fold.func delegate_target_pos="2.1" +gst_iterator_fold.func type_arguments="T" delegate_target_pos="2.1" gst_iterator_fold.ret is_out="1" gst_iterator_new_list.list type_arguments="T" gst_iterator_new.master_cookie is_ref="1" @@ -242,7 +245,12 @@ gst_iterator_find_custom type_name="T" transfer_ownership="1" gst_iterator_find_custom.user_data type_name="T" hidden="0" gst_iterator_new_single.object type_name="T" gst_iterator_filter hidden="1" -GstIteratorNextFunction.result is_out="1" +GstIteratorNextFunction type_parameters="T" +GstIteratorNextFunction.result type_name="T" is_out="1" takes_ownership="1" +GstIteratorItemFunction type_parameters="T" +GstIteratorItemFunction.item type_name="T" is_out="1" takes_ownership="1" +GstIteratorFoldFunction type_parameters="T" +GstIteratorFoldFunction.item type_name="T" transfer_ownership="1" GstIteratorFoldFunction.ret is_ref="1" GstMessage base_class="GstMiniObject" GstMessage.mini_object hidden="1"