Configurable encoder pipeline

This commit is contained in:
2024-03-20 22:46:19 +00:00
parent 13cb456f89
commit 529e3b6234
24 changed files with 1707 additions and 209 deletions

37
src/demux/info.rs Normal file
View File

@ -0,0 +1,37 @@
use ffmpeg_sys_next::AVCodecParameters;
use crate::fraction::Fraction;
#[derive(Clone, Debug, PartialEq)]
pub struct DemuxStreamInfo {
pub channels: Vec<StreamInfoChannel>,
}
#[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 codec_params: *const AVCodecParameters,
}
unsafe impl Sync for StreamInfoChannel {}
unsafe impl Send for StreamInfoChannel {}
impl TryInto<Fraction> for StreamInfoChannel {
type Error = ();
fn try_into(self) -> Result<Fraction, Self::Error> {
if self.channel_type == StreamChannelType::Video {
Ok(Fraction::from((self.width, self.height)))
} else {
Err(())
}
}
}