diff --git a/examples/src/bin/playbin.rs b/examples/src/bin/playbin.rs index 9af63b796..b6c2a44f5 100644 --- a/examples/src/bin/playbin.rs +++ b/examples/src/bin/playbin.rs @@ -75,18 +75,20 @@ 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]); + let tags = playbin.emit_by_name::>("get-audio-tags", &[&idx]); - if let Some(artist) = tags.get::() { - println!(" Artist: {}", artist.get()); - } + if let Some(tags) = tags { + if let Some(artist) = tags.get::() { + println!(" Artist: {}", artist.get()); + } - if let Some(title) = tags.get::() { - println!(" Title: {}", title.get()); - } + if let Some(title) = tags.get::() { + println!(" Title: {}", title.get()); + } - if let Some(album) = tags.get::() { - println!(" Album: {}", album.get()); + if let Some(album) = tags.get::() { + println!(" Album: {}", album.get()); + } } None diff --git a/tutorials/src/bin/basic-tutorial-5.rs b/tutorials/src/bin/basic-tutorial-5.rs index 6636913f3..72369d16b 100644 --- a/tutorials/src/bin/basic-tutorial-5.rs +++ b/tutorials/src/bin/basic-tutorial-5.rs @@ -42,24 +42,26 @@ mod tutorial5 { let x = playbin.property::(propname); for i in 0..x { - let tags = playbin.emit_by_name::(signame, &[&i]); + let tags = playbin.emit_by_name::>(signame, &[&i]); - textbuf.insert_at_cursor(&format!("{} stream {}:\n ", stype, i)); + if let Some(tags) = tags { + 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 b082be919..1366ea0a4 100644 --- a/tutorials/src/bin/playback-tutorial-1.rs +++ b/tutorials/src/bin/playback-tutorial-1.rs @@ -21,35 +21,41 @@ fn analyze_streams(playbin: &gst::Element) { ); for i in 0..n_video { - let tags = playbin.emit_by_name::("get-video-tags", &[&i]); + let tags = playbin.emit_by_name::>("get-video-tags", &[&i]); - println!("video stream {}:", i); - if let Some(codec) = tags.get::() { - println!(" codec: {}", codec.get()); + if let Some(tags) = tags { + 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]); + let tags = playbin.emit_by_name::>("get-audio-tags", &[&i]); - 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()); + if let Some(tags) = tags { + 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]); + let tags = playbin.emit_by_name::>("get-text-tags", &[&i]); - println!("subtitle stream {}:", i); - if let Some(codec) = tags.get::() { - println!(" language: {}", codec.get()); + if let Some(tags) = tags { + println!("subtitle stream {}:", i); + if let Some(codec) = tags.get::() { + println!(" language: {}", codec.get()); + } } }