forked from mirrors/gstreamer-rs
tutorials: Add resample element to the pipeline in tutorials 3
This commit is contained in:
parent
7d28106c2e
commit
6752ef8a69
1 changed files with 6 additions and 2 deletions
|
@ -15,14 +15,18 @@ fn tutorial_main() {
|
||||||
.expect("Could not create convert element.");
|
.expect("Could not create convert element.");
|
||||||
let sink = gst::ElementFactory::make("autoaudiosink", Some("sink"))
|
let sink = gst::ElementFactory::make("autoaudiosink", Some("sink"))
|
||||||
.expect("Could not create sink element.");
|
.expect("Could not create sink element.");
|
||||||
|
let resample = gst::ElementFactory::make("audioresample", Some("resample"))
|
||||||
|
.expect("Could not create resample element.");
|
||||||
|
|
||||||
// Create the empty pipeline
|
// Create the empty pipeline
|
||||||
let pipeline = gst::Pipeline::new(Some("test-pipeline"));
|
let pipeline = gst::Pipeline::new(Some("test-pipeline"));
|
||||||
|
|
||||||
// Build the pipeline Note that we are NOT linking the source at this
|
// Build the pipeline Note that we are NOT linking the source at this
|
||||||
// point. We will do it later.
|
// point. We will do it later.
|
||||||
pipeline.add_many(&[&source, &convert, &sink]).unwrap();
|
pipeline
|
||||||
convert.link(&sink).expect("Elements could not be linked.");
|
.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
|
// Set the URI to play
|
||||||
let uri =
|
let uri =
|
||||||
|
|
Loading…
Reference in a new issue