Re: custom source filter implementation

Tech-Archive recommends: Fix windows errors by optimizing your registry



thank you for your answer, but it's not working
IBaseFilter *pAS = NULL;
IFileSourceFilter *pFS = NULL;
CoCreateInstance(CLSID_AsyncSample, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void **)&pAS);
pAS->QueryInterface(IID_IAsyncReader, (void **)&pFS);

I've been trying around, but I never have access to the GetPin() function...
how do I have to create my custom filter?


Do I have to do some more registering (the IID), as described in http://groups.google.de/group/microsoft.public.win32.programmer.directx.video/browse_thread/thread/37edaf948f5c582b/d23bfb5e3dbf5de7?q=directshow+filter+iid&rnum=2&hl=de#d23bfb5e3dbf5de7

But as GetPin() is a function of CAsyncReader and

STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv)
    {
        if (riid == IID_IAsyncReader) {
            return GetInterface((IAsyncReader *)this, ppv);
....

is also part of CAsyncReader, I should have access to the GetPin() function(?)




This is not right:

IBaseFilter *pAS = NULL;
CoCreateInstance(CLSID_AsyncSample, NULL, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, (void **)&pAS);

pGB->QueryInterface(IID_IAsyncReader, (void **)&pAS); <---THIS IS WRONG, cannot use pAS like this

...You first create an instance of your filter using pAS, but then you use that same IBaseFilter to aquire an interface with (IID_IAsyncReader), which isn't going to have a pin.

You need to create a separate pointer to use with the query interface call.




.