Commit 8d6e72a2 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

v4l2: Move capture eos handling in _process()

Now that we might be copying out buffer (e.g. downstream don't support video
meta bug we need it) we need to move the EOS handling inside the process
parent 49065b16
......@@ -1441,14 +1441,24 @@ gst_v4l2_buffer_pool_process (GstV4l2BufferPool * pool, GstBuffer * buf)
GstBuffer *tmp;
if (buf->pool == bpool)
if (buf->pool == bpool) {
if (gst_buffer_get_size (buf) == 0)
goto eos;
/* nothing, data was inside the buffer when we did _acquire() */
goto done;
/* buffer not from our pool, grab a frame and copy it into the target */
if ((ret = gst_v4l2_buffer_pool_dqbuf (pool, &tmp)) != GST_FLOW_OK)
goto done;
/* An empty buffer on capture indicates the end of stream */
if (gst_buffer_get_size (tmp) == 0) {
gst_buffer_unref (tmp);
goto eos;
if (!gst_v4l2_object_copy (obj, buf, tmp))
goto copy_failed;
......@@ -1556,6 +1566,11 @@ start_failed:
GST_ERROR_OBJECT (obj->element, "failed to start streaming");
GST_DEBUG_OBJECT (obj->element, "end of stream reached");
return GST_FLOW_EOS;
......@@ -393,10 +393,6 @@ gst_v4l2_video_dec_loop (GstVideoDecoder * decoder)
if (ret != GST_FLOW_OK)
goto beach;
/* Check if buffer isn't the last one */
if (gst_buffer_get_size (buffer) == 0)
goto beach;
GST_LOG_OBJECT (decoder, "Process output buffer");
ret =
gst_v4l2_buffer_pool_process (GST_V4L2_BUFFER_POOL (self->
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment