diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index 2099b9c92..a9398cbf7 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -23,6 +23,8 @@ use std::mem; use std::ptr; use std::str; +pub const VIDEO_MAX_PLANES: u32 = gst_video_sys::GST_VIDEO_MAX_PLANES as u32; + #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum VideoColorRange { Unknown, @@ -943,7 +945,7 @@ mod tests { assert_eq!(info.stride(), [1920, 1920]); assert_eq!(info.offset(), [0, 2073600]); - let mut align = ::VideoAlignment::new(0, 0, 0, 8, &[0; 4]); + let mut align = ::VideoAlignment::new(0, 0, 0, 8, &[0; VIDEO_MAX_PLANES as usize]); assert!(info.align(&mut align)); assert_eq!(info.stride(), [1928, 1928]);