delphifilterdirectshowapplication-shutdowndspack

What Directshow filter event can I use to unblock the source stream thread upon filter shutdown?


I have a DirectShow filter written in Delphi 6 using the DSPACK component library. It is a push source video filter. The filter blocks on an event that is signaled in another thread that generates the video frames. When a frame is ready, it is written into a shared memory area that the FillBuffer() method accesses when it is unblocked. Is there a convenient DirectShow event that I can piggyback to unblock the FillBuffer() thread when the filter is being shutdown by DirectShow? If not, what is "standard practice" in this area?


Solution

  • Standard practice is WaitForMultipleObjects function and friends. You are waiting for one of the events that unlock your FillBiffer: availability of new video frame from external source, stop request arriving to your filter etc.