X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=src%2Fregister.rs;h=046ca83bd7b4eff40d609e4affdb3dca21ab27e3;hb=cf64af13518ee281beec24f32aa0e36317260b82;hp=d4f72afd161dd96732a91412b3635d737e69a59f;hpb=45e794c4181f03a75a9d7dfce4bc0bf9ce94b6b0;p=nihav.git diff --git a/src/register.rs b/src/register.rs index d4f72af..046ca83 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,6 +123,7 @@ 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; "intel264", "Intel I263", CODEC_CAP_REORDER), desc!(audio; "iac", "Intel Indeo audio"), desc!(audio; "imc", "Intel Music Coder"), ]; @@ -133,6 +135,7 @@ static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"IV32", "indeo3"), (b"IV41", "indeo4"), (b"IV50", "indeo5"), + (b"I263", "intel263"), ]; static WAV_CODEC_REGISTER: &'static [(u16, &str)] = &[