Add getter for the current pad mode

This commit is contained in:
Sebastian Dröge 2018-08-01 19:28:57 +03:00
parent 9e90a1264f
commit ccca8248c3

View file

@ -224,6 +224,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 {
@ -858,6 +860,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(