Commit 24b8b383 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Add comments from the C tutorial to basic-tutorial-1

parent 6f6db8ac
......@@ -4,16 +4,19 @@ use gst::prelude::*;
use std::u64;
fn main() {
// Initialize GStreamer
gst::init().unwrap();
// Build the pipeline
let uri = "https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm";
let pipeline = gst::parse_launch(&format!("playbin uri={}", uri)).unwrap();
// Start playing
let ret = pipeline.set_state(gst::State::Playing);
assert_ne!(ret, gst::StateChangeReturn::Failure);
// Wait until error or EOS
let bus = pipeline.get_bus().unwrap();
loop {
use gst::MessageView;
......@@ -37,6 +40,7 @@ fn main() {
}
}
// Shutdown pipeline
let ret = pipeline.set_state(gst::State::Null);
assert_ne!(ret, gst::StateChangeReturn::Failure);
}
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