diff options
Diffstat (limited to 'tutorial/src/sinesrc/imp.rs')
-rw-r--r-- | tutorial/src/sinesrc/imp.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs index d87025ce4..38811fc49 100644 --- a/tutorial/src/sinesrc/imp.rs +++ b/tutorial/src/sinesrc/imp.rs @@ -19,7 +19,7 @@ use byte_slice_cast::*; use std::ops::Rem; use std::sync::Mutex; -use std::{i32, u32}; +use std::u32; use num_traits::cast::NumCast; use num_traits::float::Float; @@ -352,17 +352,8 @@ 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::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)) + let caps = gst_audio::AudioCapsBuilder::new_interleaved() + .format_list([gst_audio::AUDIO_FORMAT_F32, gst_audio::AUDIO_FORMAT_F64]) .build(); // The src pad template must be named "src" for basesrc // and specific a pad that is always there |