{
GstV4l2Object *obj = pool->obj;
+ if (pool->streaming)
+ return TRUE;
+
switch (obj->mode) {
case GST_V4L2_IO_RW:
break;
if (!V4L2_TYPE_IS_OUTPUT (obj->type)) {
GstBufferPool *bpool = GST_BUFFER_POOL (pool);
GstBufferPoolAcquireParams params = { 0 };
+ gint n_to_q = pool->num_allocated - pool->num_queued;
GstFlowReturn ret;
- while (pool->num_queued < pool->num_allocated) {
+ while (n_to_q > 0) {
GstBuffer *buf;
params.flags = GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT;
goto requeue_failed;
gst_v4l2_buffer_pool_release_buffer (bpool, buf);
+ n_to_q--;
}
+
+ if (pool->num_allocated != pool->num_queued)
+ goto requeue_failed;
}
GST_DEBUG_OBJECT (pool, "STREAMON");
return TRUE;
}
+ pool->flushing = TRUE;
+
switch (obj->mode) {
case GST_V4L2_IO_RW:
break;
break;
}
+ pool->flushing = FALSE;
pool->streaming = FALSE;
if (pool->other_pool)
case GST_V4L2_IO_USERPTR:
case GST_V4L2_IO_DMABUF_IMPORT:
{
- if (gst_v4l2_is_buffer_valid (buffer, NULL)) {
+ if (pool->flushing) {
+ /* put back on outstanding list */
+ GST_BUFFER_POOL_CLASS (parent_class)->release_buffer (bpool,
+ buffer);
+ } else if (gst_v4l2_is_buffer_valid (buffer, NULL)) {
/* queue back in the device */
if (pool->other_pool)
gst_v4l2_buffer_pool_prepare_buffer (pool, buffer, NULL);