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