diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 75b20b773..6730bcaf0 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -1680,22 +1680,17 @@ impl + IsA + glib::object::IsClass> PadBuilder { assert_initialized_main_thread!(); 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 - // additional checks here now - if templ.has_property_with_type("gtype", glib::Type::static_type()) { - let gtype = templ.property::("gtype"); - - if gtype == glib::Type::UNIT { - // Nothing to be done, we can create any kind of pad - } else if gtype.is_a(type_) { - // 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 - type_ = gtype; - } else { - // Otherwise the requested type must be a subclass of the template pad type - assert!(type_.is_a(gtype)); - } + if gtype == glib::Type::UNIT { + // Nothing to be done, we can create any kind of pad + } else if gtype.is_a(type_) { + // 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 + type_ = gtype; + } else { + // Otherwise the requested type must be a subclass of the template pad type + assert!(type_.is_a(gtype)); } let mut properties = [