views:

43

answers:

1

Hello

I need to write a DirectShow capture filter that wraps the "real" video device (fitler) and deinterlaces the captured video. From the interface perspective, this has to be a separate video device available in enumerator and when choosen, it connects to a real video device and inserts a transform filter (deinterlace) between video device output pin and the its own output pin. My question is - is my approach correct? I want to simply develop a DShow capture video filter, instantiate a transform filter within and connect pins from my filter automatically. Is there a better way to "inject" a transfrom filter between a real video device and the application that uses it? Regards

Dominik Tomczak

+1  A: 

To deinterlace without a wrapper, you can create a transform filter and give it a very high merit, that way it can be automatically added (injected) to graphs. See MatrixMixer which does something simular for audio.

If you really need a wrapper, create a second graph with the original video device and the transform filter. Then transfer the output into the graph where your wrapper filter is in. See GMFBridge for an example how to use the output of graph A as the input of graph B.

Wimmel
Thanks for answer. Does high merit causes automatic filter injection into any graph? How can I control into which graphs will my transform filter be injected?
dominolog
For 2nd answer, do I really need a second graph? Can't I just inject fillters into the application graph?
dominolog
If you want to inject filters into the graph, just take a look how matrixmixer works. Install it on your pc, use graphedit, add an audio capture filter, choose render or connect manually to a renderer. You can control yourself when a filter is added to a graph. For example you must take care it is not added twice to the same graph.
Wimmel
If an application adds an capture filter to a graph, it really expects an capture filter to be added. For example it should have an output pin called "capture". So you can't just add two filters instead. But when two filters are connected, there is no problem if a different filter is put in between. See the difference between Connect and ConnectDirect.
Wimmel