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