How can I directly embed a DirectShow Push Source filter in an EXE?

醉酒当歌 提交于 2019-12-01 23:22:46

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.

I think the only reason to put your filters in a DLL is to be able to use them in multiple programs. On the other hand, if you were to put your filters into a DLL you could always have them implement an inferface that you QI for when you need it.

In my work, I had to play movies that were stored within a proprietary archive file. I made a source that had an output pin that described its media format properly, and the rest worked automatically, if I wanted it to. I also needed to use a proprietary renderer for the video. All this stuff was built into the .exe which was written in C++

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!