Commit 6d7acd20 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Element::set_bus() allows None for the bus parameter

parent 241bb823
...@@ -14151,7 +14151,10 @@ MT safe.</doc> ...@@ -14151,7 +14151,10 @@ MT safe.</doc>
<doc xml:space="preserve">a #GstElement to set the bus of.</doc> <doc xml:space="preserve">a #GstElement to set the bus of.</doc>
<type name="Element" c:type="GstElement*"/> <type name="Element" c:type="GstElement*"/>
</instance-parameter> </instance-parameter>
<parameter name="bus" transfer-ownership="none"> <parameter name="bus"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">the #GstBus to set.</doc> <doc xml:space="preserve">the #GstBus to set.</doc>
<type name="Bus" c:type="GstBus*"/> <type name="Bus" c:type="GstBus*"/>
</parameter> </parameter>
...@@ -144,7 +144,7 @@ pub trait ElementExt { ...@@ -144,7 +144,7 @@ pub trait ElementExt {
fn set_base_time(&self, time: ClockTime); fn set_base_time(&self, time: ClockTime);
fn set_bus(&self, bus: &Bus); fn set_bus<'a, P: Into<Option<&'a Bus>>>(&self, bus: P);
fn set_clock<P: IsA<Clock>>(&self, clock: &P) -> Result<(), glib::error::BoolError>; fn set_clock<P: IsA<Clock>>(&self, clock: &P) -> Result<(), glib::error::BoolError>;
...@@ -413,9 +413,11 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O { ...@@ -413,9 +413,11 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
} }
} }
fn set_bus(&self, bus: &Bus) { fn set_bus<'a, P: Into<Option<&'a Bus>>>(&self, bus: P) {
let bus = bus.into();
let bus = bus.to_glib_none();
unsafe { 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);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment