]>
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; | |
4abcd842 | 7 | extern crate nihav_ms; |
606c448e | 8 | extern crate nihav_rad; |
5641dccf KS |
9 | extern crate nihav_realmedia; |
10 | ||
38953fb5 | 11 | use nihav_core::codecs::RegisteredDecoders; |
f52b598b | 12 | use nihav_core::codecs::RegisteredEncoders; |
38953fb5 | 13 | use nihav_core::demuxers::RegisteredDemuxers; |
f52b598b | 14 | use nihav_core::muxers::RegisteredMuxers; |
38953fb5 | 15 | |
e64739f8 KS |
16 | use nihav_commonfmt::generic_register_all_codecs; |
17 | use nihav_commonfmt::generic_register_all_demuxers; | |
f52b598b KS |
18 | use nihav_commonfmt::generic_register_all_encoders; |
19 | use nihav_commonfmt::generic_register_all_muxers; | |
5641dccf | 20 | |
e64739f8 | 21 | use nihav_duck::duck_register_all_codecs; |
8e4fa38a | 22 | |
e64739f8 KS |
23 | use nihav_game::game_register_all_codecs; |
24 | use nihav_game::game_register_all_demuxers; | |
5641dccf | 25 | |
e64739f8 | 26 | use nihav_indeo::indeo_register_all_codecs; |
5641dccf | 27 | |
4abcd842 | 28 | use nihav_ms::ms_register_all_codecs; |
f52b598b | 29 | use nihav_ms::ms_register_all_encoders; |
4abcd842 | 30 | |
4c1582cf KS |
31 | use nihav_qt::qt_register_all_codecs; |
32 | ||
e64739f8 KS |
33 | use nihav_rad::rad_register_all_codecs; |
34 | use nihav_rad::rad_register_all_demuxers; | |
606c448e | 35 | |
e64739f8 KS |
36 | use nihav_realmedia::realmedia_register_all_codecs; |
37 | use nihav_realmedia::realmedia_register_all_demuxers; | |
5641dccf | 38 | |
5ed804ae | 39 | /// Registers all known decoders. |
5641dccf | 40 | pub fn nihav_register_all_codecs(rd: &mut RegisteredDecoders) { |
38953fb5 | 41 | generic_register_all_codecs(rd); |
8e4fa38a | 42 | duck_register_all_codecs(rd); |
5641dccf KS |
43 | game_register_all_codecs(rd); |
44 | indeo_register_all_codecs(rd); | |
4abcd842 | 45 | ms_register_all_codecs(rd); |
4c1582cf | 46 | qt_register_all_codecs(rd); |
606c448e | 47 | rad_register_all_codecs(rd); |
5641dccf KS |
48 | realmedia_register_all_codecs(rd); |
49 | } | |
50 | ||
5ed804ae | 51 | /// Registers all known demuxers. |
5641dccf | 52 | pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) { |
38953fb5 | 53 | generic_register_all_demuxers(rd); |
5641dccf | 54 | game_register_all_demuxers(rd); |
606c448e | 55 | rad_register_all_demuxers(rd); |
5641dccf KS |
56 | realmedia_register_all_demuxers(rd); |
57 | } | |
d10c9311 | 58 | |
f52b598b KS |
59 | /// Registers all known encoders. |
60 | pub fn nihav_register_all_encoders(re: &mut RegisteredEncoders) { | |
61 | generic_register_all_encoders(re); | |
62 | ms_register_all_encoders(re); | |
63 | } | |
64 | ||
65 | /// Registers all known demuxers. | |
66 | pub fn nihav_register_all_muxers(rm: &mut RegisteredMuxers) { | |
67 | generic_register_all_muxers(rm); | |
68 | } | |
69 | ||
32f7cbe5 KS |
70 | #[cfg(test)] |
71 | extern crate nihav_registry; | |
72 | ||
d10c9311 KS |
73 | #[cfg(test)] |
74 | mod test { | |
75 | use super::*; | |
32f7cbe5 | 76 | use nihav_registry::register::get_codec_description; |
d10c9311 KS |
77 | |
78 | #[test] | |
79 | fn test_descriptions() { | |
80 | let mut rd = RegisteredDecoders::new(); | |
81 | nihav_register_all_codecs(&mut rd); | |
82 | let mut has_missing = false; | |
83 | for dec in rd.iter() { | |
84 | print!("decoder {} - ", dec.name); | |
85 | let ret = get_codec_description(dec.name); | |
86 | if let Some(desc) = ret { | |
87 | println!("{}", desc); | |
88 | } else { | |
89 | println!("missing!"); | |
90 | has_missing = true; | |
91 | } | |
92 | } | |
93 | assert!(!has_missing); | |
94 | } | |
95 | } |