mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 00:26:31 +00:00
Add comments from the C tutorial to basic-tutorial-1
This commit is contained in:
parent
6f6db8ac47
commit
24b8b383d8
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue