目前需要把网络的数据流解码播放,我自己写了一个Source Filter,解码自己用ffmpeg实现也没什么问题,但是现在想用Decoder Filter, http://blog.csdn.net/golwatt/article/details/6546611 根据这个设置的,就是连接不上Divx那个,提示都是 媒体类型不匹配什么的,
VIDEOINFOHEADER2 *pvi = (VIDEOINFOHEADER2 *) pmt->AllocFormatBuffer(sizeof(VIDEOINFOHEADER2));
if(NULL == pvi)
return(E_OUTOFMEMORY);
ZeroMemory(pvi, sizeof(VIDEOINFOHEADER2));
pvi->bmiHeader.biCompression = MAKEFOURCC('H', '2', '6', '4');
pvi->bmiHeader.biBitCount = 24;
pvi->bmiHeader.biPlanes = 1;
pvi->bmiHeader.biWidth = m_iImageWidth;
pvi->bmiHeader.biHeight = m_iImageHeight;
pvi->AvgTimePerFrame = (REFERENCE_TIME)(20*UNITS/MILLISECONDS);
SetRectEmpty(&(pvi->rcSource)); // we want the whole image area rendered.
SetRectEmpty(&(pvi->rcTarget)); // no particular destination rectangle
pmt->SetType(&MEDIATYPE_Video);
pmt->SetFormatType(&FORMAT_VideoInfo2);
pmt->SetTemporalCompression(TRUE);
pmt->SetSubtype(&MEDIASUBTYPE_H264);
pmt->SetVariableSize();
这个也连接不上,烦请连接成功的赐教,谢谢!
------解决方案--------------------------------------------------------
coreavc的filter的话
把H264的SPS,PPS填进pbformat里面