mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-06-10 10:19:25 +00:00
Convert launch examples to get the pipeline string from the commandline
This commit is contained in:
parent
9cfb83d6a2
commit
6461be1372
|
@ -2,11 +2,14 @@ extern crate gstreamer as gst;
|
||||||
use gst::*;
|
use gst::*;
|
||||||
|
|
||||||
use std::u64;
|
use std::u64;
|
||||||
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let pipeline_str = env::args().collect::<Vec<String>>()[1..].join(" ");
|
||||||
|
|
||||||
gst::init().unwrap();
|
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 bus = pipeline.get_bus().unwrap();
|
||||||
|
|
||||||
let ret = pipeline.set_state(gst::State::Playing);
|
let ret = pipeline.set_state(gst::State::Playing);
|
||||||
|
|
|
@ -5,14 +5,16 @@ use gst::ObjectExt as GstObjectExt;
|
||||||
extern crate glib;
|
extern crate glib;
|
||||||
use glib::*;
|
use glib::*;
|
||||||
|
|
||||||
use std::u64;
|
use std::env;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
let pipeline_str = env::args().collect::<Vec<String>>()[1..].join(" ");
|
||||||
|
|
||||||
gst::init().unwrap();
|
gst::init().unwrap();
|
||||||
|
|
||||||
let main_loop = MainLoop::new(None, false);
|
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 bus = pipeline.get_bus().unwrap();
|
||||||
|
|
||||||
let ret = pipeline.set_state(gst::State::Playing);
|
let ret = pipeline.set_state(gst::State::Playing);
|
||||||
|
|
Loading…
Reference in a new issue