mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-02 22:46:35 +00:00
663d3e047d
The custom properties that return a IEnumerable are replaced by generated properties that return an Iterator. Most of the code in Iterator.cs has moved to Iterator.custom to implement IEnumerable.
63 lines
1.3 KiB
Text
63 lines
1.3 KiB
Text
public Bin () : this (null) {}
|
|
|
|
[DllImport("libgstreamer-0.10.dll") ]
|
|
static extern bool gst_bin_add (IntPtr raw, IntPtr element);
|
|
|
|
[DllImport ("libgobject-2.0-0.dll") ]
|
|
static extern IntPtr g_object_ref (IntPtr raw);
|
|
|
|
public bool Add (Gst.Element element) {
|
|
bool raw_ret = gst_bin_add (Handle, element == null ? IntPtr.Zero : element.Handle);
|
|
if (raw_ret) {
|
|
// Incrmenting the refcount of the element.
|
|
g_object_ref (element.Handle);
|
|
}
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
public bool Add (params Element[] elements) {
|
|
if (elements == null) {
|
|
return false;
|
|
}
|
|
|
|
foreach (Element element in elements) {
|
|
if (element == null || !Add (element)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public bool Remove (params Element[] elements) {
|
|
if (elements == null) {
|
|
return false;
|
|
}
|
|
|
|
foreach (Element element in elements) {
|
|
if (element == null || !Remove (element)) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public Gst.Element GetByInterface (System.Type type) {
|
|
if (!type.IsSubclassOf (typeof (GLib.GInterfaceAdapter)))
|
|
return null;
|
|
|
|
GLib.GType t = (GLib.GType) type;
|
|
|
|
return GetByInterface (t);
|
|
}
|
|
|
|
public IEnumerable GetAllByInterface (System.Type type) {
|
|
if (!type.IsSubclassOf (typeof (GLib.GInterfaceAdapter)))
|
|
return null;
|
|
|
|
GLib.GType t = (GLib.GType) type;
|
|
|
|
return GetAllByInterface (t);
|
|
}
|