use crate::fraction::Fraction; #[derive(Clone, Debug, PartialEq)] pub struct DemuxStreamInfo { pub channels: Vec, } #[derive(Clone, Debug, PartialEq)] pub enum StreamChannelType { Video, Audio, } #[derive(Clone, Debug, PartialEq)] pub struct StreamInfoChannel { pub index: usize, pub channel_type: StreamChannelType, pub width: usize, pub height: usize, pub fps: f32, } impl TryInto for StreamInfoChannel { type Error = (); fn try_into(self) -> Result { if self.channel_type == StreamChannelType::Video { Ok(Fraction::from((self.width, self.height))) } else { Err(()) } } }