regen: gst: Clock: fix some non-optional return types

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1739>
This commit is contained in:
François Laignel 2025-06-17 15:00:02 +02:00
parent 2f749824e6
commit d2bc24f085

View file

@ -137,12 +137,13 @@ pub trait ClockExt: IsA<Clock> + 'static {
}
#[doc(alias = "gst_clock_adjust_unlocked")]
fn adjust_unlocked(&self, internal: ClockTime) -> Option<ClockTime> {
fn adjust_unlocked(&self, internal: ClockTime) -> ClockTime {
unsafe {
from_glib(ffi::gst_clock_adjust_unlocked(
try_from_glib(ffi::gst_clock_adjust_unlocked(
self.as_ref().to_glib_none().0,
internal.into_glib(),
))
.expect("mandatory glib value is None")
}
}
@ -177,8 +178,11 @@ pub trait ClockExt: IsA<Clock> + 'static {
#[doc(alias = "gst_clock_get_time")]
#[doc(alias = "get_time")]
fn time(&self) -> Option<ClockTime> {
unsafe { from_glib(ffi::gst_clock_get_time(self.as_ref().to_glib_none().0)) }
fn time(&self) -> ClockTime {
unsafe {
try_from_glib(ffi::gst_clock_get_time(self.as_ref().to_glib_none().0))
.expect("mandatory glib value is None")
}
}
#[doc(alias = "gst_clock_get_timeout")]
@ -232,12 +236,13 @@ pub trait ClockExt: IsA<Clock> + 'static {
}
#[doc(alias = "gst_clock_unadjust_unlocked")]
fn unadjust_unlocked(&self, external: ClockTime) -> Option<ClockTime> {
fn unadjust_unlocked(&self, external: ClockTime) -> ClockTime {
unsafe {
from_glib(ffi::gst_clock_unadjust_unlocked(
try_from_glib(ffi::gst_clock_unadjust_unlocked(
self.as_ref().to_glib_none().0,
external.into_glib(),
))
.expect("mandatory glib value is None")
}
}