How pull filter and push filter works?
I am reading the MS SDK documents but still don't understand how the filter receiving and sending the stream data.The current problem is I inherited a set of filters from previous developer and the graph got lock-up after a minute of receive stream data. The MS a-sync sample was use as source filter and the CTee was use as transform filter (lockup at this point). I am very new to Direct Show. How I am going to debug this lock-up problem.Would you give me some hints? Which function in filter would allow negotiation pins connection?
Thank you,
I'm moving this thread over to the DirectShow forum, in case anyone on that forum has some ideas. Please see:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=959699&SiteID=1
Thanks!
-
Mike Wasson, DirectShow SDK Documentation
This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
(c) 2006 Microsoft Corporation. All rights reserved.
The async filter uses IAsyncReader for the output pin. With this interface, the downstream filter pulls (requests) data from the async filter. There are two ways for the downstream filter to get data from the async filter:
- Asynchronous: Call Request, which returns immediately. Then call WaitForNext, which blocks until the request is completed (or the timeout elapses)
- Synchronous: Call SyncRead or SyncReadAligned. These methods block until the read completes.
The CTee filter uses IMemInputPin. With this interface, the upstream filter pushes data to the CTee filter.
These two interfaces are not compatible, so if the async filter is connecting directly to the CTee filter, then I'm guessing the CTee filter was modified to use IAsyncReader. If so, then somewhere inside the CBaseInputPin::CheckConnect or CompleteConnect method, the CTee filter will QI the upstream pin for IAsyncReader.
-
Mike Wasson, DirectShow SDK Documentation
This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use.
(c) 2006 Microsoft Corporation. All rights reserved.
Hi Mike
Until now I am still fussy in MS DS area,I read the MS MSDN documents “Introduction to DirectShow Filter Development” but I still don’t understand how the pin(s) are negotiate with each other. I walked through the MS a-sync filter but can’t get it to connect with any render filter available from the current library. Would you give me some data flow how pin and sample transfer between two filters (what functions get call at pin negotiate and what functions get call when data transfer).I want to take a class on Direct Show filters development. Do you have any suggestion (from whom, where, and what)?
Sincerely,
Starfish
The basic difference is that the 'push model' uses the 'FillBuffer' method of the CSourceStream extender class to push raw samples of data and the 'pull model' uses IAsyncReader to receive data requests from the downstream filter (either Synchronously or Asynchronously). Lastly, both models only concert to the output pin, the CSource extender just allows instantiation.