如何使DirectShow使用可用的过滤器自动创建图形

问题描述:

我想在我的应用程序中使用Medialooks多源过滤器,该输入在HKEY_CURRENT_USER \ SOFTWARE \ Classes \ CLSID \但是我仍然必须使用 CLS_ID AddFilter 函数手动添加此过滤器.

I want to use the Medialooks multisource filter in my application, This has entry in HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\ But still i have to Add this filter manually using CLS_ID and AddFilter Function.

有什么方法可以使Dshow的 Renderfile 功能通过枚举注册表中的过滤器来自动创建图形

Is there any way so that Renderfile function of Dshow will automatically creates a graph by enumerating the filters from registry

已在 Grphedt 工具中签入,但是如果我手动插入并连接滤镜,我就可以正常播放视频.否则,它不会通过构建图表自动呈现

Checked in Grphedt tool but if i manually insert and connect Filters I can play the videos properly.Otherwise it wont render automatically by building the graph

能够连接过滤器并获得您感兴趣的拓扑是一回事,并且在

Ability yo connect filters and obtain a topology of your interest is one thing, and having this sort of connection taking place during Intelligent Connect is another thing. For Intelligent Connect and RenderFile the filters of interest must be apparently registered, and then they have accurate DirectShow registration details: merit, media types. Quite so often filters are lacking this registration (and at other times they are "over-registrating" themselves so that they are picked up when they are obvious misfit).

即使您可以自己重新注册过滤器(请参见 IFilterMapper2 :: RegisterFilter )以及其他注册详细信息,通常您不这样做.准确注册是过滤器开发商的业务.对您来说,更好的选择是使用 AddFilter 调用来构建图形,在此您可以很好地控制图形的构建.或者,如果 RenderFile 首先失败,则您可能希望将其作为备用构造方法.

Even though you can re-register filter yourself (see IFilterMapper2::RegisterFilter) with alternate registration details, you typically do not do it. It's filter developer's business to register accurately. The better alternative for you is to build graph using AddFilter calls where you have fine control over graph construction. Or you might want to do it as a fallback construction method if RenderFile fails in first place.