]> git.nihav.org Git - nihav.git/blob - nihav-allstuff/src/lib.rs
vivo: improve decoding
[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_itu;
8 extern crate nihav_llaudio;
9 extern crate nihav_ms;
10 extern crate nihav_rad;
11 extern crate nihav_realmedia;
12
13 use nihav_core::codecs::RegisteredDecoders;
14 use nihav_core::codecs::RegisteredEncoders;
15 use nihav_core::demuxers::RegisteredDemuxers;
16 use nihav_core::muxers::RegisteredMuxers;
17
18 use nihav_commonfmt::generic_register_all_decoders;
19 use nihav_commonfmt::generic_register_all_demuxers;
20 use nihav_commonfmt::generic_register_all_encoders;
21 use nihav_commonfmt::generic_register_all_muxers;
22
23 use nihav_duck::duck_register_all_decoders;
24
25 use nihav_game::game_register_all_decoders;
26 use nihav_game::game_register_all_demuxers;
27
28 use nihav_indeo::indeo_register_all_decoders;
29
30 use nihav_itu::itu_register_all_decoders;
31
32 use nihav_llaudio::llaudio_register_all_decoders;
33 use nihav_llaudio::llaudio_register_all_demuxers;
34
35 use nihav_ms::ms_register_all_decoders;
36 use nihav_ms::ms_register_all_encoders;
37
38 use nihav_qt::qt_register_all_decoders;
39
40 use nihav_rad::rad_register_all_decoders;
41 use nihav_rad::rad_register_all_demuxers;
42
43 use nihav_realmedia::realmedia_register_all_decoders;
44 use nihav_realmedia::realmedia_register_all_demuxers;
45
46 /// Registers all known decoders.
47 pub fn nihav_register_all_decoders(rd: &mut RegisteredDecoders) {
48 generic_register_all_decoders(rd);
49 duck_register_all_decoders(rd);
50 game_register_all_decoders(rd);
51 indeo_register_all_decoders(rd);
52 itu_register_all_decoders(rd);
53 llaudio_register_all_decoders(rd);
54 ms_register_all_decoders(rd);
55 qt_register_all_decoders(rd);
56 rad_register_all_decoders(rd);
57 realmedia_register_all_decoders(rd);
58 }
59
60 /// Registers all known demuxers.
61 pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) {
62 generic_register_all_demuxers(rd);
63 game_register_all_demuxers(rd);
64 llaudio_register_all_demuxers(rd);
65 rad_register_all_demuxers(rd);
66 realmedia_register_all_demuxers(rd);
67 }
68
69 /// Registers all known encoders.
70 pub fn nihav_register_all_encoders(re: &mut RegisteredEncoders) {
71 generic_register_all_encoders(re);
72 ms_register_all_encoders(re);
73 }
74
75 /// Registers all known demuxers.
76 pub fn nihav_register_all_muxers(rm: &mut RegisteredMuxers) {
77 generic_register_all_muxers(rm);
78 }
79
80 #[cfg(test)]
81 extern crate nihav_registry;
82
83 #[cfg(test)]
84 mod test {
85 use super::*;
86 use nihav_registry::register::get_codec_description;
87
88 #[test]
89 fn test_descriptions() {
90 let mut rd = RegisteredDecoders::new();
91 nihav_register_all_decoders(&mut rd);
92 let mut has_missing = false;
93 for dec in rd.iter() {
94 print!("decoder {} - ", dec.name);
95 let ret = get_codec_description(dec.name);
96 if let Some(desc) = ret {
97 println!("{}", desc);
98 } else {
99 println!("missing!");
100 has_missing = true;
101 }
102 }
103 assert!(!has_missing);
104 }
105 }