[Bug 783049] v4l2src: buffer starvation prevent pipeline to run as expected fps

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed May 24 15:37:50 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=783049

--- Comment #1 from Guillaume Desmottes <gdesmott at gnome.org> ---
Created attachment 352510
  --> https://bugzilla.gnome.org/attachment.cgi?id=352510&action=edit
v4l2: increase by one the number of allocated buffers

Increasing this number fix a buffer starvation problem I'm hitting
with a "v4l2src ! kmssink" pipeline.

kmssink requests 2 buffer as it keeps a reference on the last rendered
one. So we were allocating 3 buffers for the pipeline.
Once the first 2 buffers have been pushed we ended up with:
- one buffer queued in v4l2
- one being pushed
- one kept as last rendered

If this 3rd buffer is released after that v4l2 used the first one to
capture we end up with a buffer starvation problem as no buffer is currently
queued in v4l2 for capture.

Fixing this by adding one extra buffer to the pipeline so when one
buffer is being pushed downstream the other can already be queued to
capture the next frame.

We were already adding 3 buffers if downstream didn't reply to the
allocation query. I reduced this number to 2 to compensate the extra
buffer which is now always added.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list