use crate::media::{PixelFormat, SampleFormat};
#[derive(Debug, Clone)]
pub struct VideoFrame {
pub width: u32,
pub height: u32,
pub format: PixelFormat,
pub planes: Vec<Vec<u8>>,
pub strides: Vec<usize>,
pub pts: Option<i64>,
}
#[derive(Debug, Clone)]
pub struct AudioFrame {
pub sample_rate: u32,
pub channels: u16,
pub format: SampleFormat,
pub planes: Vec<Vec<u8>>,
pub samples: usize,
pub pts: Option<i64>,
}
#[derive(Debug, Clone)]
pub enum Frame {
Video(VideoFrame),
Audio(AudioFrame),
}
impl Frame {
pub fn pts(&self) -> Option<i64> {
match self {
Frame::Video(v) => v.pts,
Frame::Audio(a) => a.pts,
}
}
}