From 24b8b383d8fae27277814b9473edeb96c7ddb625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 8 Sep 2017 16:33:09 +0300 Subject: [PATCH] Add comments from the C tutorial to basic-tutorial-1 --- tutorials/src/bin/basic-tutorial-1.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tutorials/src/bin/basic-tutorial-1.rs b/tutorials/src/bin/basic-tutorial-1.rs index 19fec3c8f..166f857bf 100644 --- a/tutorials/src/bin/basic-tutorial-1.rs +++ b/tutorials/src/bin/basic-tutorial-1.rs @@ -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); }