mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-05 17:19:42 +00:00
Element::set_bus() allows None for the bus parameter
This commit is contained in:
parent
241bb823d5
commit
6d7acd200d
2 changed files with 9 additions and 4 deletions
|
@ -14151,7 +14151,10 @@ MT safe.</doc>
|
|||
<doc xml:space="preserve">a #GstElement to set the bus of.</doc>
|
||||
<type name="Element" c:type="GstElement*"/>
|
||||
</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>
|
||||
<type name="Bus" c:type="GstBus*"/>
|
||||
</parameter>
|
||||
|
|
|
@ -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<Option<&'a Bus>>>(&self, bus: P);
|
||||
|
||||
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 {
|
|||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue