[gst-devel] Streaming video and the 'queue' plugin

Steve Baker steve at stevebaker.org
Wed Mar 12 01:09:19 CET 2003


On Wed, 2003-03-12 at 16:50, Martin Janzen wrote:
> A sharp-eyed reader will notice that the "min_threshold_bytes"
> property is not a part of the standard queue.  I've added this so
> that, when the queue is emptied, the reader thread (the "downstream"
> side of the queue) is not awakened by  a "not_empty" signal until
> the queue has refilled to at least this level.  Without it, the
> queue level bounces along near the bottom, rather than filling to a
> reasonable level:
> 
> Before:              After:
> 
>                         +--------- block reader thread
>                         |      +-- signal reader thread
>                         |      |              /
>                         v      v             /|
>                                    /   min_threshold_bytes
>                       - - - - -/- /|- - - -/- | - - - - - -
>                               /| / |  /   /   | /  __
>                              / |/  | /|  /    |/| /   etc.
>                             /      |/ | /       |/
>     /   /    ^          /  /          |/
> __/|__/|___/|__      _/|_/
> 
> 
> A similar threshold could be added easily to block the "upstream"
> writer thread until a full queue drops below a threshold, rather
> than waking it as soon as anything is removed, as at present.
> In my application I just allow it to leak downstream, since
> blocking the incoming UDP traffic is not possible.
> 
> I'm happy to submit this simple patch, if anyone else wants it.
> But I was a bit surprised that the queue didn't do something like
> this already.  Does this mean that I am missing something?  Has
> anyone else used GStreamer for similar network-based streaming
> applications which benefit from pre-buffering?  Is there another
> way to do this?

I think this patch would be useful. We need something like this for
gst-player so that we can have decent buffering for network streamed
media.

cheers
-- 
Steve Baker <steve at stevebaker.org>






More information about the gstreamer-devel mailing list