use crate::error::Error;
use crate::types::Frame;
use std::time::Duration;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum VideoCodec {
H264,
H265,
}
pub(crate) trait VideoDecoder: Send {
fn new(codec: VideoCodec, extradata: &[u8]) -> Result<Self, Error>
where
Self: Sized;
fn decode(&mut self, nal: &[u8], timestamp: Duration) -> Result<Vec<Frame>, Error>;
}
#[cfg(target_os = "macos")]
mod macos;
#[cfg(target_os = "windows")]
mod windows;
#[cfg(target_os = "macos")]
pub(crate) type Decoder = macos::VideoToolboxDecoder;
#[cfg(target_os = "windows")]
pub(crate) type Decoder = windows::MediaFoundationDecoder;