STDMETHODIMP_(bool) TffdshowDecAudioInputPin::getsf(TsampleFormat &outsf) { if (!audio) { outsf = CurrentMediaType(); DPRINTF(_l("TffdshowDecAudioInputPin::getsf audio codec not initialized yet")); if (spdif_codec(codecId)) { outsf = TsampleFormat::createMediaTypeSPDIF(outsf.freq); outsf.alternateSF = filter->insf.alternateSF; return true; } else if (bitstream_codec(audio->codecId)) { outsf.sf = TsampleFormat::getSampleFormat(codecId); outsf.alternateSF = filter->insf.alternateSF; return true; } } else { if (spdif_codec(audio->codecId)) { // Special media type for SPDIF (AC3/DTS) outsf = TsampleFormat::createMediaTypeSPDIF(audio->getInputSF().freq); outsf.alternateSF = filter->insf.alternateSF; return true; } else if (bitstream_codec(audio->codecId)) { outsf = audio->getInputSF(); outsf.sf = TsampleFormat::getSampleFormat(codecId); outsf.alternateSF = filter->insf.alternateSF; return true; } else { outsf = audio->getInputSF(); } } return false; }
TaudioCodec* TaudioCodec::getDecLib(CodecID codecId,IffdshowBase *deci,IdecAudioSink *sink) { TaudioCodec *movie; if (lavc_codec (codecId)) { movie=new TaudioCodecLibavcodec(deci,sink); } else if (raw_codec (codecId)) { movie=new TaudioCodecUncompressed(deci,sink); } else if (codecId==CODEC_ID_LIBMAD) { movie=new TaudioCodecLibMAD(deci,sink); } else if (codecId==CODEC_ID_LIBFAAD) { movie=new TaudioCodecLibFAAD(deci,sink); } else if (codecId==CODEC_ID_AVISYNTH) { movie=new TaudioCodecAvisynth(deci,sink); } else if (codecId==CODEC_ID_LIBA52) { movie=new TaudioCodecLiba52(deci,sink); } else if (codecId==CODEC_ID_LIBDTS) { movie=new TaudioCodecLibDTS(deci,sink); } else if (spdif_codec(codecId) || bitstream_codec(codecId)) { movie=new TaudioCodecBitstream(deci,sink); } else { return NULL; } movie->codecId=codecId; return movie; }