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 /video/videofx | |
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 'video/videofx')
-rw-r--r-- | video/videofx/src/videocompare/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/video/videofx/src/videocompare/mod.rs b/video/videofx/src/videocompare/mod.rs index 67bccd4f1..a31493ace 100644 --- a/video/videofx/src/videocompare/mod.rs +++ b/video/videofx/src/videocompare/mod.rs @@ -200,7 +200,9 @@ mod test { let mut message = VideoCompareMessage::default(); message.pad_distances.push(PadDistance { - pad: gst::Pad::new(Some("sink_0"), gst::PadDirection::Sink), + pad: gst::Pad::builder(gst::PadDirection::Sink) + .name("sink_0") + .build(), distance: 42_f64, }); message.running_time = Some(running_time); @@ -236,7 +238,9 @@ mod test { gst::Array::from_iter([gst::Structure::builder("pad-distance") .field( "pad", - gst::Pad::new(Some("sink_0"), gst::PadDirection::Sink), + gst::Pad::builder(gst::PadDirection::Sink) + .name("sink_0") + .build(), ) .field("distance", 42f64) .build() |