From 6752ef8a696a99cb6b1c7165b20e8e02b2d9c0f2 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 10 Jul 2020 10:35:57 +0200 Subject: [PATCH] tutorials: Add resample element to the pipeline in tutorials 3 --- tutorials/src/bin/basic-tutorial-3.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tutorials/src/bin/basic-tutorial-3.rs b/tutorials/src/bin/basic-tutorial-3.rs index c646cb387..019618d2c 100644 --- a/tutorials/src/bin/basic-tutorial-3.rs +++ b/tutorials/src/bin/basic-tutorial-3.rs @@ -15,14 +15,18 @@ fn tutorial_main() { .expect("Could not create convert element."); let sink = gst::ElementFactory::make("autoaudiosink", Some("sink")) .expect("Could not create sink element."); + let resample = gst::ElementFactory::make("audioresample", Some("resample")) + .expect("Could not create resample element."); // Create the empty pipeline let pipeline = gst::Pipeline::new(Some("test-pipeline")); // Build the pipeline Note that we are NOT linking the source at this // point. We will do it later. - pipeline.add_many(&[&source, &convert, &sink]).unwrap(); - convert.link(&sink).expect("Elements could not be linked."); + pipeline + .add_many(&[&source, &convert, &resample, &sink]) + .unwrap(); + gst::Element::link_many(&[&convert, &resample, &sink]).expect("Elements could not be linked."); // Set the URI to play let uri =