v4l2bufferpool: Don't queue all the buffers before dequeueing first

For output device, we where queuing all the buffers, and then we would
dequeue one. This means we only have 1 buffer for the pipeline, no matter
the size of the queue. Instead, start dequeued when min_latency is reached.
Eventually, this the min_latency should also be affected by control
MIN_BUFFERS_FOR_OUTPUT (use by encoders).
This commit is contained in:
Nicolas Dufresne 2014-05-24 23:51:58 -04:00
parent ffb7a78798
commit bc002d579f

View file

@ -1633,8 +1633,7 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer ** buf)
}
}
if (g_atomic_int_get (&pool->num_queued) ==
gst_v4l2_allocator_num_allocated (pool->vallocator)) {
if (g_atomic_int_get (&pool->num_queued) >= pool->min_latency) {
GstBuffer *out;
/* all buffers are queued, try to dequeue one and release it back
* into the pool so that _acquire can get to it again. */