求一段directshow播放socket接收到的视频信息的代码

knaverabbit 2011-08-21 10:30:38
求一段directshow播放socket接收到的视频信息的代码,最好是c++的
...全文
95 点赞 收藏 4
写回复
4 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
lbxxjl 2012-09-25
//接收端
void CCapture::ReceiveVedio(HWND m_hWnd)
{
HRESULT hr;
CoCreateInstance(CLSID_CaptureGraphBuilder2 , NULL, CLSCTX_INPROC,
IID_ICaptureGraphBuilder2, (void **) &pCapture);
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pReceiveGrap);
hr = CoCreateInstance(CLSID_DSNetReceive, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void**)&pReceive); //接收端
hr = CoCreateInstance(CLSID_VideoDeCompressorCategory, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void**)&pDecodec); //解码器
hr = CoCreateInstance(CLSID_VideoRenderer,0,CLSCTX_ALL,
IID_IBaseFilter,(void**)&pReceivePreview);
hr =pReceiveGrap->AddFilter(pReceive,L"Xvid Receive");
ParameterSetReceive(pReceive);

pCapture->SetFiltergraph(pReceiveGrap);
hr =pReceiveGrap->AddFilter(pDecodec,L"Xvid Decodec");
hr =pReceiveGrap->AddFilter(pReceivePreview,L"Previvew");
//连接引脚
IPin *p1Out=FindPin(pReceive,PINDIR_OUTPUT);
IPin *p2In=FindPin(pDecodec,PINDIR_INPUT);
hr=pReceiveGrap->Connect(p1Out,p2In);

IPin *p2Out=FindPin(pDecodec,PINDIR_OUTPUT);
IPin *p3In=FindPin(pReceivePreview,PINDIR_INPUT);
hr=pReceiveGrap->Connect(p2Out,p3In);

pReceiveGrap->QueryInterface(IID_IVideoWindow,(LPVOID*)&pReceiveViewWindow);
SetVideoWindow(m_hWnd,pReceiveViewWindow);
}
请采纳,修改
回复
乔巴好萌 2011-08-22
你socket收到的是啥类型的数据啊
直接用GDI就可以
回复
ouyh12345 2011-08-22
ffdshow
回复
wintree 2011-08-22
不懂接分~
回复
相关推荐
发帖
其它技术问题
创建于2007-09-28

3849

社区成员

C/C++ 其它技术问题
申请成为版主
帖子事件
创建了帖子
2011-08-21 10:30
社区公告
暂无公告