mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
Add getter for the current pad mode
This commit is contained in:
parent
12b5c2887f
commit
7b9daf3094
1 changed files with 10 additions and 0 deletions
|
@ -222,6 +222,8 @@ pub trait PadExtManual {
|
|||
|
||||
fn query_position<T: SpecificFormattedValue>(&self) -> Option<T>;
|
||||
fn query_position_generic(&self, format: Format) -> Option<GenericFormattedValue>;
|
||||
|
||||
fn get_mode(&self) -> ::PadMode;
|
||||
}
|
||||
|
||||
impl<O: IsA<Pad>> PadExtManual for O {
|
||||
|
@ -850,6 +852,14 @@ impl<O: IsA<Pad>> PadExtManual for O {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_mode(&self) -> ::PadMode {
|
||||
unsafe {
|
||||
let stash = self.to_glib_none();
|
||||
let ptr: &ffi::GstPad = &*stash.0;
|
||||
from_glib(ptr.mode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn trampoline_pad_probe(
|
||||
|
|
Loading…
Reference in a new issue