Alex/or whovever is implementing DirectShow Filter:
I don’t know if you are using IMemAllocator interface to allocate IMediaSamples or something else, but here is problematic scenario:
—suppose I have a graph with PS3Eye Camera as a source filter;
—immediately connected to it my own renderer accepting yours MEDIASUBTYPE_RGB32.
As my renderer might be relatively slow: my renderer is interested in buffering source samples coming from yours output pin.
So, standard approach that works with all other source filters without any problems is:
—in my implementation of DoRenderSample( IMediaSample * pSample ) I’m just placing pSample pointer into some “buffer”, pefrom AddRef() on it and immediately return. Another thread performs processing of collected IMediaSample pointers in that “buffer”.
So, when playing with yours PS3Eye Camera source filter I’ve discovered, that contrary to other implementations if I don’t AddRef() on pSample, the program doesn’t crash, as it it does with any other capture filters. On one hand that might be great (LOL). On the other hand this tells me that there is some problem with yours IMediaSamples allocator implementation.
It looks like you might be using the same and just one IMediaSample pointer (or maybe several but finite number). It doesn’t look right, as in that scenario your source filter actually performs update of the same buffer, while another thread in downstream filter perfroms for example visualization of that buffer. Plus, such implementation defeats the purpose of buffering and obtaining each sample individualy.
On the other hand, I also noticed that, somehow even if I request 60fps from your filter, I’m getting just 45fps, while I have plenty of CPU resources (CPU<10%). If you are using standard IMemAllocator implementation this could be explained (in my opinion) by having not enough buffers created by allocator. Are you using DecideBufferSize in your OutpuPin implementation? If so, how many cBuffers are you setting in ALLOCATOR_PROPERTIES structure? Maybe you should consider increasing this number.
Just my 2 cents