I am writing a File Source filter which has an Video output PIN, the output pin type is H.264 raw format:
HRESULT CVideoOutPin::GetMediaType(CMediaType *pMediaType)
{
CAutoLock lock(m_pFilter->pStateLock());
ZeroMemory(pMediaType, sizeof(CMediaType));
pMediaType->InitMediaType();
// {7807c3af-524f-11ce-9f53-0020af0ba770}
pMediaType->SetSubtype(&MEDIASUBTYPE_h264raw);
unsigned int * pSize = (unsigned int *) pMediaType->ReallocFormatBuffer(sizeof(unsigned int) * 2);
pSize[0] = m_pFlvFile->GetWidth();
pSize[1] = m_pFlvFile->GetHeight();
pMediaType->SetFormat((BYTE *)pSize, sizeof(unsigned int) * 2);
//*pMediaType = m_oVideoMediaType;
return S_OK;
}
I tried several decompress filter in GraphEdit.exe, and none of them can connect to my output pin.
Is there any DirectShow Filter I can use to complete the graph?
MEDIASUBTYPE_h264rawdoesn’t look like a standard media subtype. You should useMEDIASUBTYPE_AVC1(no start codes) orMEDIASUBTYPE_H264(with start codes) instead; see H.264 Media Types. If you use either of those subtypes, a suitable H.264 decoder should be able to connect to your output pin. Windows 7 comes with such an H.264 decoder, and third-party decoders should supply an appropriate input filter.