]>
Commit | Line | Data |
---|---|---|
5ed804ae | 1 | //! Umbrella crate to register decoders and demuxers from all known NihAV crates. |
38953fb5 | 2 | use nihav_core::codecs::RegisteredDecoders; |
f27c73df | 3 | use nihav_core::codecs::RegisteredPacketisers; |
f52b598b | 4 | use nihav_core::codecs::RegisteredEncoders; |
38953fb5 | 5 | use nihav_core::demuxers::RegisteredDemuxers; |
2cd9d8a6 | 6 | use nihav_core::demuxers::RegisteredRawDemuxers; |
f52b598b | 7 | use nihav_core::muxers::RegisteredMuxers; |
38953fb5 | 8 | |
846d6e90 KS |
9 | use nihav_commonfmt::*; |
10 | use nihav_duck::*; | |
11 | use nihav_flash::*; | |
12 | use nihav_game::*; | |
78fb6560 | 13 | use nihav_indeo::indeo_register_all_decoders; |
696e4e20 | 14 | use nihav_itu::itu_register_all_decoders; |
846d6e90 | 15 | use nihav_llaudio::*; |
54915296 | 16 | use nihav_misc::*; |
16cca4d3 | 17 | use nihav_mpeg::*; |
846d6e90 | 18 | use nihav_ms::*; |
78fb6560 | 19 | use nihav_qt::qt_register_all_decoders; |
846d6e90 KS |
20 | use nihav_rad::*; |
21 | use nihav_realmedia::*; | |
22 | use nihav_vivo::*; | |
06480aad | 23 | |
5ed804ae | 24 | /// Registers all known decoders. |
78fb6560 KS |
25 | pub fn nihav_register_all_decoders(rd: &mut RegisteredDecoders) { |
26 | generic_register_all_decoders(rd); | |
27 | duck_register_all_decoders(rd); | |
92d9fb69 | 28 | flash_register_all_decoders(rd); |
78fb6560 KS |
29 | game_register_all_decoders(rd); |
30 | indeo_register_all_decoders(rd); | |
696e4e20 | 31 | itu_register_all_decoders(rd); |
87927c57 | 32 | llaudio_register_all_decoders(rd); |
54915296 | 33 | misc_register_all_decoders(rd); |
16cca4d3 | 34 | mpeg_register_all_decoders(rd); |
78fb6560 KS |
35 | ms_register_all_decoders(rd); |
36 | qt_register_all_decoders(rd); | |
37 | rad_register_all_decoders(rd); | |
38 | realmedia_register_all_decoders(rd); | |
06480aad | 39 | vivo_register_all_decoders(rd); |
5641dccf KS |
40 | } |
41 | ||
f27c73df KS |
42 | /// Registers all known packetisers. |
43 | pub fn nihav_register_all_packetisers(rp: &mut RegisteredPacketisers) { | |
2cd9d8a6 | 44 | llaudio_register_all_packetisers(rp); |
f27c73df KS |
45 | mpeg_register_all_packetisers(rp); |
46 | } | |
47 | ||
5ed804ae | 48 | /// Registers all known demuxers. |
5641dccf | 49 | pub fn nihav_register_all_demuxers(rd: &mut RegisteredDemuxers) { |
fd7e6906 | 50 | duck_register_all_demuxers(rd); |
38953fb5 | 51 | generic_register_all_demuxers(rd); |
92d9fb69 | 52 | flash_register_all_demuxers(rd); |
5641dccf | 53 | game_register_all_demuxers(rd); |
87927c57 | 54 | llaudio_register_all_demuxers(rd); |
606c448e | 55 | rad_register_all_demuxers(rd); |
5641dccf | 56 | realmedia_register_all_demuxers(rd); |
06480aad | 57 | vivo_register_all_demuxers(rd); |
5641dccf | 58 | } |
d10c9311 | 59 | |
2cd9d8a6 KS |
60 | /// Registers all known raw stream demuxers. |
61 | pub fn nihav_register_all_raw_demuxers(rd: &mut RegisteredRawDemuxers) { | |
62 | llaudio_register_all_raw_demuxers(rd); | |
63 | } | |
64 | ||
f52b598b KS |
65 | /// Registers all known encoders. |
66 | pub fn nihav_register_all_encoders(re: &mut RegisteredEncoders) { | |
92d9fb69 | 67 | flash_register_all_encoders(re); |
f52b598b | 68 | generic_register_all_encoders(re); |
3952bfd9 | 69 | duck_register_all_encoders(re); |
c11ad64e | 70 | llaudio_register_all_encoders(re); |
f52b598b KS |
71 | ms_register_all_encoders(re); |
72 | } | |
73 | ||
74 | /// Registers all known demuxers. | |
75 | pub fn nihav_register_all_muxers(rm: &mut RegisteredMuxers) { | |
92d9fb69 | 76 | flash_register_all_muxers(rm); |
f52b598b | 77 | generic_register_all_muxers(rm); |
c11ad64e | 78 | llaudio_register_all_muxers(rm); |
f52b598b KS |
79 | } |
80 | ||
32f7cbe5 KS |
81 | #[cfg(test)] |
82 | extern crate nihav_registry; | |
83 | ||
d10c9311 KS |
84 | #[cfg(test)] |
85 | mod test { | |
86 | use super::*; | |
32f7cbe5 | 87 | use nihav_registry::register::get_codec_description; |
d10c9311 KS |
88 | |
89 | #[test] | |
90 | fn test_descriptions() { | |
91 | let mut rd = RegisteredDecoders::new(); | |
78fb6560 | 92 | nihav_register_all_decoders(&mut rd); |
d10c9311 KS |
93 | let mut has_missing = false; |
94 | for dec in rd.iter() { | |
95 | print!("decoder {} - ", dec.name); | |
96 | let ret = get_codec_description(dec.name); | |
97 | if let Some(desc) = ret { | |
98 | println!("{}", desc); | |
99 | } else { | |
100 | println!("missing!"); | |
101 | has_missing = true; | |
102 | } | |
103 | } | |
104 | assert!(!has_missing); | |
105 | } | |
106 | } |