]> git.nihav.org Git - nihav.git/blame - nihav-allstuff/src/lib.rs
add complex frame reorderer for upcoming H.264
[nihav.git] / nihav-allstuff / src / lib.rs
CommitLineData
5ed804ae 1//! Umbrella crate to register decoders and demuxers from all known NihAV crates.
5641dccf 2extern crate nihav_core;
38953fb5 3extern crate nihav_commonfmt;
8e4fa38a 4extern crate nihav_duck;
5641dccf
KS
5extern crate nihav_game;
6extern crate nihav_indeo;
87927c57 7extern crate nihav_llaudio;
4abcd842 8extern crate nihav_ms;
606c448e 9extern crate nihav_rad;
5641dccf
KS
10extern crate nihav_realmedia;
11
38953fb5 12use nihav_core::codecs::RegisteredDecoders;
f52b598b 13use nihav_core::codecs::RegisteredEncoders;
38953fb5 14use nihav_core::demuxers::RegisteredDemuxers;
f52b598b 15use nihav_core::muxers::RegisteredMuxers;
38953fb5 16
78fb6560 17use nihav_commonfmt::generic_register_all_decoders;
e64739f8 18use nihav_commonfmt::generic_register_all_demuxers;
f52b598b
KS
19use nihav_commonfmt::generic_register_all_encoders;
20use nihav_commonfmt::generic_register_all_muxers;
5641dccf 21
78fb6560 22use nihav_duck::duck_register_all_decoders;
8e4fa38a 23
78fb6560 24use nihav_game::game_register_all_decoders;
e64739f8 25use nihav_game::game_register_all_demuxers;
5641dccf 26
78fb6560 27use nihav_indeo::indeo_register_all_decoders;
5641dccf 28
87927c57
KS
29use nihav_llaudio::llaudio_register_all_decoders;
30use nihav_llaudio::llaudio_register_all_demuxers;
31
78fb6560 32use nihav_ms::ms_register_all_decoders;
f52b598b 33use nihav_ms::ms_register_all_encoders;
4abcd842 34
78fb6560 35use nihav_qt::qt_register_all_decoders;
4c1582cf 36
78fb6560 37use nihav_rad::rad_register_all_decoders;
e64739f8 38use nihav_rad::rad_register_all_demuxers;
606c448e 39
78fb6560 40use nihav_realmedia::realmedia_register_all_decoders;
e64739f8 41use nihav_realmedia::realmedia_register_all_demuxers;
5641dccf 42
5ed804ae 43/// Registers all known decoders.
78fb6560
KS
44pub fn nihav_register_all_decoders(rd: &mut RegisteredDecoders) {
45 generic_register_all_decoders(rd);
46 duck_register_all_decoders(rd);
47 game_register_all_decoders(rd);
48 indeo_register_all_decoders(rd);
87927c57 49 llaudio_register_all_decoders(rd);
78fb6560
KS
50 ms_register_all_decoders(rd);
51 qt_register_all_decoders(rd);
52 rad_register_all_decoders(rd);
53 realmedia_register_all_decoders(rd);
5641dccf
KS
54}
55
5ed804ae 56/// Registers all known demuxers.
5641dccf 57pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) {
38953fb5 58 generic_register_all_demuxers(rd);
5641dccf 59 game_register_all_demuxers(rd);
87927c57 60 llaudio_register_all_demuxers(rd);
606c448e 61 rad_register_all_demuxers(rd);
5641dccf
KS
62 realmedia_register_all_demuxers(rd);
63}
d10c9311 64
f52b598b
KS
65/// Registers all known encoders.
66pub fn nihav_register_all_encoders(re: &mut RegisteredEncoders) {
67 generic_register_all_encoders(re);
68 ms_register_all_encoders(re);
69}
70
71/// Registers all known demuxers.
72pub fn nihav_register_all_muxers(rm: &mut RegisteredMuxers) {
73 generic_register_all_muxers(rm);
74}
75
32f7cbe5
KS
76#[cfg(test)]
77extern crate nihav_registry;
78
d10c9311
KS
79#[cfg(test)]
80mod test {
81 use super::*;
32f7cbe5 82 use nihav_registry::register::get_codec_description;
d10c9311
KS
83
84 #[test]
85 fn test_descriptions() {
86 let mut rd = RegisteredDecoders::new();
78fb6560 87 nihav_register_all_decoders(&mut rd);
d10c9311
KS
88 let mut has_missing = false;
89 for dec in rd.iter() {
90 print!("decoder {} - ", dec.name);
91 let ret = get_codec_description(dec.name);
92 if let Some(desc) = ret {
93 println!("{}", desc);
94 } else {
95 println!("missing!");
96 has_missing = true;
97 }
98 }
99 assert!(!has_missing);
100 }
101}