2017-09-17 11:59:01 +00:00
|
|
|
extern crate gstreamer as gst;
|
|
|
|
use gst::prelude::*;
|
|
|
|
|
2017-11-12 18:07:02 +00:00
|
|
|
#[path = "../examples-common.rs"]
|
|
|
|
mod examples_common;
|
|
|
|
|
|
|
|
fn example_main() {
|
2017-09-17 11:59:01 +00:00
|
|
|
gst::init().unwrap();
|
|
|
|
|
|
|
|
let identity = gst::ElementFactory::make("identity", None).unwrap();
|
2017-09-17 15:41:02 +00:00
|
|
|
let mut iter = identity.iterate_pads();
|
2017-09-17 11:59:01 +00:00
|
|
|
while let Some(res) = iter.next() {
|
|
|
|
match res {
|
2017-09-17 15:41:02 +00:00
|
|
|
Ok(pad) => println!("Pad: {}", pad.get_name()),
|
2017-09-17 11:59:01 +00:00
|
|
|
Err(gst::IteratorError::Resync) => {
|
|
|
|
println!("Iterator resync");
|
|
|
|
iter.resync();
|
|
|
|
}
|
|
|
|
Err(gst::IteratorError::Error) => {
|
|
|
|
println!("Error");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-11-12 18:07:02 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// tutorials_common::run is only required to set up the application environent on macOS
|
|
|
|
// (but not necessary in normal Cocoa applications where this is set up autmatically)
|
|
|
|
examples_common::run(example_main);
|
|
|
|
}
|