]> git.nihav.org Git - nihav.git/blobdiff - src/register.rs
make it possible to print NAChannelMap or restore it from string
[nihav.git] / src / register.rs
index d4f72afd161dd96732a91412b3635d737e69a59f..7a351c077e8e826abfe22aa46b31536c4c79c5db 100644 (file)
@@ -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",        "AC-3"),
+    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)] = &[