From 9fd768425e2985585d9091e9eb2983f81cd02f81 Mon Sep 17 00:00:00 2001 From: Marijn Suijten Date: Wed, 26 May 2021 10:37:18 +0200 Subject: [PATCH] Rename request_pad_simple to avoid 1.19.1 clash Fixes: 3f442d977 ("prep for regen: relaxed get fn identification") --- gstreamer/Gir.toml | 5 ++++- gstreamer/src/element.rs | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gstreamer/Gir.toml b/gstreamer/Gir.toml index c1f214c09..23437b913 100644 --- a/gstreamer/Gir.toml +++ b/gstreamer/Gir.toml @@ -755,8 +755,11 @@ manual_traits = ["ElementExtManual"] [[object.function]] name = "get_request_pad" - # rename to more explicite name and avoid conflict with `request_pad` + # rename to more explicit name and avoid conflict with `request_pad` + # TODO: request_pad_simple is now _also_ in the 1.20 bindings! rename = "request_pad_simple" + # Renamed version only available in not(1.20) + manual = true [[object.function]] name = "post_message" diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index b322352a7..d2e21c47e 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -268,6 +268,12 @@ pub trait ElementExtManual: 'static { fn current_running_time(&self) -> crate::ClockTime; #[doc(alias = "get_current_clock_time")] fn current_clock_time(&self) -> crate::ClockTime; + + #[cfg(not(feature = "v1_20"))] + #[cfg_attr(feature = "dox", doc(cfg(not(feature = "v1_20"))))] + #[doc(alias = "gst_element_get_request_pad")] + #[doc(alias = "get_request_pad")] + fn request_pad_simple(&self, name: &str) -> Option; } impl> ElementExtManual for O { @@ -787,6 +793,16 @@ impl> ElementExtManual for O { crate::CLOCK_TIME_NONE } } + + #[cfg(not(feature = "v1_20"))] + fn request_pad_simple(&self, name: &str) -> Option { + unsafe { + from_glib_full(ffi::gst_element_get_request_pad( + self.as_ref().to_glib_none().0, + name.to_glib_none().0, + )) + } + } } pub unsafe trait ElementClassExt {