From a0997f410cb7eab28f3c58b3988fa72b5d736461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 12 Aug 2025 12:30:13 +0300 Subject: [PATCH] video-info: Allow size to be 0 if the number of planes is unknown This happens for DMA_DRM and ENCODED formats. Part-of: --- gstreamer-video/src/video_info.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index 9c3c287fc..67f0c3432 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -805,7 +805,10 @@ impl VideoInfo { #[inline] pub fn is_valid(&self) -> bool { - !self.0.finfo.is_null() && self.0.width > 0 && self.0.height > 0 && self.0.size > 0 + !self.0.finfo.is_null() + && self.0.width > 0 + && self.0.height > 0 + && (self.0.size > 0 || unsafe { (*self.0.finfo).n_planes } == 0) } #[doc(alias = "gst_video_info_from_caps")]