From 39ef834cfeea105a484cce227e658ba6242d9993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 13 Aug 2019 18:00:17 +0300 Subject: [PATCH] examples: Fix compilation after GValue API changes --- examples/src/bin/decodebin.rs | 1 + examples/src/bin/encodebin.rs | 1 + examples/src/bin/glupload.rs | 3 ++- examples/src/bin/gtksink.rs | 4 ++-- examples/src/bin/pango-cairo.rs | 12 ++++++------ 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/examples/src/bin/decodebin.rs b/examples/src/bin/decodebin.rs index 0e8dd357e..7b3a64c9b 100644 --- a/examples/src/bin/decodebin.rs +++ b/examples/src/bin/decodebin.rs @@ -271,6 +271,7 @@ fn example_main() -> Result<(), Error> { // application's execution. Some(details) if details.get_name() == "error-details" => details .get::<&ErrorValue>("error") + .unwrap() .and_then(|v| v.0.lock().unwrap().take()) .map(Result::Err) .expect("error-details message without actual error"), diff --git a/examples/src/bin/encodebin.rs b/examples/src/bin/encodebin.rs index daedfd705..c3707d555 100644 --- a/examples/src/bin/encodebin.rs +++ b/examples/src/bin/encodebin.rs @@ -299,6 +299,7 @@ fn example_main() -> Result<(), Error> { match err.get_details() { Some(details) if details.get_name() == "error-details" => details .get::<&ErrorValue>("error") + .unwrap() .cloned() .and_then(|v| v.0.lock().unwrap().take()) .map(Result::Err) diff --git a/examples/src/bin/glupload.rs b/examples/src/bin/glupload.rs index d6e72cf0f..739db6850 100644 --- a/examples/src/bin/glupload.rs +++ b/examples/src/bin/glupload.rs @@ -659,7 +659,8 @@ fn main_loop(mut app: App) -> Result(); + .get::() + .unwrap(); } let sync_meta = buffer.get_meta::().unwrap(); diff --git a/examples/src/bin/gtksink.rs b/examples/src/bin/gtksink.rs index f7f984ab2..839685ab0 100644 --- a/examples/src/bin/gtksink.rs +++ b/examples/src/bin/gtksink.rs @@ -45,7 +45,7 @@ fn create_ui(app: >k::Application) { // The gtkglsink creates the gtk widget for us. This is accessible through a property. // So we get it and use it later to add it to our gui. let widget = gtkglsink.get_property("widget").unwrap(); - (glsinkbin, widget.get::().unwrap()) + (glsinkbin, widget.get::().unwrap().unwrap()) } else { // Unfortunately, using the OpenGL widget didn't work out, so we will have to render // our frames manually, using the CPU. An example why this may fail is, when @@ -54,7 +54,7 @@ fn create_ui(app: >k::Application) { // The gtksink creates the gtk widget for us. This is accessible through a property. // So we get it and use it later to add it to our gui. let widget = sink.get_property("widget").unwrap(); - (sink, widget.get::().unwrap()) + (sink, widget.get::().unwrap().unwrap()) }; pipeline.add_many(&[&src, &sink]).unwrap(); diff --git a/examples/src/bin/pango-cairo.rs b/examples/src/bin/pango-cairo.rs index 0bc5bd7f1..05e9423fc 100644 --- a/examples/src/bin/pango-cairo.rs +++ b/examples/src/bin/pango-cairo.rs @@ -148,12 +148,12 @@ fn create_pipeline() -> Result { let drawer = drawer.lock().unwrap(); // Get the signal's arguments - let _overlay = args[0].get::().unwrap(); + let _overlay = args[0].get::().unwrap().unwrap(); // This is the cairo context. This is the root of all of cairo's // drawing functionality. - let cr = args[1].get::().unwrap(); - let timestamp = args[2].get::().unwrap(); - let _duration = args[3].get::().unwrap(); + let cr = args[1].get::().unwrap().unwrap(); + let timestamp = args[2].get_some::().unwrap(); + let _duration = args[3].get_some::().unwrap(); let info = drawer.info.as_ref().unwrap(); let layout = drawer.layout.borrow(); @@ -223,8 +223,8 @@ fn create_pipeline() -> Result { // stream that dynamically changes resolution when enough bandwith is available. overlay .connect("caps-changed", false, move |args| { - let _overlay = args[0].get::().unwrap(); - let caps = args[1].get::().unwrap(); + let _overlay = args[0].get::().unwrap().unwrap(); + let caps = args[1].get::().unwrap().unwrap(); let drawer = &drawer_clone; let mut drawer = drawer.lock().unwrap();