mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-01 09:23:50 +00:00
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/1775>
This commit is contained in:
parent
36a5c48eb5
commit
a0997f410c
1 changed files with 4 additions and 1 deletions
|
@ -805,7 +805,10 @@ impl VideoInfo {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_valid(&self) -> bool {
|
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")]
|
#[doc(alias = "gst_video_info_from_caps")]
|
||||||
|
|
Loading…
Reference in a new issue