From 8b71f5331a87e632165cf23e0a67524c4b482031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 28 Feb 2021 18:32:44 +0200 Subject: [PATCH] examples/tutorials: Update for new Bus::connect_message() API that takes signal details --- examples/src/bin/events.rs | 2 +- examples/src/bin/launch_glib_main.rs | 2 +- examples/src/bin/queries.rs | 2 +- tutorials/src/bin/basic-tutorial-5.rs | 6 +++--- tutorials/src/bin/basic-tutorial-8.rs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/src/bin/events.rs b/examples/src/bin/events.rs index 9d901e097..0f8b0c979 100644 --- a/examples/src/bin/events.rs +++ b/examples/src/bin/events.rs @@ -81,7 +81,7 @@ fn example_main() { }); //bus.add_signal_watch(); - //bus.connect_message(move |_, msg| { + //bus.connect_message(None, move |_, msg| { let main_loop_clone = main_loop.clone(); // This sets the bus's signal handler (don't be mislead by the "add", there can only be one). // Every message from the bus is passed through this function. Its returnvalue determines diff --git a/examples/src/bin/launch_glib_main.rs b/examples/src/bin/launch_glib_main.rs index 149333b4f..133a1edaf 100644 --- a/examples/src/bin/launch_glib_main.rs +++ b/examples/src/bin/launch_glib_main.rs @@ -34,7 +34,7 @@ fn example_main() { let main_loop_clone = main_loop.clone(); //bus.add_signal_watch(); - //bus.connect_message(move |_, msg| { + //bus.connect_message(None, move |_, msg| { bus.add_watch(move |_, msg| { use gst::MessageView; diff --git a/examples/src/bin/queries.rs b/examples/src/bin/queries.rs index 24308167c..e83a93ab3 100644 --- a/examples/src/bin/queries.rs +++ b/examples/src/bin/queries.rs @@ -94,7 +94,7 @@ fn example_main() { // Need to move a new reference into the closure. let main_loop_clone = main_loop.clone(); //bus.add_signal_watch(); - //bus.connect_message(move |_, msg| { + //bus.connect_message(None, move |_, msg| { bus.add_watch(move |_, msg| { use gst::MessageView; diff --git a/tutorials/src/bin/basic-tutorial-5.rs b/tutorials/src/bin/basic-tutorial-5.rs index 1decd3343..1970f4d94 100644 --- a/tutorials/src/bin/basic-tutorial-5.rs +++ b/tutorials/src/bin/basic-tutorial-5.rs @@ -247,7 +247,7 @@ mod tutorial5 { let bus = playbin.get_bus().unwrap(); #[allow(clippy::single_match)] - bus.connect_message(move |_, msg| match msg.view() { + bus.connect_message(Some("application"), move |_, msg| match msg.view() { gst::MessageView::Application(application) => { let pipeline = match pipeline_weak.upgrade() { Some(pipeline) => pipeline, @@ -266,7 +266,7 @@ mod tutorial5 { analyze_streams(&pipeline, &textbuf); } } - _ => (), + _ => unreachable!(), }); let vbox = gtk::Box::new(gtk::Orientation::Horizontal, 0); @@ -364,7 +364,7 @@ mod tutorial5 { bus.add_signal_watch(); let pipeline_weak = playbin.downgrade(); - bus.connect_message(move |_, msg| { + bus.connect_message(None, move |_, msg| { let pipeline = match pipeline_weak.upgrade() { Some(pipeline) => pipeline, None => return, diff --git a/tutorials/src/bin/basic-tutorial-8.rs b/tutorials/src/bin/basic-tutorial-8.rs index 771090e80..fdd73d508 100644 --- a/tutorials/src/bin/basic-tutorial-8.rs +++ b/tutorials/src/bin/basic-tutorial-8.rs @@ -240,7 +240,7 @@ fn main() { let main_loop_clone = main_loop.clone(); let bus = pipeline.get_bus().unwrap(); #[allow(clippy::single_match)] - bus.connect_message(move |_, msg| match msg.view() { + bus.connect_message(Some("error"), move |_, msg| match msg.view() { gst::MessageView::Error(err) => { let main_loop = &main_loop_clone; eprintln!( @@ -251,7 +251,7 @@ fn main() { eprintln!("Debugging information: {:?}", err.get_debug()); main_loop.quit(); } - _ => (), + _ => unreachable!(), }); bus.add_signal_watch();