mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-09 00:35:41 +00:00
SystemClock::set_default() can accept None
This commit is contained in:
parent
95c9f92549
commit
f439f14ec3
2 changed files with 9 additions and 4 deletions
|
@ -38017,7 +38017,10 @@ MT safe.</doc>
|
|||
<type name="none" c:type="void"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<parameter name="new_clock" transfer-ownership="none">
|
||||
<parameter name="new_clock"
|
||||
transfer-ownership="none"
|
||||
nullable="1"
|
||||
allow-none="1">
|
||||
<doc xml:space="preserve">a #GstClock</doc>
|
||||
<type name="Clock" c:type="GstClock*"/>
|
||||
</parameter>
|
||||
|
|
|
@ -36,10 +36,12 @@ impl SystemClock {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn set_default<P: IsA<Clock>>(new_clock: &P) {
|
||||
skip_assert_initialized!();
|
||||
pub fn set_default<'a, P: IsA<Clock> + 'a, Q: Into<Option<&'a P>>>(new_clock: Q) {
|
||||
assert_initialized_main_thread!();
|
||||
let new_clock = new_clock.into();
|
||||
let new_clock = new_clock.to_glib_none();
|
||||
unsafe {
|
||||
ffi::gst_system_clock_set_default(new_clock.to_glib_none().0);
|
||||
ffi::gst_system_clock_set_default(new_clock.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue