use std::fmt;
-#[derive(Debug,Clone,Copy)]
+#[derive(Debug,Clone,Copy,PartialEq)]
#[allow(dead_code)]
pub enum CodecType {
Video,
const CODEC_CAP_HYBRID:u32 = 0x000008;
const CODEC_CAP_SCALABLE:u32 = 0x000010;
+#[derive(Clone)]
pub struct CodecDescription {
name: &'static str,
fname: &'static str,
}
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
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; "realvideo6", "Real Video 6", 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)] = &[
(b"IV32", "indeo3"),
(b"IV41", "indeo4"),
(b"IV50", "indeo5"),
+ (b"I263", "intel263"),
+
+ (b"UCOD", "clearvideo"),
];
static WAV_CODEC_REGISTER: &'static [(u16, &str)] = &[