Add getter for the current pad mode

This commit is contained in:
Sebastian Dröge 2018-08-01 19:28:57 +03:00
parent 12b5c2887f
commit 7b9daf3094

View file

@ -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(