X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=src%2Fframe.rs;h=5499de1001b40b36446bec2cd8d99902bcf24d1e;hb=HEAD;hp=77a5c1730768d3e76dfeede9409779199b46b6bd;hpb=fba6f8e46fbe906f5c7b372becc14c4400533eeb;p=nihav.git diff --git a/src/frame.rs b/src/frame.rs deleted file mode 100644 index 77a5c17..0000000 --- a/src/frame.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::collections::HashMap; -use std::rc::Rc; -use formats::*; - -#[allow(dead_code)] -#[derive(Clone,Copy)] -pub struct NAAudioInfo { - sample_rate: u32, - channels: u8, - format: NASoniton, - block_len: usize, -} - -impl NAAudioInfo { - pub fn new(sr: u32, ch: u8, fmt: NASoniton, bl: usize) -> Self { - NAAudioInfo { sample_rate: sr, channels: ch, format: fmt, block_len: bl } - } -} - -#[allow(dead_code)] -#[derive(Clone,Copy)] -pub struct NAVideoInfo { - width: u32, - height: u32, - flipped: bool, - format: NAPixelFormaton, -} - -impl NAVideoInfo { - pub fn new(w: u32, h: u32, flip: bool, fmt: NAPixelFormaton) -> Self { - NAVideoInfo { width: w, height: h, flipped: flip, format: fmt } - } -} - -#[derive(Clone,Copy)] -pub enum NACodecTypeInfo { - None, - Audio(NAAudioInfo), - Video(NAVideoInfo), -} - -#[allow(dead_code)] -pub struct NABuffer<'a> { - id: u64, - data: &'a mut [u8], -} - -#[allow(dead_code)] -#[derive(Clone)] -pub struct NACodecInfo { - properties: NACodecTypeInfo, - extradata: Option>>, -} - -impl NACodecInfo { - pub fn new(p: NACodecTypeInfo, edata: Option>) -> Self { - let extradata = match edata { - None => None, - Some(vec) => Some(Rc::new(vec)), - }; - NACodecInfo { properties: p, extradata: extradata } - } - pub fn get_properties(&self) -> NACodecTypeInfo { self.properties } - pub fn get_extradata(&self) -> Option>> { - if let Some(ref vec) = self.extradata { return Some(vec.clone()); } - None - } -} - -pub trait NABufferAllocator { - fn alloc_buf(info: &NACodecInfo) -> NABuffer<'static>; -} - -#[derive(Debug)] -pub enum NAValue<'a> { - None, - Int(i32), - Long(i64), - String(String), - Data(&'a [u8]), -} - -#[allow(dead_code)] -pub struct NAFrame<'a> { - pts: Option, - dts: Option, - duration: Option, - buffer: &'a mut NABuffer<'a>, - info: &'a NACodecInfo, - options: HashMap>, -} - -#[allow(dead_code)] -pub struct NACodecContext<'a> { - info: &'a NACodecInfo, -}