From e3667fd8d2be732ca07ac894a697fff216513faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 3 Jul 2020 12:24:06 +0300 Subject: [PATCH] video/video_info: Add field_height() function --- gstreamer-video/src/video_info.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index ef8b013a7..eceed8eb1 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -609,6 +609,15 @@ impl VideoInfo { self.0.height as u32 } + #[cfg(any(feature = "v1_16", feature = "dox"))] + pub fn field_height(&self) -> u32 { + if self.0.interlace_mode == gst_video_sys::GST_VIDEO_INTERLACE_MODE_ALTERNATE { + (self.0.height as u32 + 1) / 2 + } else { + self.0.height as u32 + } + } + pub fn interlace_mode(&self) -> ::VideoInterlaceMode { from_glib(self.0.interlace_mode) }