HydrogenAudio

Lossy Audio Compression => Ogg Vorbis => Ogg Vorbis - Tech => Topic started by: troyou on 2012-06-06 08:30:35

Title: how to get the VorbisFormat2
Post by: troyou on 2012-06-06 08:30:35
I try to decoder ogg in mediafoundation. now I have see the dshow filter but I don't understand how to create VORBISFORMAT2

struct VORBISFORMAT2
{
unsigned long channels;
unsigned long samplesPerSec;
unsigned long bitsPerSample;
unsigned long headerSize[3];  // 0: Identification, 1: Comment, 2: CodecSetup
};

VorbisDecodeInputPin::SetMediaType(const CMediaType* inMediaType)
{
  ...
  mVorbisDecoder.Init(reinterpret_cast<VORBISFORMAT2*>(inMediaType->pbFormat));
}
I don't know how to get inMediaType->pbFormat in mediafoundation. or how to get the VORBISFORMAT2‘s header by use libvorbis?
Title: how to get the VorbisFormat2
Post by: troyou on 2012-06-06 14:02:47
I have resolve it now by use vorbis_analysis_headerout