diff options
author | François Laignel <francois@centricular.com> | 2023-05-10 18:02:08 +0300 |
---|---|---|
committer | François Laignel <francois@centricular.com> | 2023-05-12 13:55:31 +0300 |
commit | 7ba0073052c81c8f2f1ebe500048ed6d974e81d8 (patch) | |
tree | 26a4f2b74ac8a7129b6ecc95e8affcb302aa1bc2 /mux | |
parent | 8e93d294e5a61a94f14e812bef59cd0e529494e1 (diff) |
use Pad builders for optional name definition
Also, apply auto-naming in the following cases
* When building from a non wildcard-named template, the name of the template is
automatically assigned to the Pad. User can override with a specific name by
calling `name()` on the `PadBuilder`.
* When building with a target and no name was provided via the above, the
GhostPad is named after the target.
See https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/448
Auto-naming discussion: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1255#note_1891181
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1197>
Diffstat (limited to 'mux')
-rw-r--r-- | mux/flavors/src/flvdemux/imp.rs | 4 | ||||
-rw-r--r-- | mux/fmp4/src/fmp4mux/imp.rs | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/mux/flavors/src/flvdemux/imp.rs b/mux/flavors/src/flvdemux/imp.rs index d92f2376..528d3dae 100644 --- a/mux/flavors/src/flvdemux/imp.rs +++ b/mux/flavors/src/flvdemux/imp.rs @@ -129,7 +129,7 @@ impl ObjectSubclass for FlvDemux { fn with_class(klass: &Self::Class) -> Self { let templ = klass.pad_template("sink").unwrap(); - let sinkpad = gst::Pad::builder_with_template(&templ, Some("sink")) + let sinkpad = gst::Pad::builder_from_template(&templ) .activate_function(|pad, parent| { FlvDemux::catch_panic_pad_function( parent, @@ -620,7 +620,7 @@ impl FlvDemux { fn create_srcpad(&self, name: &str, caps: &gst::Caps) -> gst::Pad { let templ = self.obj().element_class().pad_template(name).unwrap(); - let srcpad = gst::Pad::builder_with_template(&templ, Some(name)) + let srcpad = gst::Pad::builder_from_template(&templ) .event_function(|pad, parent, event| { FlvDemux::catch_panic_pad_function( parent, diff --git a/mux/fmp4/src/fmp4mux/imp.rs b/mux/fmp4/src/fmp4mux/imp.rs index d96f0199..ae913571 100644 --- a/mux/fmp4/src/fmp4mux/imp.rs +++ b/mux/fmp4/src/fmp4mux/imp.rs @@ -2890,10 +2890,9 @@ impl ObjectImpl for FMP4Mux { templ.presence() == gst::PadPresence::Always && templ.direction() == gst::PadDirection::Sink }) { - let sinkpad = - gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ, Some("sink")) - .flags(gst::PadFlags::ACCEPT_INTERSECT) - .build(); + let sinkpad = gst::PadBuilder::<gst_base::AggregatorPad>::from_template(&templ) + .flags(gst::PadFlags::ACCEPT_INTERSECT) + .build(); obj.add_pad(&sinkpad).unwrap(); } |