Re: Who is triggering the source filter's method "FillBuffer"?



On 8 Mar 2006 03:21:20 -0800, ngxfer001@xxxxxxxxx wrote:

Hi Experts,

I originally think that the Filter Graph Manager trigger the
FillBuffer, but then I also think of the possibility that the hardware
actually trigger the FillBuffer. If this is so, the FillBuffer (for 15
frame/sec rate), it will trigger 15 times a second.

I therefore do a test, which place a transform filter (which does not
do anything but just Sleep for 5 second and pass the data to the next
filter) between the capture filter and renderer. The result is that the
FillBuffer method is not called until the last processing is finished.

Now I am very confused on the conceptual view on how the whole
DirectShow work. Can someone please give me a hint on who is actually
triggering the FillBuffer so that it will be called 15 times a second.

Thank you very much for reading this message.

Best Regards
Ferdinand

Right. There are two components. The source filter and the renderer.

The SOurce filter contains a thread which calls FillBuffer continuously.

FillBuffer sets some data and stamps the times at which they should be
rendered.

The sample buffer is passed down the graph (by the Thread in the source
filter).

The renderer receives the sample and, if the current graph time is before
the time stamp, it blocks the thread until the appropriate time arrives at
which point it presents the sample and the call returns up to the source
filter where FillBuffer is called again.

A slight complication is that there may be more than one sample buffer in
which case they are effectively queued up until the all buffers are used
and the thread is blocked in the renderer until the first buffer is due to
be rendered.

IN your case, all you have to do is to set the timestamps on the samples
correctly and DS does the rest.


Iain
--
Iain Downs (DirectShow MVP)
Commercial Software Therapist
www.idcl.co.uk
.



Relevant Pages

  • Re: framerate as fast as possible
    ... I modified the source filter from the .Net2003 filter ... it seems to me FillBuffer gets called at the ... do I achieve an as fast as possible frame rate? ... The renderer does not request ...
    (microsoft.public.win32.programmer.directx.video)
  • Who is triggering the source filters method "FillBuffer"?
    ... I originally think that the Filter Graph Manager trigger the ... FillBuffer, but then I also think of the possibility that the hardware ... which place a transform filter (which does not ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Custom Source Filter for ASF-like files
    ... Now I am explicitly setting the sync reader to pass me the uncompressed samples + fixed the buffer passing in FillBuffer() and matching the buffer sizes by calling the SetActualDataLength so all works great in GraphEdit. ... I am directly connecting my source filter to the "Default WaveOut Device" renderer filter. ... I am developing a custom source filter that parses somehow modified audio ...
    (microsoft.public.windowsmedia.sdk)
  • Re: DirectShow base classes and the possible deadlocks
    ... >> start the filter, and another thread tries to stop the filter, is: ... the CBaseFilter no longer need to lock the FilterLock before ... >thread is blocked because it is waiting for an event in FillBuffer to be set. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: delay in calling fillbuffer() in the source filter
    ... immediately after the sample is processed in the filter ... FillBuffer() method, you'll see that it looks something like ... So there is a Deliverand GetDeliveryBuffer() in between ... Maybe the encoder is too slow? ...
    (microsoft.public.win32.programmer.directx.video)

Loading