Rename request_pad_simple to avoid 1.19.1 clash

Fixes: 3f442d977 ("prep for regen: relaxed get fn identification")
This commit is contained in:
Marijn Suijten 2021-05-26 10:37:18 +02:00
parent a7d559116d
commit 9fd768425e
2 changed files with 20 additions and 1 deletions

View file

@ -755,8 +755,11 @@ manual_traits = ["ElementExtManual"]
[[object.function]] [[object.function]]
name = "get_request_pad" 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" rename = "request_pad_simple"
# Renamed version only available in not(1.20)
manual = true
[[object.function]] [[object.function]]
name = "post_message" name = "post_message"

View file

@ -268,6 +268,12 @@ pub trait ElementExtManual: 'static {
fn current_running_time(&self) -> crate::ClockTime; fn current_running_time(&self) -> crate::ClockTime;
#[doc(alias = "get_current_clock_time")] #[doc(alias = "get_current_clock_time")]
fn current_clock_time(&self) -> crate::ClockTime; 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<Pad>;
} }
impl<O: IsA<Element>> ElementExtManual for O { impl<O: IsA<Element>> ElementExtManual for O {
@ -787,6 +793,16 @@ impl<O: IsA<Element>> ElementExtManual for O {
crate::CLOCK_TIME_NONE crate::CLOCK_TIME_NONE
} }
} }
#[cfg(not(feature = "v1_20"))]
fn request_pad_simple(&self, name: &str) -> Option<Pad> {
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 { pub unsafe trait ElementClassExt {