From 6d7acd200d0d801ea6e36f9147d9570e7572e91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 20 Dec 2017 18:10:50 +0200 Subject: [PATCH] Element::set_bus() allows None for the bus parameter --- gir-files/Gst-1.0.gir | 5 ++++- gstreamer/src/auto/element.rs | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gir-files/Gst-1.0.gir b/gir-files/Gst-1.0.gir index 207d0b51a..eac4e89ec 100644 --- a/gir-files/Gst-1.0.gir +++ b/gir-files/Gst-1.0.gir @@ -14151,7 +14151,10 @@ MT safe. a #GstElement to set the bus of. - + the #GstBus to set. diff --git a/gstreamer/src/auto/element.rs b/gstreamer/src/auto/element.rs index e03b876f8..ee5f81e53 100644 --- a/gstreamer/src/auto/element.rs +++ b/gstreamer/src/auto/element.rs @@ -144,7 +144,7 @@ pub trait ElementExt { fn set_base_time(&self, time: ClockTime); - fn set_bus(&self, bus: &Bus); + fn set_bus<'a, P: Into>>(&self, bus: P); fn set_clock>(&self, clock: &P) -> Result<(), glib::error::BoolError>; @@ -413,9 +413,11 @@ impl + IsA> ElementExt for O { } } - fn set_bus(&self, bus: &Bus) { + fn set_bus<'a, P: Into>>(&self, bus: P) { + let bus = bus.into(); + let bus = bus.to_glib_none(); unsafe { - ffi::gst_element_set_bus(self.to_glib_none().0, bus.to_glib_none().0); + ffi::gst_element_set_bus(self.to_glib_none().0, bus.0); } }