diff --git a/gstreamer-sharp/Bin.custom b/gstreamer-sharp/Bin.custom
index 815cbc0c7d..65fc28384f 100644
--- a/gstreamer-sharp/Bin.custom
+++ b/gstreamer-sharp/Bin.custom
@@ -53,53 +53,6 @@ public Gst.Element GetByInterface (System.Type type) {
return GetByInterface (t);
}
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_bin_iterate_elements (IntPtr bin);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_bin_iterate_recurse (IntPtr bin);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_bin_iterate_sinks (IntPtr bin);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_bin_iterate_sorted (IntPtr bin);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_bin_iterate_sources (IntPtr bin);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_bin_iterate_all_by_interface (IntPtr bin, IntPtr gtype);
-
-public IEnumerable Elements {
- get {
- return new Enumerable (gst_bin_iterate_elements (Handle));
- }
-}
-
-public IEnumerable ElementsRecurse {
- get {
- return new Enumerable (gst_bin_iterate_recurse (Handle));
- }
-}
-
-public IEnumerable ElementsSorted {
- get {
- return new Enumerable (gst_bin_iterate_sorted (Handle));
- }
-}
-
-public IEnumerable SinkElements {
- get {
- return new Enumerable (gst_bin_iterate_sinks (Handle));
- }
-}
-
-public IEnumerable SourceElements {
- get {
- return new Enumerable (gst_bin_iterate_sources (Handle));
- }
-}
-
-public IEnumerable GetAllByInterface (GLib.GType type) {
- return new Enumerable (gst_bin_iterate_all_by_interface (Handle, type.Val));
-}
-
public IEnumerable GetAllByInterface (System.Type type) {
if (!type.IsSubclassOf (typeof (GLib.GInterfaceAdapter)))
return null;
diff --git a/gstreamer-sharp/Element.custom b/gstreamer-sharp/Element.custom
index 748a30d4e1..a2243926d5 100644
--- a/gstreamer-sharp/Element.custom
+++ b/gstreamer-sharp/Element.custom
@@ -25,31 +25,6 @@ public static void Unlink (params Element [] elements) {
}
}
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_element_iterate_pads (IntPtr element);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_element_iterate_src_pads (IntPtr element);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_element_iterate_sink_pads (IntPtr element);
-
-public IEnumerable Pads {
- get {
- return new Enumerable (gst_element_iterate_pads (Handle));
- }
-}
-
-public IEnumerable SinkPads {
- get {
- return new Enumerable (gst_element_iterate_sink_pads (Handle));
- }
-}
-
-public IEnumerable SrcPads {
- get {
- return new Enumerable (gst_element_iterate_src_pads (Handle));
- }
-}
-
public Gst.StateChangeReturn GetState (out Gst.State state, ulong timeout) {
Gst.State pending;
return GetState (out state, out pending, timeout);
diff --git a/gstreamer-sharp/Gstreamer.metadata b/gstreamer-sharp/Gstreamer.metadata
index e9336c74de..a3f0f0437e 100644
--- a/gstreamer-sharp/Gstreamer.metadata
+++ b/gstreamer-sharp/Gstreamer.metadata
@@ -45,6 +45,12 @@
true
true
true
+ GetElements
+ GetSinkElements
+ GetSourceElements
+ GetElementsSorted
+ GetElementsRecurse
+ GetAllByInterface
@@ -305,6 +311,9 @@
/api/namespace/object[@name='ElementFactory']
/api/namespace/object[@name='ElementFactory']
+ GetPads
+ GetSrcPads
+ GetSinkPads
1
@@ -472,6 +481,11 @@
out
1
+
+
+
+
+
@@ -587,9 +601,9 @@
1
1
1
-
1
- 1
+ 1
+ GetInternalLinks
diff --git a/gstreamer-sharp/Iterator.cs b/gstreamer-sharp/Iterator.cs
deleted file mode 100644
index d9b690b58d..0000000000
--- a/gstreamer-sharp/Iterator.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using System;
-using System.Collections;
-using System.Runtime.InteropServices;
-using GLib;
-
-namespace Gst {
-
- internal class Enumerable : IEnumerable {
- private class Enumerator : IEnumerator {
- Enumerable enumerable;
- Hashtable seen = new Hashtable ();
- IntPtr iterator;
-
- private object current = null;
- public object Current {
- get {
- return current;
- }
- }
-
- public bool MoveNext () {
- IntPtr raw_ret;
- bool retry = false;
-
- if (iterator == IntPtr.Zero)
- return false;
-
- do {
- int ret = gst_iterator_next (iterator, out raw_ret);
- switch (ret) {
- case 0:
- return false;
- case 1:
- if (seen.Contains (raw_ret)) {
- retry = true;
- break;
- }
-
- seen.Add (raw_ret, null);
- current = GLib.Object.GetObject (raw_ret, true);
- return true;
- case 2:
- gst_iterator_resync (iterator);
- retry = true;
- break;
- default:
- case 3:
- throw new Exception ("Error while iterating pads");
- }
- } while (retry);
-
- return false;
- }
-
- public void Reset () {
- seen.Clear ();
- if (iterator != IntPtr.Zero)
- gst_iterator_resync (iterator);
- }
-
- public Enumerator (Enumerable enumerable, IntPtr iterator) {
- this.enumerable = enumerable;
- this.iterator = iterator;
- }
- }
-
- private IntPtr iterator;
- private Enumerator enumerator;
-
- public Enumerable (IntPtr iterator) {
- this.iterator = iterator;
- this.enumerator = new Enumerator (this, iterator);
- }
-
- public IEnumerator GetEnumerator () {
- return this.enumerator;
- }
-
- ~Enumerable () {
- if (iterator != IntPtr.Zero)
- gst_iterator_free (iterator);
- }
-
- [DllImport ("libgstreamer-0.10.dll") ]
- static extern int gst_iterator_next (IntPtr iterator, out IntPtr elem);
- [DllImport ("libgstreamer-0.10.dll") ]
- static extern void gst_iterator_resync (IntPtr iterator);
- [DllImport ("libgstreamer-0.10.dll") ]
- static extern void gst_iterator_free (IntPtr iterator);
-
- }
-}
diff --git a/gstreamer-sharp/Iterator.custom b/gstreamer-sharp/Iterator.custom
new file mode 100755
index 0000000000..cb02597edc
--- /dev/null
+++ b/gstreamer-sharp/Iterator.custom
@@ -0,0 +1,75 @@
+[DllImport ("libgstreamer-0.10.dll") ]
+static extern int gst_iterator_next (IntPtr iterator, out IntPtr elem);
+[DllImport ("libgstreamer-0.10.dll") ]
+static extern void gst_iterator_resync (IntPtr iterator);
+
+private class Enumerator : IEnumerator {
+ Iterator iterator;
+ Hashtable seen = new Hashtable ();
+
+ private object current = null;
+ public object Current {
+ get {
+ return current;
+ }
+ }
+
+ public bool MoveNext () {
+ IntPtr raw_ret;
+ bool retry = false;
+
+ if (iterator.Handle == IntPtr.Zero)
+ return false;
+
+ do {
+ int ret = gst_iterator_next (iterator.Handle, out raw_ret);
+ switch (ret) {
+ case 0:
+ return false;
+ case 1:
+ if (seen.Contains (raw_ret)) {
+ retry = true;
+ break;
+ }
+ seen.Add (raw_ret, null);
+ current = GLib.Object.GetObject (raw_ret, true);
+ return true;
+ case 2:
+ gst_iterator_resync (iterator.Handle);
+ retry = true;
+ break;
+ default:
+ case 3:
+ throw new Exception ("Error while iterating pads");
+ }
+ } while (retry);
+
+ return false;
+ }
+
+ public void Reset () {
+ seen.Clear ();
+ if (iterator.Handle != IntPtr.Zero)
+ gst_iterator_resync (iterator.Handle);
+ }
+
+ public Enumerator (Iterator iterator) {
+ this.iterator = iterator;
+ }
+}
+
+private Enumerator enumerator = null;
+
+public IEnumerator GetEnumerator () {
+ if (this.enumerator == null)
+ this.enumerator = new Enumerator (this);
+ return this.enumerator;
+}
+
+[DllImport ("libgstreamer-0.10.dll") ]
+static extern void gst_iterator_free (IntPtr iterator);
+
+~Iterator () {
+ if (Raw != IntPtr.Zero)
+ gst_iterator_free (Raw);
+}
diff --git a/gstreamer-sharp/Makefile.am b/gstreamer-sharp/Makefile.am
index fa50998d87..6578474a35 100644
--- a/gstreamer-sharp/Makefile.am
+++ b/gstreamer-sharp/Makefile.am
@@ -45,7 +45,6 @@ sources = \
Value.cs \
PropertyInfo.cs \
EnumInfo.cs \
- Iterator.cs \
MiniObject.cs \
Marshaller.cs \
GstSharp.PadQueryTypeFunctionNative.cs \
@@ -103,6 +102,7 @@ customs = \
IndexEntry.custom \
Index.custom \
IndexFactory.custom \
+ Iterator.custom \
Registry.custom \
Query.custom \
Structure.custom \
diff --git a/gstreamer-sharp/Pad.custom b/gstreamer-sharp/Pad.custom
index 934d4e72b5..259980ec70 100644
--- a/gstreamer-sharp/Pad.custom
+++ b/gstreamer-sharp/Pad.custom
@@ -361,16 +361,3 @@ public void StreamUnlock (uint depth) {
public bool StreamTryLock () {
return g_static_rec_mutex_trylock (StreamLockPtr);
}
-
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_pad_iterate_internal_links (IntPtr pad);
-[DllImport("libgstreamer-0.10.dll") ]
-static extern IntPtr gst_pad_iterate_internal_links_default (IntPtr pad);
-
-
-public IEnumerable InternalLinks {
- get {
- return new Enumerable (gst_pad_iterate_internal_links (Handle));
- }
-}
-