video: add VIDEO_MAX_PLANES constant

This commit is contained in:
Guillaume Desmottes 2019-06-18 10:57:58 +05:30
parent 491eaf3a73
commit 840d1847a1

View file

@ -23,6 +23,8 @@ use std::mem;
use std::ptr; use std::ptr;
use std::str; 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)] #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum VideoColorRange { pub enum VideoColorRange {
Unknown, Unknown,
@ -943,7 +945,7 @@ mod tests {
assert_eq!(info.stride(), [1920, 1920]); assert_eq!(info.stride(), [1920, 1920]);
assert_eq!(info.offset(), [0, 2073600]); 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!(info.align(&mut align));
assert_eq!(info.stride(), [1928, 1928]); assert_eq!(info.stride(), [1928, 1928]);