From: Pawel Osciak Date: Wed, 21 Apr 2010 09:44:27 +0000 (-0300) Subject: V4L/DVB: v4l: videobuf: qbuf now uses relevant v4l2_buffer fields for OUTPUT types X-Git-Tag: v2.6.35-rc1~480^2~111 X-Git-Url: http://bbs.cooldavid.org/git/?a=commitdiff_plain;h=96f2ec67b8d4761471409e1df0adfe4da5262f84;p=net-next-2.6.git V4L/DVB: v4l: videobuf: qbuf now uses relevant v4l2_buffer fields for OUTPUT types According to the V4L2 specification, applications set bytesused, field and timestamp fields of struct v4l2_buffer when the buffer is intended for output and memory type is MMAP. This adds proper copying of those values to videobuf_buffer so drivers can use them. Signed-off-by: Pawel Osciak Signed-off-by: Kyungmin Park Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index dc2f6a8c022..9f99e3bf539 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c @@ -544,6 +544,13 @@ int videobuf_qbuf(struct videobuf_queue *q, struct v4l2_buffer *b) "but buffer addr is zero!\n"); goto done; } + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT + || q->type == V4L2_BUF_TYPE_VBI_OUTPUT + || q->type == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) { + buf->size = b->bytesused; + buf->field = b->field; + buf->ts = b->timestamp; + } break; case V4L2_MEMORY_USERPTR: if (b->length < buf->bsize) {