X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-registry%2Fsrc%2Fregister.rs;h=0e3cc6403b118df470742b76a7a2b004f0d39a9f;hp=466a3f7b8b414172c66e78f8489f44cf56998b6b;hb=549152963d868fc896287193b7ac7767e8794e01;hpb=423005dc1d521e9089c9ddcf020979b825e30443 diff --git a/nihav-registry/src/register.rs b/nihav-registry/src/register.rs index 466a3f7..0e3cc64 100644 --- a/nihav-registry/src/register.rs +++ b/nihav-registry/src/register.rs @@ -31,11 +31,18 @@ impl fmt::Display for CodecType { } } -const CODEC_CAP_INTRAONLY:u32 = 0x0001; -const CODEC_CAP_LOSSLESS:u32 = 0x0002; -const CODEC_CAP_REORDER:u32 = 0x0004; -const CODEC_CAP_HYBRID:u32 = 0x0008; -const CODEC_CAP_SCALABLE:u32 = 0x0010; +/// Codec capability flag for intra-only codecs. +pub const CODEC_CAP_INTRAONLY:u32 = 0x0001; +/// Codec capability flag for lossless codecs. +pub const CODEC_CAP_LOSSLESS:u32 = 0x0002; +/// Codec capability flag for codecs with frame reordering. +pub const CODEC_CAP_REORDER:u32 = 0x0004; +/// Codec capability flag for codecs that can be both lossy and lossless. +pub const CODEC_CAP_HYBRID:u32 = 0x0008; +/// Codec capability flag for codecs with scalability features. +pub const CODEC_CAP_SCALABLE:u32 = 0x0010; +/// Codec capability flag for codecs with complex frame reordering. +pub const CODEC_CAP_COMPLEX_REORDER:u32 = 0x0020; /// Codec description structure. #[derive(Clone)] @@ -132,6 +139,10 @@ macro_rules! desc { CodecDescription{ name: $n, fname: $fn, ctype: CodecType::Audio, caps: CODEC_CAP_LOSSLESS | CODEC_CAP_INTRAONLY } }); + (audio-hyb; $n:expr, $fn:expr) => ({ + CodecDescription{ name: $n, fname: $fn, ctype: CodecType::Audio, + caps: CODEC_CAP_HYBRID } + }); } /// Returns codec description for the provided codec short name if it is found. @@ -144,8 +155,10 @@ pub fn get_codec_description(name: &str) -> Option<&'static CodecDescription> { None } -static CODEC_REGISTER: &'static [CodecDescription] = &[ +static CODEC_REGISTER: &[CodecDescription] = &[ desc!(audio-ll; "pcm", "PCM"), + desc!(audio; "alaw", "A-law PCM"), + desc!(audio; "ulaw", "mu-law PCM"), desc!(video-im; "indeo1", "Intel Raw IF09"), desc!(video-im; "indeo2", "Intel Indeo 2"), @@ -172,12 +185,32 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ desc!(audio; "atrac3", "Sony Atrac3"), desc!(audio; "sipro", "Sipro Labs ADPCM"), + + desc!(video-ll; "rawvideo", "Raw video data"), + desc!(video-ll; "rawvideo-ms", "Raw video data"), + desc!(video; "cinepak", "Cinepak"), + desc!(video-llp; "zmbv", "Zip Motion Blocks Video"), + desc!(video; "msvideo1", "MS Video 1"), + desc!(video; "msrle", "MS RLE"), desc!(audio; "ms-adpcm", "MS ADPCM"), desc!(audio; "ima-adpcm-ms", "IMA ADPCM (MS variant)"), + desc!(video; "qt-smc", "Apple Graphics"), + desc!(video; "qt-rle", "Apple Animation"), + desc!(video; "apple-video", "Apple video"), + desc!(video; "sorenson-video", "Sorenson Video"), + desc!(video; "sorenson-video3", "Sorenson Video 3", CODEC_CAP_REORDER), + desc!(audio-ll; "alac", "Apple Lossless Audio Codec"), + desc!(audio; "mace-3", "MACE 3:1"), + desc!(audio; "mace-6", "MACE 6:1"), + desc!(audio; "ima-adpcm-qt", "IMA ADPCM (Apple variant)"), + desc!(audio; "qdesign-music", "QDesign Music"), + desc!(audio; "qdesign-music2", "QDesign Music v2"), + desc!(audio; "qualcomm-purevoice", "Qualcomm PureVoice"), + desc!(video; "truemotion1", "TrueMotion 1"), desc!(video-im; "truemotionrt", "TrueMotion RT"), desc!(video; "truemotion2", "TrueMotion 2"), @@ -186,7 +219,8 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ desc!(video; "vp4", "VP4"), desc!(video; "vp5", "VP5"), desc!(video; "vp6", "VP6"), - desc!(video; "vp6a", "VP6"), + desc!(video; "vp6f", "VP6 (in Flash)"), + desc!(video; "vp6a", "VP6 with alpha"), desc!(video; "vp7", "VP7"), desc!(video; "vp8", "VP8"), desc!(video; "vp9", "VP9"), @@ -195,17 +229,36 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ desc!(audio; "on2avc-500", "On2 AVC"), desc!(audio; "on2avc-501", "On2 AVC"), + desc!(video; "flv263", "Sorenson H.263"), + desc!(video-llp; "flashsv", "Flash Screen Video"), + desc!(video-llp; "flashsv2", "Flash Screen Video 2"), + desc!(audio; "asao", "N*llym*s*r ASAO"), + desc!(audio; "flv-adpcm", "Flash ADPCM"), + + desc!(audio; "mp1", "MPEG Audio Layer I"), + desc!(audio; "mp2", "MPEG Audio Layer II"), + desc!(audio; "mp3", "MPEG Audio Layer III"), + desc!(audio; "speex", "Speex"), + desc!(video; "gdv-video", "Gremlin Digital Video - video"), desc!(audio; "gdv-audio", "Gremlin Digital Video - audio"), desc!(video; "bmv-video", "BMV video"), desc!(audio; "bmv-audio", "BMV audio"), desc!(video; "bmv3-video", "DW Noir BMV video"), desc!(audio; "bmv3-audio", "DW Noir BMV audio"), + desc!(video; "fable-imax", "Fable IMAX video"), + desc!(video; "fst-video", "FutureVision video"), + desc!(audio; "fst-audio", "FutureVision audio"), + desc!(video-llp; "ipma", "Imagination Pilots Matte Animation"), + desc!(video-llp; "ipma2", "Imagination Pilots Matte Animation v2"), + desc!(video; "legend-q-video", "Legend Entertainment Q video"), desc!(video; "midivid", "MidiVid"), desc!(video; "midivid3", "MidiVid 3"), desc!(video-ll; "midivid-ll", "MidiVid Lossless"), desc!(video; "vmd-video", "VMD video"), desc!(audio; "vmd-audio", "VMD audio"), + desc!(video; "vxvideo", "Actimagine Vx"), + desc!(audio; "vxaudio", "Actimagine Sx"), desc!(video; "smacker-video", "Smacker video"), desc!(audio; "smacker-audio", "Smacker audio"), @@ -223,9 +276,19 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ desc!(video; "vivo2", "VivoActive Video 2.0", CODEC_CAP_REORDER), desc!(audio; "g723.1", "ITU G.723.1"), desc!(audio; "siren", "Polycom Siren"), + + desc!(audio-ll; "ape", "Monkey's Audio"), + desc!(audio-ll; "flac", "Free Lossless Audio Codec"), + desc!(audio-ll; "tta", "True Audio codec"), + desc!(audio-hyb; "wavpack", "WavPack"), + + desc!(video-im; "jpeg", "JPEG"), + desc!(video; "h264", "ITU H.264", CODEC_CAP_COMPLEX_REORDER | CODEC_CAP_HYBRID), + + desc!(video-im; "mwv1", "Aware MotionWavelets"), ]; -static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ +static AVI_VIDEO_CODEC_REGISTER: &[(&[u8;4], &str)] = &[ (&[1, 0, 0, 0], "msrle"), (&[2, 0, 0, 0], "msrle"), @@ -233,6 +296,8 @@ static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"MSVC", "msvideo1"), (b"WHAM", "msvideo1"), + (b"MJPG", "jpeg"), + (b"IF09", "indeo1"), (b"RT21", "indeo2"), (b"IV31", "indeo3"), @@ -243,6 +308,10 @@ static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"UCOD", "clearvideo"), (b"cvid", "cinepak"), + (b"ZMBV", "zmbv"), + + (b"Ipma", "ipma"), + (b"Ip20", "ipma2"), (b"MVDV", "midivid"), (b"MV30", "midivid3"), @@ -262,9 +331,11 @@ static AVI_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"VP62", "vp6"), (b"VP6A", "vp6a"), (b"VP70", "vp7"), + + (b"MWV1", "mwv1"), ]; -static WAV_CODEC_REGISTER: &'static [(u16, &str)] = &[ +static WAV_CODEC_REGISTER: &[(u16, &str)] = &[ (0x0000, "unknown"), (0x0001, "pcm"), (0x0002, "ms-adpcm"), @@ -278,7 +349,7 @@ static WAV_CODEC_REGISTER: &'static [(u16, &str)] = &[ (0x0501, "on2avc-501"), ]; -static MOV_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ +static MOV_VIDEO_CODEC_REGISTER: &[(&[u8;4], &str)] = &[ (b"cvid", "cinepak"), (b"jpeg", "jpeg"), //(b"raw ", "raw"), @@ -291,6 +362,9 @@ static MOV_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"mjpa", "mjpeg-a"), (b"mjpb", "mjpeg-b"), (b"svqi", "sorenson-video"), + (b"SVQ1", "sorenson-video"), + (b"svq3", "sorenson-video3"), + (b"SVQ3", "sorenson-video3"), (b"IV31", "indeo3"), (b"IV32", "indeo3"), @@ -299,9 +373,11 @@ static MOV_VIDEO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"VP30", "vp3"), (b"VP31", "vp3"), + + (b"avc1", "h264"), ]; -static MOV_AUDIO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ +static MOV_AUDIO_CODEC_REGISTER: &[(&[u8;4], &str)] = &[ (b"NONE", "pcm"), (b"raw ", "pcm"), (b"twos", "pcm"), @@ -320,6 +396,10 @@ static MOV_AUDIO_CODEC_REGISTER: &'static [(&[u8;4], &str)] = &[ (b"QDM2", "qdesign-music2"), (b"Qclp", "qualcomm-purevoice"), //(b".mp3", "mpeg-layer3"), + + (b"mp4a", "aac"), + + (b"alac", "alac"), ]; /// Returns video codec short name for provided FOURCC (used in AVI format).