diff options
Diffstat (limited to 'tutorial/src/sinesrc/imp.rs')
-rw-r--r-- | tutorial/src/sinesrc/imp.rs | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs index 938556a7f..4ada4ddd0 100644 --- a/tutorial/src/sinesrc/imp.rs +++ b/tutorial/src/sinesrc/imp.rs @@ -360,21 +360,18 @@ impl ElementImpl for SineSrc { static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| { // On the src pad, we can produce F32/F64 with any sample rate // and any number of channels - let caps = gst::Caps::new_simple( - "audio/x-raw", - &[ - ( - "format", - &gst::List::new(&[ - &gst_audio::AUDIO_FORMAT_F32.to_str(), - &gst_audio::AUDIO_FORMAT_F64.to_str(), - ]), - ), - ("layout", &"interleaved"), - ("rate", &gst::IntRange::<i32>::new(1, i32::MAX)), - ("channels", &gst::IntRange::<i32>::new(1, i32::MAX)), - ], - ); + let caps = gst::Caps::builder("audio/x-raw") + .field( + "format", + gst::List::new([ + gst_audio::AUDIO_FORMAT_F32.to_str(), + gst_audio::AUDIO_FORMAT_F64.to_str(), + ]), + ) + .field("layout", "interleaved") + .field("rate", gst::IntRange::new(1, i32::MAX)) + .field("channels", gst::IntRange::new(1, i32::MAX)) + .build(); // The src pad template must be named "src" for basesrc // and specific a pad that is always there let src_pad_template = gst::PadTemplate::new( |