1 use nihav_core::demuxers::*;
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); } };
8 #[cfg(not(debug_assertions))]
9 macro_rules! validate {
10 ($a:expr) => { if !$a { return Err(DemuxerError::InvalidData); } };
13 #[cfg(feature="demuxer_ape")]
15 #[cfg(feature="demuxer_flac")]
17 #[cfg(feature="demuxer_flac")]
19 #[cfg(feature="demuxer_tta")]
21 #[cfg(feature="demuxer_wavpack")]
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 {},
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);
42 const LL_RAW_AUDIO_DEMUXERS: &[&dyn RawDemuxerCreator] = &[
43 #[cfg(feature="demuxer_flac")]
44 &flacraw::FLACDemuxerCreator {},
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);