From 07562c592f28a3647664370233bc1057489c2704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 30 Jun 2022 08:25:14 +0300 Subject: [PATCH] video: Add bindings for `is_common_aspect_ratio()` --- gstreamer-video/src/functions.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gstreamer-video/src/functions.rs b/gstreamer-video/src/functions.rs index cf516d44e..67ecd3d2c 100644 --- a/gstreamer-video/src/functions.rs +++ b/gstreamer-video/src/functions.rs @@ -196,6 +196,22 @@ pub fn guess_framerate(duration: gst::ClockTime) -> Option { } } +#[cfg(any(feature = "v1_22", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_22")))] +#[doc(alias = "gst_video_is_common_aspect_ratio")] +pub fn is_common_aspect_ratio(width: u32, height: u32, par: gst::Fraction) -> bool { + skip_assert_initialized!(); + + unsafe { + from_glib(ffi::gst_video_is_common_aspect_ratio( + width as i32, + height as i32, + par.numer(), + par.denom(), + )) + } +} + pub fn video_make_raw_caps( formats: &[crate::VideoFormat], ) -> gst::caps::Builder {