From ccca8248c3c5904de56ffa87805fc31a4d97a085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 Aug 2018 19:28:57 +0300 Subject: [PATCH] Add getter for the current pad mode --- gstreamer/src/pad.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index c1ea57cf0..5c314d3d9 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -224,6 +224,8 @@ pub trait PadExtManual { fn query_position(&self) -> Option; fn query_position_generic(&self, format: Format) -> Option; + + fn get_mode(&self) -> ::PadMode; } impl> PadExtManual for O { @@ -858,6 +860,14 @@ impl> 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(