X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-registry%2Fsrc%2Fregister.rs;h=466a3f7b8b414172c66e78f8489f44cf56998b6b;hb=423005dc1d521e9089c9ddcf020979b825e30443;hp=628cc6b87af5271f99b5b76d5e4c0f6a104ce0ed;hpb=31cf33aceca7798294e1ce5c01702ef5e6ef7adc;p=nihav.git diff --git a/nihav-registry/src/register.rs b/nihav-registry/src/register.rs index 628cc6b..466a3f7 100644 --- a/nihav-registry/src/register.rs +++ b/nihav-registry/src/register.rs @@ -172,6 +172,12 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ desc!(audio; "atrac3", "Sony Atrac3"), desc!(audio; "sipro", "Sipro Labs ADPCM"), + desc!(video; "cinepak", "Cinepak"), + + desc!(video; "msvideo1", "MS Video 1"), + desc!(audio; "ms-adpcm", "MS ADPCM"), + desc!(audio; "ima-adpcm-ms", "IMA ADPCM (MS variant)"), + desc!(video; "truemotion1", "TrueMotion 1"), desc!(video-im; "truemotionrt", "TrueMotion RT"), desc!(video; "truemotion2", "TrueMotion 2"), @@ -220,6 +226,13 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ ]; static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ + (&[1, 0, 0, 0], "msrle"), + (&[2, 0, 0, 0], "msrle"), + + (b"CRAM", "msvideo1"), + (b"MSVC", "msvideo1"), + (b"WHAM", "msvideo1"), + (b"IF09", "indeo1"), (b"RT21", "indeo2"), (b"IV31", "indeo3"), @@ -229,6 +242,7 @@ static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"I263", "intel263"), (b"UCOD", "clearvideo"), + (b"cvid", "cinepak"), (b"MVDV", "midivid"), (b"MV30", "midivid3"), @@ -251,9 +265,11 @@ static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ ]; static WAV_CODEC_REGISTER: &'static [(u16, &str)] = &[ - (0x0000, "pcm"), + (0x0000, "unknown"), (0x0001, "pcm"), + (0x0002, "ms-adpcm"), (0x0003, "pcm"), + (0x0011, "ima-adpcm-ms"), (0x0061, "adpcm-dk4"), (0x0062, "adpcm-dk3"), (0x0401, "imc"), @@ -314,6 +330,14 @@ pub fn find_codec_from_avi_fourcc(fcc: &[u8;4]) -> Option<&'static str> { None } +/// Returns FOURCC (used in AVI format) for provided codec name. +pub fn find_avi_fourcc(codecname: &str) -> Option<[u8; 4]> { + for (fourcc, name) in AVI_VIDEO_CODEC_REGISTER.iter() { + if *name == codecname { return Some(**fourcc); } + } + None +} + /// Returns known audio codec short name for provided TWOCC (used in WAV and AVI format). pub fn find_codec_from_wav_twocc(tcc: u16) -> Option<&'static str> { for (twocc, name) in WAV_CODEC_REGISTER.iter() { @@ -322,6 +346,14 @@ pub fn find_codec_from_wav_twocc(tcc: u16) -> Option<&'static str> { None } +/// Returns TWOCC (used in WAV and AVI format for provided codec name. +pub fn find_wav_twocc(codecname: &str) -> Option { + for (twocc, name) in WAV_CODEC_REGISTER.iter() { + if *name == codecname { return Some(*twocc); } + } + None +} + /// Returns video codec short name for provided FOURCC (used in MOV format). pub fn find_codec_from_mov_video_fourcc(fcc: &[u8;4]) -> Option<&'static str> { for (fourcc, name) in MOV_VIDEO_CODEC_REGISTER.iter() {