diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index 1e82c48a2..e0fbe5c1c 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -92,6 +92,10 @@ pub trait ElementExtManual { fn iterate_pads(&self) -> ::Iterator; fn iterate_sink_pads(&self) -> ::Iterator; fn iterate_src_pads(&self) -> ::Iterator; + + fn get_pads(&self) -> Vec; + fn get_sink_pads(&self) -> Vec; + fn get_src_pads(&self) -> Vec; } impl> ElementExtManual for O { @@ -227,6 +231,33 @@ impl> ElementExtManual for O { fn iterate_src_pads(&self) -> ::Iterator { unsafe { from_glib_full(ffi::gst_element_iterate_src_pads(self.to_glib_none().0)) } } + + fn get_pads(&self) -> Vec { + unsafe { + let stash = self.to_glib_none(); + let elt: &ffi::GstElement = &*stash.0; + ::utils::MutexGuard::lock(&elt.object.lock); + FromGlibPtrContainer::from_glib_none(elt.pads) + } + } + + fn get_sink_pads(&self) -> Vec { + unsafe { + let stash = self.to_glib_none(); + let elt: &ffi::GstElement = &*stash.0; + ::utils::MutexGuard::lock(&elt.object.lock); + FromGlibPtrContainer::from_glib_none(elt.sinkpads) + } + } + + fn get_src_pads(&self) -> Vec { + unsafe { + let stash = self.to_glib_none(); + let elt: &ffi::GstElement = &*stash.0; + ::utils::MutexGuard::lock(&elt.object.lock); + FromGlibPtrContainer::from_glib_none(elt.srcpads) + } + } } lazy_static!{