]> git.nihav.org Git - nihav.git/blame - nihav-llaudio/src/demuxers/mod.rs
nihav_llaudio: add conditional compilation for modules
[nihav.git] / nihav-llaudio / src / demuxers / mod.rs
CommitLineData
87927c57
KS
1use nihav_core::demuxers::*;
2
3#[allow(unused_macros)]
4macro_rules! validate {
5 ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } };
6}
7
8#[cfg(feature="demuxer_ape")]
9mod ape;
10#[cfg(feature="demuxer_flac")]
11mod flac;
2cd9d8a6
KS
12#[cfg(feature="demuxer_flac")]
13mod flacraw;
87927c57
KS
14#[cfg(feature="demuxer_tta")]
15mod tta;
16#[cfg(feature="demuxer_wavpack")]
17mod wavpack;
18
ac818eac 19const LL_AUDIO_DEMUXERS: &[&dyn DemuxerCreator] = &[
87927c57
KS
20#[cfg(feature="demuxer_ape")]
21 &ape::APEDemuxerCreator {},
22#[cfg(feature="demuxer_flac")]
23 &flac::FLACDemuxerCreator {},
24#[cfg(feature="demuxer_tta")]
25 &tta::TTADemuxerCreator {},
26#[cfg(feature="demuxer_wavpack")]
27 &wavpack::WavPackDemuxerCreator {},
28];
29
30/// Registers all available demuxers provided by this crate.
31pub fn llaudio_register_all_demuxers(rd: &mut RegisteredDemuxers) {
32 for demuxer in LL_AUDIO_DEMUXERS.iter() {
33 rd.add_demuxer(*demuxer);
34 }
35}
2cd9d8a6
KS
36
37const LL_RAW_AUDIO_DEMUXERS: &[&dyn RawDemuxerCreator] = &[
38#[cfg(feature="demuxer_flac")]
39 &flacraw::FLACDemuxerCreator {},
40];
41
42/// Registers all available raw stream demuxers provided by this crate.
43pub fn llaudio_register_all_raw_demuxers(rd: &mut RegisteredRawDemuxers) {
44 for demuxer in LL_RAW_AUDIO_DEMUXERS.iter() {
45 rd.add_demuxer(*demuxer);
46 }
47}