Understanding ring buffer in queue2, ring-buffer-max-size Vs max-size-bytes

Tim Müller tim at centricular.com
Tue Feb 21 09:18:45 UTC 2017


On Tue, 2017-02-21 at 00:43 -0800, Baby Octopus wrote:

Hi,

> I'm using queue2 for pull mode operation. One parameter that I'm
> unable to find resource is ring-buffer-max-size. How is it different
> from max-size-bytes? I see MAX of these two values is used in queue2
> code. 
> 
> Is there any relationship that we should maintain across the two? My
> application is going into deadlock with jerky audio when both are set
> to 10MB. Deadlock goes off when ring-buffer-max-size = 2 * max-size-
> bytes
> 
> gst-launch-1.0 filesrc ! tee ! queue2 ring-buffer-max-size=20000000
> max-size-bytes=10000000 ! .. works fine
> 
> It would be helpful if there is any documentation on this

I did not check the code, but from memory it's simply that ring-buffer-
max-size enables a special queue2 mode where queue2 maintains a ring
buffer in RAM an lets downstream operate in pull mode while upstream
operates in push mode. With ring-buffer-max-size not set (and also no
backing temp file set), queue2 will operate like a normal queue.

You would typically not set both sizes. What you describe sounds like a
bug, I think it should probably ignore max-size-bytes if it operates in
ring buffer mode, which I don't know if it does in your case.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list