]> git.nihav.org Git - nihav.git/blame - nihav-allstuff/src/lib.rs
vp6enc: split out future common parts to share them with VP7 encoder
[nihav.git] / nihav-allstuff / src / lib.rs
CommitLineData
5ed804ae 1//! Umbrella crate to register decoders and demuxers from all known NihAV crates.
38953fb5 2use nihav_core::codecs::RegisteredDecoders;
f27c73df 3use nihav_core::codecs::RegisteredPacketisers;
f52b598b 4use nihav_core::codecs::RegisteredEncoders;
38953fb5 5use nihav_core::demuxers::RegisteredDemuxers;
2cd9d8a6 6use nihav_core::demuxers::RegisteredRawDemuxers;
f52b598b 7use nihav_core::muxers::RegisteredMuxers;
38953fb5 8
846d6e90
KS
9use nihav_commonfmt::*;
10use nihav_duck::*;
11use nihav_flash::*;
12use nihav_game::*;
78fb6560 13use nihav_indeo::indeo_register_all_decoders;
696e4e20 14use nihav_itu::itu_register_all_decoders;
846d6e90 15use nihav_llaudio::*;
54915296 16use nihav_misc::*;
16cca4d3 17use nihav_mpeg::*;
846d6e90 18use nihav_ms::*;
78fb6560 19use nihav_qt::qt_register_all_decoders;
846d6e90
KS
20use nihav_rad::*;
21use nihav_realmedia::*;
22use nihav_vivo::*;
06480aad 23
5ed804ae 24/// Registers all known decoders.
78fb6560
KS
25pub 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.
43pub 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 49pub 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.
61pub 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.
66pub 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.
75pub 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)]
82extern crate nihav_registry;
83
d10c9311
KS
84#[cfg(test)]
85mod 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}