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>