Re: Pre-buffering in Dshow

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Many thanks. If we wait in paused state, would the Fill buffer be
called continously and have samples cued up? It did not work that way
for us even though we blocked in pause....

So, we have to do the buffering in the output pin (may be use
COutputQueue) and wait in pause till its done......

On Mar 25, 5:22 pm, Geraint Davies <gerai...@xxxxxxxxxx> wrote:
On Wed, 25 Mar 2009 03:14:55 -0700 (PDT), jimble...@xxxxxxxxx wrote:
Hi,

During playback of High bitrate Mpeg-4 clips  we are getting a very
poor Frame rate. Target platform is Windows mobile.  We are using our
source filter, which is a push model source filter.

We would like to implement pre-buffering of samples in the source
filter before play back starts, so as to improve the user experience.

Does DirectShow pre-buffer samples when the graph is in paused state ,
just before moving to run?  If not, how could we implement pre-
buffering in our source filter ?

Normally, filters process data in Pause as well as Run state, except
for renderers. So when you pause the graph, data will flow through the
graph until it reaches the renderer. Renderers do not complete the
transition to pause until they receive data for rendering. So if you
pause and wait for the pause to complete (when GetState returns S_OK
rather than intermediate), you know that the pipeline is primed
through the decoder as far as the renderer.

If you want to extend this, you can delay completing the pause in your
source filter until you have reached a certain buffer level. You would
do this by reported VFW_S_STATE_INTERMEDIATE from GetState if you are
paused and have insufficient buffer (and you will need to implement
something for the case where the GetState call has a non-zero timeout
-- in this case, your GetState method blocks until the pause is
completed).

Some live source filters don't deliver data when paused, and clearly
these would not support pre-buffering. These filters prevent the
cueing mechanism by reporting VFW_S_CANT_CUE from GetState: if any
filters in the graph report this, the graph will not wait for pause to
complete before entering run mode.

G

.



Relevant Pages

  • Re: Pre-buffering in Dshow
    ... source filter, which is a push model source filter. ... Does DirectShow pre-buffer samples when the graph is in paused state, ... Normally, filters process data in Pause as well as Run state, except ... Renderers do not complete the ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: cin.get() does not work if there is a previous cin?
    ... >According to Josuttis, 'sync' will sync the buffer, ... >it clears characters from the buffer. ... >inline void Pause() ... Dietmar Khuel, Angelica Langer and Nico Josuttis, I still failed to find ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Lipsync problem with video and audio
    ... It seems to have a buffer internally and I suspect it is at ... source filter is called). ... between a/v frames of 30 to 60ms before the filter. ... the audio renderer starts inserting silence because ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: LiveSource, IQualityControl
    ... I don't want to process only keyframe from my source filter because key ... frames may be distant by a huge number of frames. ... The mpeg4 decompressor that I used is mine. ... and then fills it with a sample from the buffer. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: Reading audio samples
    ... samples could be stored in a buffer for the next reading ... needs to call SetPositions() every time to set the new stop position. ... mechanism we discussed so that you can use pause instead of stop. ...
    (microsoft.public.win32.programmer.directx.audio)