我如何直接在EXE中嵌入DirectShow Push Source过滤器? [英] How can I directly embed a DirectShow Push Source filter in an EXE?

查看:312
本文介绍了我如何直接在EXE中嵌入DirectShow Push Source过滤器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Delphi 6程序,通过套接字从外部程序接收音频。现在,我想将该音频提供给DirectShow滤波器图形,该滤波器将创建的音频路由到PC上的不同输出滤波器。我为我的DirectShow过滤器图工作使用DSPACK。我将使用其中一个DSPACK示例,演示如何创建Push Source Filter作为我的出发点。

是否可以将DirectShow过滤器直接嵌入到我的主EXE中,还是必须创建外部DLL或AX文件并在其上运行regsvr32?我想避免创建一个外部模块,否则我将不得不创建一个参数和数据传递之间的桥梁和我的主程序,我宁愿消除这项工作。我想知道是否有办法简单地在我的主程序中包含推送源代码过滤器,并且将Windows作为DirectShow过滤器来处理,如果这是可能的话。

解决方案

过滤器不必被放入库(DLL)中,而且它们也不必被注册为COM对象。如上所述,唯一的原因是通过CoCreateInstance和/或通过枚举DirectShow类别使应用程序可用。



直接放入应用程序,它必须实现 IBaseFilter ,并将> IFilterGraph :: AddFilter 放到图中。过滤私有的好处是你不需要通过COM接口实现应用程序和过滤器之间的通信,并且你可以使用native / direct指针。

请参阅Geraint的帖子使用过滤器而不注册


I have a Delphi 6 program that receives audio from an external program via a socket. Now I want to feed that audio to a DirectShow filter graph I create that routes that audio to different output filters on the PC. I am using DSPACK for my DirectShow filter graph work. I'll be using one of the DSPACK examples that shows how to create a Push Source Filter as my starting point.

Is it possible to embed a DirectShow filter directly into my main EXE, or do I have to create an external DLL or AX file and run regsvr32 on it? I'd like to avoid creating an external module otherwise I'll have to create a parameter and data passing bridge between it and my main program and I'd prefer to eliminate that work. I'm wondering if there is a way to simply include the push source filter code in my main program and finesse Windows into working with it as a DirectShow filter if that is at all possible.

解决方案

Filters don't have to be put into libraries (DLL), and they don't have to be even registered COM objects, no. As mentioned, the only reason to make this, is to make the filter available to applications through CoCreateInstance and/or through enumeration of DirectShow categories.

Being put into your application directly, it has to implement IBaseFilter and you will IFilterGraph::AddFilter it into the graph. An advantage of having filter privately, is that you don't need to implement communication between application and filter through COM interface, and you can use native/direct pointers.

See also Geraint's post Using Filters Without Registration.

这篇关于我如何直接在EXE中嵌入DirectShow Push Source过滤器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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