为DirectShow创建新的媒体类型 [英] Creating new media type for directshow

查看:57
本文介绍了为DirectShow创建新的媒体类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用DirectShow支持我的自定义媒体类型.

我开发了myparser.au过滤器,该过滤器将从  {& MEDIATYPE_Stream,& MEDIASUBTYPE_NULL}并进行一些解析,以确保这是我的媒体类型.

在graphedit中,我可以使用文件源异步"打开媒体文件(test.abc).过滤器,然后将其指向我的"myparser"筛选.

问题在于如何使图形自动使用文件源异步"功能.打开我的文件并将其指向myparser?

我已经尝试在regedit中添加带有myparser的guid的MEDIATYPE/extensions/.abc添加源过滤器?(尽管我知道它不是源过滤器,并且不起作用.)

1)因此,我可以跳过编写自己的源过滤器的过程,而使用文件源异步"吗?代替吗?

2)如果Q1是,那么我应该在.abc扩展名的注册表中使用哪个GUID

3)如何减少graphedit知道"myparser"需要解析.abc. filter

I am trying to use directshow to support my custom media type.

I developer a myparser.au filter which will take upstream from  {&MEDIATYPE_Stream, &MEDIASUBTYPE_NULL} and do some parse to ensure that is my media type.

In graphedit, I can open my media file(test.abc) using "file source async" filter, and point it to my "myparser" filter.

The problem down to how can i make the graphic automatically use "file source async" to open my file and point it to myparser??

I have try in regedit adding MEDIATYPE/extensions/.abc adding source filter with guid of my myparser?(Although I know it is not a source filter, and is doesn't work.)

1) So can I skip the process of writing my own source filter and use the "file source async" instead?

2) If Q1 is yes, which GUID I should use in the registry of the .abc extension

3) How to less graphedit know that the .abc is needed to be parse by the "myparser" filter

推荐答案

在.abc注册表项中,将Source Filter设置为具有文件源(异步)的clsid,然后添加"Media Type"和子类型"带有自定义媒体类型(例如MEDIATYPE_Stream,MEDIASUBTYPE_ABC)的GUID的值.然后,您可能还想更改您的 解析器为该特定子类型注册自身(这与过滤器的引脚是否实际接受subtype_null无关).

In your .abc registry key, set Source Filter to have the clsid of File Source (Async), and then add "Media Type" and "Subtype" values with the GUIDs for your custom media type (eg MEDIATYPE_Stream, MEDIASUBTYPE_ABC). You might then also want to change your parser to register itself for that specific subtype (this is independent from whether the filter's pin actually accepts subtype_null).

您也可以使用遮罩/测试图案来代替文件扩展名.参见http://msdn.microsoft.com/zh-cn/library/dd377513(v = vs.85).aspx

You can also use a mask/test pattern instead of the file extension. See http://msdn.microsoft.com/en-us/library/dd377513(v=vs.85).aspx

G


这篇关于为DirectShow创建新的媒体类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆