gstreamer_video/
video_vbi.rs1use crate::VideoFormat;
2pub(super) const VBI_HD_MIN_PIXEL_WIDTH: u32 = 1280;
3
4#[derive(thiserror::Error, Clone, Copy, Debug, Eq, PartialEq)]
7pub enum VideoVBIError {
8 #[error("Format and/or pixel_width is not supported")]
9 Unsupported,
10
11 #[error("Not enough space left in the current line")]
12 NotEnoughSpace,
13
14 #[error("Not enough data left in the current line")]
15 NotEnoughData,
16
17 #[error("Insufficient line buffer length {found}. Expected: {expected}")]
18 InsufficientLineBufLen { found: usize, expected: usize },
19}
20
21pub(super) fn line_buffer_len(format: VideoFormat, width: u32) -> usize {
24 skip_assert_initialized!();
25 match format {
27 VideoFormat::V210 => ((width as usize + 47) / 48) * 128,
28 VideoFormat::Uyvy => {
29 ((width as usize * 2) + 3) & !3
32 }
33 _ => unreachable!(),
34 }
35}