Re: [PATCH] V4L: videobuf-core.c VIDIOC_QBUF should return video buffer flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday 10 August 2009 19:37:40 Tuukka.O Toivonen wrote:
> When user space queues a buffer using VIDIOC_QBUF, the kernel
> should set flags to V4L2_BUF_FLAG_QUEUED in struct v4l2_buffer.
> videobuf_qbuf() was missing a call to videobuf_status() which does
> that. This patch adds the proper function call.
>
> Signed-off-by: Tuukka Toivonen <tuukka.o.toivonen@xxxxxxxxx>

I was a bit surprised, as I didn't think VIDIOC_QBUF was supposed to update 
the buffer structure, but according to the v4l2 spec it is.

However, I don't think calling videobuf_status() is the right thing to do. It 
will update fields that don't make sense at this point, such as 
v4l2_buffer::timestamp.

Thanks Tuukka for finding this, I'll update the UVC video driver 
accordingly :-)

> ---
>  drivers/media/video/videobuf-core.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/media/video/videobuf-core.c
> b/drivers/media/video/videobuf-core.c index b7b0584..d212710 100644
> --- a/drivers/media/video/videobuf-core.c
> +++ b/drivers/media/video/videobuf-core.c
> @@ -565,6 +565,8 @@ int videobuf_qbuf(struct videobuf_queue *q,
>  		spin_unlock_irqrestore(q->irqlock, flags);
>  	}
>  	dprintk(1, "qbuf: succeded\n");
> +	memset(b, 0, sizeof(*b));
> +	videobuf_status(q, b, buf, q->type);
>  	retval = 0;
>  	wake_up_interruptible_sync(&q->wait);

-- 
Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux