From f2729fb730d6904d462bba513313a6e114100ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 20 Dec 2017 18:44:57 +0200 Subject: [PATCH] Preset::set_app_dir() returning false is an error, make it a Result --- Gir_Gst.toml | 10 +++++++++- gstreamer/src/auto/preset.rs | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 256f26860..72e995a38 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -50,7 +50,6 @@ generate = [ "Gst.PadMode", "Gst.SchedulingFlags", "Gst.ChildProxy", - "Gst.Preset", "Gst.TagSetter", "Gst.QOSType", "Gst.EventType", @@ -768,6 +767,15 @@ trait = false [object.function.return] bool_return_is_error = "Failed to add plugin" +[[object]] +name = "Gst.Preset" +status = "generate" + + [[object.function]] + name = "set_app_dir" + [object.function.return] + bool_return_is_error = "Failed to set app preset directory" + [[object]] name = "Gst.*" status = "generate" diff --git a/gstreamer/src/auto/preset.rs b/gstreamer/src/auto/preset.rs index 55cbc45f2..d941a514d 100644 --- a/gstreamer/src/auto/preset.rs +++ b/gstreamer/src/auto/preset.rs @@ -2,6 +2,7 @@ // DO NOT EDIT use ffi; +use glib; use glib::object::IsA; use glib::translate::*; use glib_ffi; @@ -25,10 +26,10 @@ impl Preset { } } - pub fn set_app_dir(app_dir: &str) -> bool { + pub fn set_app_dir(app_dir: &str) -> Result<(), glib::error::BoolError> { assert_initialized_main_thread!(); unsafe { - from_glib(ffi::gst_preset_set_app_dir(app_dir.to_glib_none().0)) + glib::error::BoolError::from_glib(ffi::gst_preset_set_app_dir(app_dir.to_glib_none().0), "Failed to set app preset directory") } } }