From 840d1847a1b47db66b8b258ee8a42291bf76e7dc Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 18 Jun 2019 10:57:58 +0530 Subject: [PATCH] video: add VIDEO_MAX_PLANES constant --- gstreamer-video/src/video_info.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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]);