I am trying to use a custom DirectShow video capture filter to source Windows Media Encoder. I have parts of the filter completed. Basically, I can register it and looks like a video capture filter. It's just haven't implemented the "work" it has to do. It also shows up in the Windows Media Encoder UI as a possible capture device. So far so good.

The next part that I was working on was writing a simple command-line tool that fit all the pieces together.

I set the input on the IWMEncSource like so:
videoSrc->SetInput("device://RTP Video Capture Filter");
In order for me to tell the filter about the RTP stream, I implemented the IFileSourceFilter interface. This allows me to load the details using SDP. Next, reading through documentation I see that I must call IWMEncoder::PrepareToEncode() before it will actually try to create an instance of the specified input. Easy enough.

Based on a log my capture filter creates, I can see that WME is instantiating an instance of it (Actually, it seems to create 8 copies. All of which it releases except the last). Now, I need to get a hold of that instance, so that I can call IFileSourceFilter methods.

unk->QueryInterface(IID_IFileSourceFilter, &fSrcFilter);
Here is where the problem begins. QueryInterface() fails with E_NOINTERFACE (and yes, I have tested to make sure that my filter handles the QueryInterface() call properly). I have tried querying for numerous different interfaces to see what I could find out about the "source plugin", but they all failed with the same error.

So, my question is: what does GetSourcePlugin() return? And if it's not my capture filter, how do I get it?

Sorry for the long post. I figured that I would give all the details.