社区
界面
帖子详情
DirectShow: 编写输出YUV的Filter,如何写GetMediaType函数?
wmrwinhap
2004-09-09 04:42:36
任一种格式的YUV都可以,盼高人复!
不胜感谢!
...全文
211
3
打赏
收藏
DirectShow: 编写输出YUV的Filter,如何写GetMediaType函数?
任一种格式的YUV都可以,盼高人复! 不胜感谢!
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
wmrwinhap
2004-09-10
打赏
举报
回复
成功,非常感谢!
DentistryDoctor
2004-09-09
打赏
举报
回复
GetMediaType(int iPosition, CMediaType *pmt)
你可根据情况返正其它格式,但一次只能返正一种格式。
DentistryDoctor
2004-09-09
打赏
举报
回复
CheckPointer(pmt,E_POINTER);
if (iPosition < 0)
{
return E_INVALIDARG;
}
// Have we run off the end of types
if( iPosition > 0 )
{
return VFW_S_NO_MORE_ITEMS;
}
VIDEOINFOHEADER vih;
memset( &vih, 0, sizeof( vih ) );
vih.bmiHeader.biCompression = MAKEFORCC('Y','U','Y','V');
vih.bmiHeader.biBitCount = 16;
vih.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
vih.bmiHeader.biWidth = DEFAULT_WIDTH;//Your size.x
vih.bmiHeader.biHeight = DEFAULT_HEIGHT;//Your size.y
vih.bmiHeader.biPlanes = 1;
vih.bmiHeader.biSizeImage = GetBitmapSize(&vih.bmiHeader);
vih.bmiHeader.biClrImportant = 0;
pmt->SetType(&MEDIATYPE_Video);
pmt->SetFormatType(&FORMAT_VideoInfo);
pmt->SetFormat( (BYTE*) &vih, sizeof( vih ) );
pmt->SetSubtype(&MEDIASUBTYPE_YUY2);
pmt->SetSampleSize(vih.bmiHeader.biSizeImage);
Directshow
使用ffmpeg构建解码
filter
Directshow
作为windows平台的多媒体开发框架,个人感觉还是不错的。
《微软:
DirectShow
开发指南》第11章 Using the Sample Grabber
Filter
Although many Microsoft
DirectShow
applications will benefit from the creation of a transform
filter
, transform
filter
s can be difficult to test. Often, a programmer needs to construct a second
filter
Directshow
的
Filter
开发简要步骤
本文的
Filter
名为Gray
Filter
,把
YUV
视频信号转化为灰度信号,造成黑白电视的效果。 1. 配置开发环境 1. VC中在Tools->Options->Directories 设置好DirectX SDK的头文件和库文件路径 2. 编译了基类源
做了一个
directshow
的
filter
,把RGB视频流变成黑白的
http://blog.csdn.net/mengaim_cn/archive/2005/01/05/241449.aspx 做的这个
directshow
的
filter
属于transform
filter
。在其间,参考了,
directshow
的帮助文档,一本外文的介绍
directshow
的书(这本书不错,里面的...
《微软:
DirectShow
编程》第一章
DirectShow
的基本概念
The basicsChapter 1
DirectShow
Concepts From the viewpoint of the application programmer, Microsoft
DirectShow
is composed of two
type
s of classes of objects:
filter
s, the atomic entities of Direct.....
界面
15,979
社区成员
115,896
社区内容
发帖
与我相关
我的任务
界面
VC/MFC 界面
复制链接
扫一扫
分享
社区描述
VC/MFC 界面
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章