2006-05-19 19:24:35 +00:00
|
|
|
|
2006-05-25 15:57:02 +00:00
|
|
|
[DllImport ("gstreamersharpglue-0.10")]
|
2006-05-20 22:35:40 +00:00
|
|
|
private extern static uint gstsharp_gst_bin_get_children_offset();
|
2006-05-19 19:24:35 +00:00
|
|
|
|
2006-05-25 15:57:02 +00:00
|
|
|
static uint children_offset = gstsharp_gst_bin_get_children_offset();
|
2006-05-19 19:24:35 +00:00
|
|
|
|
2006-05-25 15:57:02 +00:00
|
|
|
public Element [] Children {
|
2006-05-20 22:35:40 +00:00
|
|
|
get {
|
|
|
|
GLib.List list;
|
|
|
|
|
|
|
|
unsafe {
|
|
|
|
IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + children_offset);
|
|
|
|
list = new GLib.List((*raw_ptr));
|
|
|
|
}
|
|
|
|
|
|
|
|
Element [] result = new Element[list.Count];
|
|
|
|
|
2006-06-04 16:49:35 +00:00
|
|
|
for(int i = list.Count - 1; i >= 0; i--) {
|
2006-05-20 22:35:40 +00:00
|
|
|
result[i] = list[i] as Element;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-06-21 07:25:57 +00:00
|
|
|
[DllImport("gstreamer-0.10.dll")]
|
|
|
|
static extern bool gst_bin_add(IntPtr raw, IntPtr element);
|
|
|
|
|
|
|
|
public bool Add(Gst.Element element) {
|
|
|
|
bool raw_ret = gst_bin_add(Handle, element == null ? IntPtr.Zero : element.Handle);
|
2006-08-04 04:00:43 +00:00
|
|
|
if(raw_ret) {
|
|
|
|
// Incrmenting the refcount of the element.
|
|
|
|
Gst.Object.Ref(element.Handle);
|
|
|
|
}
|
2006-06-21 07:25:57 +00:00
|
|
|
bool ret = raw_ret;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2006-05-20 22:35:40 +00:00
|
|
|
public bool AddMany(params Element[] elements)
|
|
|
|
{
|
|
|
|
if(elements == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach(Element element in elements) {
|
|
|
|
if(element == null || !Add(element)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
2006-06-21 07:25:57 +00:00
|
|
|
|
2006-08-20 22:37:48 +00:00
|
|
|
public bool RemoveMany(params Element[] elements)
|
|
|
|
{
|
|
|
|
if(elements == null) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach(Element element in elements) {
|
|
|
|
if(element == null || !Remove(element)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2006-06-21 07:25:57 +00:00
|
|
|
|
2006-08-20 22:37:48 +00:00
|
|
|
return true;
|
|
|
|
}
|
2006-06-21 07:25:57 +00:00
|
|
|
|