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