From 9370e86c842c65ba5d1508825a32cf192256bcb2 Mon Sep 17 00:00:00 2001 From: "hans@localhost.localdomain" Date: Tue, 29 Jul 2008 23:56:08 +0200 Subject: libv4l: query buffer: indicate the mapping state of our (fake) buffer in the flags From: Hans de Goede libv4l: query buffer: indicate the mapping state of our (fake) buffer in the flags Signed-off-by: Hans de Goede --- v4l2-apps/lib/libv4l/libv4l2/libv4l2.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'v4l2-apps/lib/libv4l/libv4l2/libv4l2.c') diff --git a/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c b/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c index 9754ea516..f71d176b5 100644 --- a/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c +++ b/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c @@ -773,6 +773,10 @@ int v4l2_ioctl (int fd, unsigned long int request, ...) buf->m.offset = V4L2_MMAP_OFFSET_MAGIC | buf->index; buf->length = V4L2_FRAME_BUF_SIZE; + if (devices[index].frame_map_count[buf->index]) + buf->flags |= V4L2_BUF_FLAG_MAPPED; + else + buf->flags &= ~V4L2_BUF_FLAG_MAPPED; } break; @@ -832,7 +836,12 @@ int v4l2_ioctl (int fd, unsigned long int request, ...) } buf->bytesused = result; + buf->m.offset = V4L2_MMAP_OFFSET_MAGIC | buf->index; buf->length = V4L2_FRAME_BUF_SIZE; + if (devices[index].frame_map_count[buf->index]) + buf->flags |= V4L2_BUF_FLAG_MAPPED; + else + buf->flags &= ~V4L2_BUF_FLAG_MAPPED; result = 0; } -- cgit v1.2.3