]>
Commit | Line | Data |
---|---|---|
5ed804ae | 1 | //! Umbrella crate to register decoders and demuxers from all known NihAV crates. |
5641dccf | 2 | extern crate nihav_core; |
38953fb5 | 3 | extern crate nihav_commonfmt; |
8e4fa38a | 4 | extern crate nihav_duck; |
5641dccf KS |
5 | extern crate nihav_game; |
6 | extern crate nihav_indeo; | |
87927c57 | 7 | extern crate nihav_llaudio; |
4abcd842 | 8 | extern crate nihav_ms; |
606c448e | 9 | extern crate nihav_rad; |
5641dccf KS |
10 | extern crate nihav_realmedia; |
11 | ||
38953fb5 | 12 | use nihav_core::codecs::RegisteredDecoders; |
f52b598b | 13 | use nihav_core::codecs::RegisteredEncoders; |
38953fb5 | 14 | use nihav_core::demuxers::RegisteredDemuxers; |
f52b598b | 15 | use nihav_core::muxers::RegisteredMuxers; |
38953fb5 | 16 | |
78fb6560 | 17 | use nihav_commonfmt::generic_register_all_decoders; |
e64739f8 | 18 | use nihav_commonfmt::generic_register_all_demuxers; |
f52b598b KS |
19 | use nihav_commonfmt::generic_register_all_encoders; |
20 | use nihav_commonfmt::generic_register_all_muxers; | |
5641dccf | 21 | |
78fb6560 | 22 | use nihav_duck::duck_register_all_decoders; |
8e4fa38a | 23 | |
78fb6560 | 24 | use nihav_game::game_register_all_decoders; |
e64739f8 | 25 | use nihav_game::game_register_all_demuxers; |
5641dccf | 26 | |
78fb6560 | 27 | use nihav_indeo::indeo_register_all_decoders; |
5641dccf | 28 | |
87927c57 KS |
29 | use nihav_llaudio::llaudio_register_all_decoders; |
30 | use nihav_llaudio::llaudio_register_all_demuxers; | |
31 | ||
78fb6560 | 32 | use nihav_ms::ms_register_all_decoders; |
f52b598b | 33 | use nihav_ms::ms_register_all_encoders; |
4abcd842 | 34 | |
78fb6560 | 35 | use nihav_qt::qt_register_all_decoders; |
4c1582cf | 36 | |
78fb6560 | 37 | use nihav_rad::rad_register_all_decoders; |
e64739f8 | 38 | use nihav_rad::rad_register_all_demuxers; |
606c448e | 39 | |
78fb6560 | 40 | use nihav_realmedia::realmedia_register_all_decoders; |
e64739f8 | 41 | use nihav_realmedia::realmedia_register_all_demuxers; |
5641dccf | 42 | |
5ed804ae | 43 | /// Registers all known decoders. |
78fb6560 KS |
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); | |
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 | 57 | pub 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. |
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 | ||
32f7cbe5 KS |
76 | #[cfg(test)] |
77 | extern crate nihav_registry; | |
78 | ||
d10c9311 KS |
79 | #[cfg(test)] |
80 | mod 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 | } |