X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=src%2Fregister.rs;h=b06b5979affe39b9120f69d672701f74c790d615;hb=16dd4f445b3ee6b038926fdd2b9cd0081186eb28;hp=d4f72afd161dd96732a91412b3635d737e69a59f;hpb=45e794c4181f03a75a9d7dfce4bc0bf9ce94b6b0;p=nihav.git diff --git a/src/register.rs b/src/register.rs index d4f72af..b06b597 100644 --- a/src/register.rs +++ b/src/register.rs @@ -1,6 +1,6 @@ use std::fmt; -#[derive(Debug,Clone,Copy)] +#[derive(Debug,Clone,Copy,PartialEq)] #[allow(dead_code)] pub enum CodecType { Video, @@ -28,6 +28,7 @@ const CODEC_CAP_REORDER:u32 = 0x000004; const CODEC_CAP_HYBRID:u32 = 0x000008; const CODEC_CAP_SCALABLE:u32 = 0x000010; +#[derive(Clone)] pub struct CodecDescription { name: &'static str, fname: &'static str, @@ -108,9 +109,9 @@ macro_rules! desc { } pub fn get_codec_description(name: &str) -> Option<&'static CodecDescription> { - for i in 0..CODEC_REGISTER.len() { - if CODEC_REGISTER[i].name == name { - return Some(&CODEC_REGISTER[i]); + for reg in CODEC_REGISTER { + if reg.name == name { + return Some(reg); } } None @@ -122,8 +123,24 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ desc!(video; "indeo3", "Intel Indeo 3"), desc!(video; "indeo4", "Intel Indeo 4", CODEC_CAP_REORDER | CODEC_CAP_SCALABLE), desc!(video; "indeo5", "Intel Indeo 5", CODEC_CAP_REORDER | CODEC_CAP_SCALABLE), + desc!(video; "intel263", "Intel I263", CODEC_CAP_REORDER), desc!(audio; "iac", "Intel Indeo audio"), desc!(audio; "imc", "Intel Music Coder"), + + desc!(video; "realvideo1", "Real Video 1"), + desc!(video; "realvideo2", "Real Video 2"), + desc!(video; "realvideo3", "Real Video 3", CODEC_CAP_REORDER), + desc!(video; "realvideo4", "Real Video 4", CODEC_CAP_REORDER), + desc!(video; "clearvideo", "ClearVideo"), + desc!(video; "clearvideo_rm", "ClearVideo"), + desc!(audio; "ra14.4", "RealAudio 14.4"), + desc!(audio; "ra28.8", "RealAudio 28.8"), + desc!(audio; "cook", "RealAudio Cooker"), + desc!(audio; "ralf", "RealAudio Lossless"), + desc!(audio; "aac", "AAC"), + desc!(audio; "ac3", "ETSI TS 102 366"), + desc!(audio; "atrac3", "Sony Atrac3"), + desc!(audio; "sipro", "Sipro Labs ADPCM"), ]; static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ @@ -133,6 +150,9 @@ static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"IV32", "indeo3"), (b"IV41", "indeo4"), (b"IV50", "indeo5"), + (b"I263", "intel263"), + + (b"UCOD", "clearvideo"), ]; static WAV_CODEC_REGISTER: &'static [(u16, &str)] = &[