v4l2bufferpool: Only resurrect the right amount of buffers 49/252149/1 accepted/tizen/6.0/unified/hotfix/20210126.031700 submit/tizen_6.0_hotfix/20210125.065630
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 26 Jun 2020 18:48:14 +0000 (14:48 -0400)
committerJeongmo Yang <jm80.yang@samsung.com>
Mon, 25 Jan 2021 01:55:54 +0000 (10:55 +0900)
commitadec0d2cef933e2b510a0cf9102d36bdef1c568f
tree4b182350f7fdf84b7e548346eca45e7d745920e0
parenta0de2b21c90b4adc3bc1db3b4c25116c41ba9a96
v4l2bufferpool: Only resurrect the right amount of buffers

On streamon, we need to resurrect (queue back) some buffers, as during
flushign seek we'd endup with an empty queued. We initially started with
resurrecting as many as we could without blocking, but that miss-behaved with
dynamic CREATE_BUFS, causing the pool to grow dramatically. This was limited
by the number of allocated buffers, but this still tried to resurrect too many
buffers for the first run, as activating the pool will queued buffers.

In this patch, we calculte the missing detal in the queue and only try and
resurrect that amount of buffers.

Change-Id: I3257c66f4049c55fa714ed639eeb56053b805277
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/651>
Signed-off-by: Jeongmo Yang <jm80.yang@samsung.com>
packaging/gst-plugins-good.spec
sys/v4l2/gstv4l2bufferpool.c