]>
Commit | Line | Data |
---|---|---|
87927c57 KS |
1 | use nihav_core::demuxers::*; |
2 | ||
3 | #[allow(unused_macros)] | |
4 | macro_rules! validate { | |
5 | ($a:expr) => { if !$a { println!("check failed at {}:{}", file!(), line!()); return Err(DemuxerError::InvalidData); } }; | |
6 | } | |
7 | ||
8 | #[cfg(feature="demuxer_ape")] | |
9 | mod ape; | |
10 | #[cfg(feature="demuxer_flac")] | |
11 | mod flac; | |
2cd9d8a6 KS |
12 | #[cfg(feature="demuxer_flac")] |
13 | mod flacraw; | |
87927c57 KS |
14 | #[cfg(feature="demuxer_tta")] |
15 | mod tta; | |
16 | #[cfg(feature="demuxer_wavpack")] | |
17 | mod wavpack; | |
18 | ||
ac818eac | 19 | const 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. | |
31 | pub 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 | |
37 | const 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. | |
43 | pub 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 | } |