diff --git a/examples/src/bin/playbin.rs b/examples/src/bin/playbin.rs index ed5c5c7a1..9af63b796 100644 --- a/examples/src/bin/playbin.rs +++ b/examples/src/bin/playbin.rs @@ -75,8 +75,7 @@ fn example_main() { // application is via properties, signals or action signals (or custom messages, events, queries). // So what the following code does, is essentially asking playbin to tell us its already // internally stored tag list for this stream index. - let tags = playbin.emit_by_name("get-audio-tags", &[&idx]).unwrap(); - let tags = tags.get::().expect("tags"); + let tags = playbin.emit_by_name::("get-audio-tags", &[&idx]); if let Some(artist) = tags.get::() { println!(" Artist: {}", artist.get()); diff --git a/examples/src/bin/rtpfecclient.rs b/examples/src/bin/rtpfecclient.rs index cbb48516b..dee33657f 100644 --- a/examples/src/bin/rtpfecclient.rs +++ b/examples/src/bin/rtpfecclient.rs @@ -84,11 +84,7 @@ fn connect_rtpbin_srcpad(src_pad: &gst::Pad, sink: &gst::Element) -> Result<(), fn make_fec_decoder(rtpbin: &gst::Element, sess_id: u32) -> Result { let fecdec = make_element("rtpulpfecdec", None)?; - let internal_storage = rtpbin - .emit_by_name("get-internal-storage", &[&sess_id]) - .unwrap() - .get::() - .unwrap(); + let internal_storage = rtpbin.emit_by_name::("get-internal-storage", &[&sess_id]); fecdec.set_property("storage", &internal_storage); fecdec.set_property("pt", 100u32); diff --git a/tutorials/src/bin/basic-tutorial-5.rs b/tutorials/src/bin/basic-tutorial-5.rs index e558ca9e7..6636913f3 100644 --- a/tutorials/src/bin/basic-tutorial-5.rs +++ b/tutorials/src/bin/basic-tutorial-5.rs @@ -42,26 +42,24 @@ mod tutorial5 { let x = playbin.property::(propname); for i in 0..x { - let tags = playbin.emit_by_name(signame, &[&i]).unwrap(); + let tags = playbin.emit_by_name::(signame, &[&i]); - if let Ok(Some(tags)) = tags.get::>() { - textbuf.insert_at_cursor(&format!("{} stream {}:\n ", stype, i)); + textbuf.insert_at_cursor(&format!("{} stream {}:\n ", stype, i)); - if let Some(codec) = tags.get::() { - textbuf.insert_at_cursor(&format!(" codec: {} \n", codec.get())); - } + if let Some(codec) = tags.get::() { + textbuf.insert_at_cursor(&format!(" codec: {} \n", codec.get())); + } - if let Some(codec) = tags.get::() { - textbuf.insert_at_cursor(&format!(" codec: {} \n", codec.get())); - } + if let Some(codec) = tags.get::() { + textbuf.insert_at_cursor(&format!(" codec: {} \n", codec.get())); + } - if let Some(lang) = tags.get::() { - textbuf.insert_at_cursor(&format!(" language: {} \n", lang.get())); - } + if let Some(lang) = tags.get::() { + textbuf.insert_at_cursor(&format!(" language: {} \n", lang.get())); + } - if let Some(bitrate) = tags.get::() { - textbuf.insert_at_cursor(&format!(" bitrate: {} \n", bitrate.get())); - } + if let Some(bitrate) = tags.get::() { + textbuf.insert_at_cursor(&format!(" bitrate: {} \n", bitrate.get())); } } } diff --git a/tutorials/src/bin/playback-tutorial-1.rs b/tutorials/src/bin/playback-tutorial-1.rs index 79c48447b..b082be919 100644 --- a/tutorials/src/bin/playback-tutorial-1.rs +++ b/tutorials/src/bin/playback-tutorial-1.rs @@ -21,41 +21,35 @@ fn analyze_streams(playbin: &gst::Element) { ); for i in 0..n_video { - let tags = playbin.emit_by_name("get-video-tags", &[&i]).unwrap(); + let tags = playbin.emit_by_name::("get-video-tags", &[&i]); - if let Ok(tags) = tags.get::() { - println!("video stream {}:", i); - if let Some(codec) = tags.get::() { - println!(" codec: {}", codec.get()); - } + println!("video stream {}:", i); + if let Some(codec) = tags.get::() { + println!(" codec: {}", codec.get()); } } for i in 0..n_audio { - let tags = playbin.emit_by_name("get-audio-tags", &[&i]).unwrap(); + let tags = playbin.emit_by_name::("get-audio-tags", &[&i]); - if let Ok(tags) = tags.get::() { - println!("audio stream {}:", i); - if let Some(codec) = tags.get::() { - println!(" codec: {}", codec.get()); - } - if let Some(codec) = tags.get::() { - println!(" language: {}", codec.get()); - } - if let Some(codec) = tags.get::() { - println!(" bitrate: {}", codec.get()); - } + println!("audio stream {}:", i); + if let Some(codec) = tags.get::() { + println!(" codec: {}", codec.get()); + } + if let Some(codec) = tags.get::() { + println!(" language: {}", codec.get()); + } + if let Some(codec) = tags.get::() { + println!(" bitrate: {}", codec.get()); } } for i in 0..n_text { - let tags = playbin.emit_by_name("get-text-tags", &[&i]).unwrap(); + let tags = playbin.emit_by_name::("get-text-tags", &[&i]); - if let Ok(tags) = tags.get::() { - println!("subtitle stream {}:", i); - if let Some(codec) = tags.get::() { - println!(" language: {}", codec.get()); - } + println!("subtitle stream {}:", i); + if let Some(codec) = tags.get::() { + println!(" language: {}", codec.get()); } }