mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
element: Added num_pads, num_src_pads, num_sink_pads
Exposing the corresponding struct element in GstElement
This commit is contained in:
parent
eb87563479
commit
168db3b948
1 changed files with 28 additions and 0 deletions
|
@ -191,6 +191,10 @@ pub trait ElementExtManual: 'static {
|
|||
fn get_sink_pads(&self) -> Vec<Pad>;
|
||||
fn get_src_pads(&self) -> Vec<Pad>;
|
||||
|
||||
fn num_pads(&self) -> u16;
|
||||
fn num_sink_pads(&self) -> u16;
|
||||
fn num_src_pads(&self) -> u16;
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn add_property_deep_notify_watch(
|
||||
&self,
|
||||
|
@ -500,6 +504,30 @@ impl<O: IsA<Element>> ElementExtManual for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn num_pads(&self) -> u16 {
|
||||
unsafe {
|
||||
let elt: &gst_sys::GstElement = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&elt.object.lock);
|
||||
elt.numpads
|
||||
}
|
||||
}
|
||||
|
||||
fn num_sink_pads(&self) -> u16 {
|
||||
unsafe {
|
||||
let elt: &gst_sys::GstElement = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&elt.object.lock);
|
||||
elt.numsinkpads
|
||||
}
|
||||
}
|
||||
|
||||
fn num_src_pads(&self) -> u16 {
|
||||
unsafe {
|
||||
let elt: &gst_sys::GstElement = &*(self.as_ptr() as *const _);
|
||||
::utils::MutexGuard::lock(&elt.object.lock);
|
||||
elt.numsrcpads
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
fn add_property_deep_notify_watch(
|
||||
&self,
|
||||
|
|
Loading…
Reference in a new issue