video-info: Allow size to be 0 if the number of planes is unknown

This happens for DMA_DRM and ENCODED formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1774>
This commit is contained in:
Sebastian Dröge 2025-08-12 12:30:13 +03:00
parent bd631c7f7e
commit d7d9648498

View file

@ -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")]