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