diff --git a/Gir_Gst.toml b/Gir_Gst.toml index 21052ca0b..ff856b3f1 100644 --- a/Gir_Gst.toml +++ b/Gir_Gst.toml @@ -229,6 +229,16 @@ status = "generate" [object.function.return] bool_return_is_error = "Timed out waiting for sync" + [[object.function]] + name = "adjust_with_calibration" + # Useless clock parameter + ignore = true + + [[object.function]] + name = "unadjust_with_calibration" + # Useless clock parameter + ignore = true + [[object]] name = "Gst.SystemClock" status = "generate" diff --git a/gstreamer/src/auto/clock.rs b/gstreamer/src/auto/clock.rs index 957f27755..d820d59dd 100644 --- a/gstreamer/src/auto/clock.rs +++ b/gstreamer/src/auto/clock.rs @@ -67,8 +67,6 @@ pub trait ClockExt { fn adjust_unlocked(&self, internal: ClockTime) -> ClockTime; - fn adjust_with_calibration(&self, internal_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime; - fn get_calibration(&self) -> (ClockTime, ClockTime, ClockTime, ClockTime); fn get_internal_time(&self) -> ClockTime; @@ -103,8 +101,6 @@ pub trait ClockExt { fn unadjust_unlocked(&self, external: ClockTime) -> ClockTime; - fn unadjust_with_calibration(&self, external_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime; - fn wait_for_sync(&self, timeout: ClockTime) -> Result<(), glib::error::BoolError>; fn get_property_window_size(&self) -> i32; @@ -151,12 +147,6 @@ impl + IsA> ClockExt for O { } } - fn adjust_with_calibration(&self, internal_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime { - unsafe { - from_glib(ffi::gst_clock_adjust_with_calibration(self.to_glib_none().0, internal_target.to_glib(), cinternal.to_glib(), cexternal.to_glib(), cnum.to_glib(), cdenom.to_glib())) - } - } - fn get_calibration(&self) -> (ClockTime, ClockTime, ClockTime, ClockTime) { unsafe { let mut internal = mem::uninitialized(); @@ -258,12 +248,6 @@ impl + IsA> ClockExt for O { } } - fn unadjust_with_calibration(&self, external_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime { - unsafe { - from_glib(ffi::gst_clock_unadjust_with_calibration(self.to_glib_none().0, external_target.to_glib(), cinternal.to_glib(), cexternal.to_glib(), cnum.to_glib(), cdenom.to_glib())) - } - } - fn wait_for_sync(&self, timeout: ClockTime) -> Result<(), glib::error::BoolError> { unsafe { glib::error::BoolError::from_glib(ffi::gst_clock_wait_for_sync(self.to_glib_none().0, timeout.to_glib()), "Timed out waiting for sync") diff --git a/gstreamer/src/clock.rs b/gstreamer/src/clock.rs index 202494690..3510c660c 100644 --- a/gstreamer/src/clock.rs +++ b/gstreamer/src/clock.rs @@ -126,6 +126,46 @@ impl Eq for ClockId {} unsafe impl Send for ClockId {} unsafe impl Sync for ClockId {} +impl Clock { + pub fn adjust_with_calibration( + internal_target: ClockTime, + cinternal: ClockTime, + cexternal: ClockTime, + cnum: ClockTime, + cdenom: ClockTime, + ) -> ClockTime { + unsafe { + from_glib(ffi::gst_clock_adjust_with_calibration( + ptr::null_mut(), + internal_target.to_glib(), + cinternal.to_glib(), + cexternal.to_glib(), + cnum.to_glib(), + cdenom.to_glib(), + )) + } + } + + pub fn unadjust_with_calibration( + external_target: ClockTime, + cinternal: ClockTime, + cexternal: ClockTime, + cnum: ClockTime, + cdenom: ClockTime, + ) -> ClockTime { + unsafe { + from_glib(ffi::gst_clock_unadjust_with_calibration( + ptr::null_mut(), + external_target.to_glib(), + cinternal.to_glib(), + cexternal.to_glib(), + cnum.to_glib(), + cdenom.to_glib(), + )) + } + } +} + pub trait ClockExtManual { fn new_periodic_id(&self, start_time: ClockTime, interval: ClockTime) -> Option;