gstreamer: pad: Remove unnecessary <1.14 compatibility code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1591>
This commit is contained in:
Sebastian Dröge 2024-11-13 17:04:32 +02:00
parent 209c5eef35
commit 44006bc4f1

View file

@ -1680,22 +1680,17 @@ impl<T: IsA<Pad> + IsA<glib::Object> + glib::object::IsClass> PadBuilder<T> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
let mut type_ = T::static_type(); let mut type_ = T::static_type();
let gtype = templ.gtype();
// Since 1.14 templates can keep a pad GType with them, so we need to do some if gtype == glib::Type::UNIT {
// additional checks here now // Nothing to be done, we can create any kind of pad
if templ.has_property_with_type("gtype", glib::Type::static_type()) { } else if gtype.is_a(type_) {
let gtype = templ.property::<glib::Type>("gtype"); // We were asked to create a parent type of the template type, e.g. a gst::Pad for
// a template that wants a gst_base::AggregatorPad. Not a problem: update the type
if gtype == glib::Type::UNIT { type_ = gtype;
// Nothing to be done, we can create any kind of pad } else {
} else if gtype.is_a(type_) { // Otherwise the requested type must be a subclass of the template pad type
// We were asked to create a parent type of the template type, e.g. a gst::Pad for assert!(type_.is_a(gtype));
// a template that wants a gst_base::AggregatorPad. Not a problem: update the type
type_ = gtype;
} else {
// Otherwise the requested type must be a subclass of the template pad type
assert!(type_.is_a(gtype));
}
} }
let mut properties = [ let mut properties = [