How can I unref buffers that I cannot process?

Tim-Philipp Müller t.i.m at zen.co.uk
Tue Jul 16 08:58:01 PDT 2013


On Tue, 2013-07-16 at 11:18 -0400, Santiago Olivera wrote:

> Hi, thanks a lot for the nice solution. I am using the leaky queue
> now, but I am not sure if it is working properly. How does it now that
> my element is busy processing a previous buffer?

It doesn't, not directly anyway. A queue will start a new thread on its
source pad, which is basically

  while (!empty) {
    buffer = pop_buffer()
    push_buffer (buffer)
  }

done in a loop. Then there's another thread, the one from the udpsrc
which will push packets into the queue. When that happens, the queue can
see whether it's "full" or not. If it's full, the other thread is still
busy processing something and doesn't have time for this buffer right
now. In that case, you can decide whether to drop(leak) the new buffer
or the old buffer in the queue (or to block udpsrc until space becomes
available, in which case packets will be dropped when the udp receive
buffer fills up).

Cheers
 -Tim



More information about the gstreamer-devel mailing list