mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
aa7bb8fa1c
glib-sharp will only get a new release with the new API that we need for 3.0 in a year or something. Instead of waiting a year before we can release something we now have our own internal copy of glib-sharp trunk that will be dropped once glib-sharp 3.0 is released. Everything is now compilable and working without any additional patches.
63 lines
1.4 KiB
Text
63 lines
1.4 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 (Gst.GLib.GInterfaceAdapter)))
|
|
return null;
|
|
|
|
Gst.GLib.GType t = (Gst.GLib.GType) type;
|
|
|
|
return GetByInterface (t);
|
|
}
|
|
|
|
public IEnumerable GetAllByInterface (System.Type type) {
|
|
if (!type.IsSubclassOf (typeof (Gst.GLib.GInterfaceAdapter)))
|
|
return null;
|
|
|
|
Gst.GLib.GType t = (Gst.GLib.GType) type;
|
|
|
|
return GetAllByInterface (t);
|
|
}
|