]> git.nihav.org Git - nihav.git/blob - nihav-allstuff/src/lib.rs
add complex frame reorderer for upcoming H.264
[nihav.git] / nihav-allstuff / src / lib.rs
1 //! Umbrella crate to register decoders and demuxers from all known NihAV crates.
2 extern crate nihav_core;
3 extern crate nihav_commonfmt;
4 extern crate nihav_duck;
5 extern crate nihav_game;
6 extern crate nihav_indeo;
7 extern crate nihav_llaudio;
8 extern crate nihav_ms;
9 extern crate nihav_rad;
10 extern crate nihav_realmedia;
11
12 use nihav_core::codecs::RegisteredDecoders;
13 use nihav_core::codecs::RegisteredEncoders;
14 use nihav_core::demuxers::RegisteredDemuxers;
15 use nihav_core::muxers::RegisteredMuxers;
16
17 use nihav_commonfmt::generic_register_all_decoders;
18 use nihav_commonfmt::generic_register_all_demuxers;
19 use nihav_commonfmt::generic_register_all_encoders;
20 use nihav_commonfmt::generic_register_all_muxers;
21
22 use nihav_duck::duck_register_all_decoders;
23
24 use nihav_game::game_register_all_decoders;
25 use nihav_game::game_register_all_demuxers;
26
27 use nihav_indeo::indeo_register_all_decoders;
28
29 use nihav_llaudio::llaudio_register_all_decoders;
30 use nihav_llaudio::llaudio_register_all_demuxers;
31
32 use nihav_ms::ms_register_all_decoders;
33 use nihav_ms::ms_register_all_encoders;
34
35 use nihav_qt::qt_register_all_decoders;
36
37 use nihav_rad::rad_register_all_decoders;
38 use nihav_rad::rad_register_all_demuxers;
39
40 use nihav_realmedia::realmedia_register_all_decoders;
41 use nihav_realmedia::realmedia_register_all_demuxers;
42
43 /// Registers all known decoders.
44 pub 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);
49 llaudio_register_all_decoders(rd);
50 ms_register_all_decoders(rd);
51 qt_register_all_decoders(rd);
52 rad_register_all_decoders(rd);
53 realmedia_register_all_decoders(rd);
54 }
55
56 /// Registers all known demuxers.
57 pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) {
58 generic_register_all_demuxers(rd);
59 game_register_all_demuxers(rd);
60 llaudio_register_all_demuxers(rd);
61 rad_register_all_demuxers(rd);
62 realmedia_register_all_demuxers(rd);
63 }
64
65 /// Registers all known encoders.
66 pub 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.
72 pub fn nihav_register_all_muxers(rm: &mut RegisteredMuxers) {
73 generic_register_all_muxers(rm);
74 }
75
76 #[cfg(test)]
77 extern crate nihav_registry;
78
79 #[cfg(test)]
80 mod test {
81 use super::*;
82 use nihav_registry::register::get_codec_description;
83
84 #[test]
85 fn test_descriptions() {
86 let mut rd = RegisteredDecoders::new();
87 nihav_register_all_decoders(&mut rd);
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 }