Commit 210119d9 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵
Browse files

Element::set_clock() allows None for the clock parameter

parent 6d7acd20
......@@ -14177,7 +14177,10 @@ MT safe.</doc>
<doc xml:space="preserve">a #GstElement to set the clock for.</doc>
<type name="Element" c:type="GstElement*"/>
</instance-parameter>
<parameter name="clock" transfer-ownership="none">
<parameter name="clock"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">the #GstClock to set for the element.</doc>
<type name="Clock" c:type="GstClock*"/>
</parameter>
......@@ -146,7 +146,7 @@ pub trait ElementExt {
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<'a, P: IsA<Clock> + 'a, Q: Into<Option<&'a P>>>(&self, clock: Q) -> Result<(), glib::error::BoolError>;
fn set_context(&self, context: &Context);
......@@ -421,9 +421,11 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
fn set_clock<P: IsA<Clock>>(&self, clock: &P) -> Result<(), glib::error::BoolError> {
fn set_clock<'a, P: IsA<Clock> + 'a, Q: Into<Option<&'a P>>>(&self, clock: Q) -> Result<(), glib::error::BoolError> {
let clock = clock.into();
let clock = clock.to_glib_none();
unsafe {
glib::error::BoolError::from_glib(ffi::gst_element_set_clock(self.to_glib_none().0, clock.to_glib_none().0), "Failed to set clock")
glib::error::BoolError::from_glib(ffi::gst_element_set_clock(self.to_glib_none().0, clock.0), "Failed to set clock")
}
}
......
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