]> git.nihav.org Git - nihav.git/blame - nihav-allstuff/src/lib.rs
add nihav_qt crate with some QuickTime codecs
[nihav.git] / nihav-allstuff / src / lib.rs
CommitLineData
5ed804ae 1//! Umbrella crate to register decoders and demuxers from all known NihAV crates.
5641dccf 2extern crate nihav_core;
38953fb5 3extern crate nihav_commonfmt;
8e4fa38a 4extern crate nihav_duck;
5641dccf
KS
5extern crate nihav_game;
6extern crate nihav_indeo;
4abcd842 7extern crate nihav_ms;
606c448e 8extern crate nihav_rad;
5641dccf
KS
9extern crate nihav_realmedia;
10
38953fb5 11use nihav_core::codecs::RegisteredDecoders;
f52b598b 12use nihav_core::codecs::RegisteredEncoders;
38953fb5 13use nihav_core::demuxers::RegisteredDemuxers;
f52b598b 14use nihav_core::muxers::RegisteredMuxers;
38953fb5 15
e64739f8
KS
16use nihav_commonfmt::generic_register_all_codecs;
17use nihav_commonfmt::generic_register_all_demuxers;
f52b598b
KS
18use nihav_commonfmt::generic_register_all_encoders;
19use nihav_commonfmt::generic_register_all_muxers;
5641dccf 20
e64739f8 21use nihav_duck::duck_register_all_codecs;
8e4fa38a 22
e64739f8
KS
23use nihav_game::game_register_all_codecs;
24use nihav_game::game_register_all_demuxers;
5641dccf 25
e64739f8 26use nihav_indeo::indeo_register_all_codecs;
5641dccf 27
4abcd842 28use nihav_ms::ms_register_all_codecs;
f52b598b 29use nihav_ms::ms_register_all_encoders;
4abcd842 30
4c1582cf
KS
31use nihav_qt::qt_register_all_codecs;
32
e64739f8
KS
33use nihav_rad::rad_register_all_codecs;
34use nihav_rad::rad_register_all_demuxers;
606c448e 35
e64739f8
KS
36use nihav_realmedia::realmedia_register_all_codecs;
37use nihav_realmedia::realmedia_register_all_demuxers;
5641dccf 38
5ed804ae 39/// Registers all known decoders.
5641dccf 40pub 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 52pub 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.
60pub 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.
66pub fn nihav_register_all_muxers(rm: &mut RegisteredMuxers) {
67 generic_register_all_muxers(rm);
68}
69
32f7cbe5
KS
70#[cfg(test)]
71extern crate nihav_registry;
72
d10c9311
KS
73#[cfg(test)]
74mod 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}