Commit 6461be13 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Convert launch examples to get the pipeline string from the commandline

parent 9cfb83d6
......@@ -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::<Vec<String>>()[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);
......
......@@ -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::<Vec<String>>()[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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment