[vala] gstreamer-0.10: Use generic delegates for the Gst.Iterator functions



commit 4b4d053db51edaf2206c628bdfe13f87f00e1d4a
Author: Sebastian Dröge <sebastian droege collabora co uk>
Date:   Thu Jul 8 16:24:15 2010 +0200

    gstreamer-0.10: Use generic delegates for the Gst.Iterator functions
    
    This fixes memory leaks among other things when using the iterators.

 vapi/gstreamer-0.10.vapi                           |   12 ++++++------
 .../gstreamer-0.10/gstreamer-0.10.metadata         |   12 ++++++++++--
 2 files changed, 16 insertions(+), 8 deletions(-)
---
diff --git a/vapi/gstreamer-0.10.vapi b/vapi/gstreamer-0.10.vapi
index c840e16..f4a93f8 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<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")]
diff --git a/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata b/vapi/packages/gstreamer-0.10/gstreamer-0.10.metadata
index 22eb5c8..8cb0a24 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"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]