]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gstreamer-0.10: Use generic delegates for the Gst.Iterator functions
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 8 Jul 2010 14:24:15 +0000 (16:24 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 8 Jul 2010 14:24:15 +0000 (16:24 +0200)
This fixes memory leaks among other things when using the iterators.

vapi/gstreamer-0.10.vapi
vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata

index c840e16d3bb1fb84dbe904795884419e47e48f29..f4a93f8a77da526fc75201c057034aaff0032407 100644 (file)
@@ -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<T> next, Gst.IteratorItemFunction<T> 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<T> 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<T> list, void* owner, Gst.IteratorItemFunction item, Gst.IteratorDisposeFunction free);
+               public Iterator.list (GLib.Type type, GLib.Mutex @lock, ref uint32 master_cookie, GLib.List<T> list, void* owner, Gst.IteratorItemFunction<T> 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> (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<T> (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<T> (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")]
index 22eb5c82014584356898d8a439cb9a26ddc36e2b..8cb0a24d4119fb2cf526560c660f598b3b4da082 100644 (file)
@@ -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"