#include <dshow.h>
#include <stdio.h>
void main(void)
{
IGraphBuilder *pGraph = NULL;
IMediaControl *pControl = NULL;
IMediaEvent *pEvent = NULL;
// Initialize the COM library.
HRESULT hr = CoInitialize(NULL);
if (FAILED(hr))
{
printf("ERROR - Could not initialize COM library");
return;
}
// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pGraph);
if (FAILED(hr))
{
printf("ERROR - Could not create the Filter Graph Manager.");
return;
}
hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
hr = pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
// Build the graph. IMPORTANT: Change this string to a file on your system.
hr = pGraph->RenderFile(L"D:\\Xunlei\\music\\[南拳妈妈原版KTV.MV合辑].南拳妈妈.-.[What.Can.I.Do].KTV.mpg", NULL);
if (SUCCEEDED(hr))
{
// Run the graph.
hr = pControl->Run();
if (SUCCEEDED(hr))
{
// Wait for completion.
long evCode;
pEvent->WaitForCompletion(INFINITE, &evCode);
// Note: Do not use INFINITE in a real application, because it
// can block indefinitely.
}
}
pControl->Release();
pEvent->Release();
pGraph->Release();
CoUninitialize();
}
没有合适的资源?快使用搜索试试~ 我知道了~
directshow的简单示例
共13个文件
pdb:2个
dsw:1个
exe:1个
4星 · 超过85%的资源 需积分: 9 62 下载量 102 浏览量
2008-10-24
15:45:55
上传
评论
收藏 1.59MB RAR 举报
温馨提示
directshow的简单示例 directshow的简单示例
资源推荐
资源详情
资源评论
收起资源包目录
test1.rar (13个子文件)
test1
test1.cpp 1KB
test1.dsp 4KB
test1.dsw 533B
test1.ncb 33KB
test1.plg 909B
Debug
vc60.pdb 156KB
test1.obj 24KB
test1.exe 184KB
vc60.idb 161KB
test1.pch 4.86MB
test1.pdb 457KB
test1.ilk 347KB
test1.opt 48KB
共 13 条
- 1
cygws
- 粉丝: 0
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页