diff --git a/examples/src/launch.rs b/examples/src/launch.rs index e7d86e9f6..3bb68fe7f 100644 --- a/examples/src/launch.rs +++ b/examples/src/launch.rs @@ -2,11 +2,14 @@ extern crate gstreamer as gst; use gst::*; use std::u64; +use std::env; fn main() { + let pipeline_str = env::args().collect::>()[1..].join(" "); + gst::init().unwrap(); - let pipeline = gst::parse_launch("audiotestsrc ! autoaudiosink").unwrap(); + let pipeline = gst::parse_launch(&pipeline_str).unwrap(); let bus = pipeline.get_bus().unwrap(); let ret = pipeline.set_state(gst::State::Playing); diff --git a/examples/src/launch_glib_main.rs b/examples/src/launch_glib_main.rs index 78614a7ee..1f9922a20 100644 --- a/examples/src/launch_glib_main.rs +++ b/examples/src/launch_glib_main.rs @@ -5,14 +5,16 @@ use gst::ObjectExt as GstObjectExt; extern crate glib; use glib::*; -use std::u64; +use std::env; fn main() { + let pipeline_str = env::args().collect::>()[1..].join(" "); + gst::init().unwrap(); let main_loop = MainLoop::new(None, false); - let pipeline = gst::parse_launch("audiotestsrc ! autoaudiosink").unwrap(); + let pipeline = gst::parse_launch(&pipeline_str).unwrap(); let bus = pipeline.get_bus().unwrap(); let ret = pipeline.set_state(gst::State::Playing);