mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-26 01:50:33 +00:00
Convert launch examples to get the pipeline string from the commandline
This commit is contained in:
parent
9cfb83d6a2
commit
6461be1372
2 changed files with 8 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue