I have written a DirectShow source filter
and the source filter’s outpin is connected to the ffdshow Video Decoder Filter.
It works very well in GraphEdit because I connect them manually.
now I am trying to make it to work in Windows Media Player. and the problem is about the decoder filter.
How can I limit the decoder filter to “ffdshow Video Decoder” in my source filter? from CheckMediaType ? I want “ffdshow Video Decoder” is the only filter can be connected to the OutPin, and it also can be automatically connected in WMP. if this decoder filter is not installed, the graph should not work.
Thanks for any help and I will back 12 hours later to check the answer:)
In your output pin class override
IPin::Connectmethod. There you will haveIPininterface of the pin you are being connected to. You want this to be nothing but ffdshow video decoder’s input pin, so you doIPin::QueryPinInfothere and obtain pin’s filter. There you doIBaseFilter::GetClassIDand compare obtainedCLSIDto the one you know and expect. You return failure on mismatch.This was how to connect only to the filter you want. Another thing is that application might not even try the filter you need, in this case you might want to implement
IStreamBuilderto possibly suggest the filter for connection on the output pin.