From faf2479d2dfa16ad1c7a316f0443df4fa6f9c3c8 Mon Sep 17 00:00:00 2001 From: "hans@rhel5-devel.localdomain" Date: Wed, 5 Aug 2009 12:28:07 +0200 Subject: libv4l: update my email address From: Hans de Goede libv4l: update my email address Priority: normal Signed-off-by: Hans de Goede --- v4l2-apps/libv4l/libv4l2/libv4l2-priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'v4l2-apps/libv4l/libv4l2/libv4l2-priv.h') diff --git a/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h b/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h index 0bfd53e2a..d976093d5 100644 --- a/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h +++ b/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h @@ -1,5 +1,5 @@ /* -# (C) 2008 Hans de Goede +# (C) 2008 Hans de Goede # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by -- cgit v1.2.3 From 1717b46f2e34d1655a665db31979f4bfaf969c06 Mon Sep 17 00:00:00 2001 From: "hans@rhel5-devel.localdomain" Date: Fri, 14 Aug 2009 09:50:33 +0200 Subject: libv4l: Fix reqbuf Device or Resource busy error when using read From: Hans de Goede Some applications such as v4l2-apps/test/capture-example.c, in read mode use select() together with read() and do a select() before the first read(). This causes issues together with certain drivers (gspca for example), do not allow switching from read mode to mmap mode and they assume read() mode if a select or poll() is done before any buffers are requested. When not using libv4l2, this is not an issue but libv4l2 uses mmap mode under the hood when converting as that safes a memcpy for each frame read. This fails with such drivers when the application has done a select() before the first read() as the driver now is in "read mode" and disallows switching to mmap mode. This patch fixes this by falling back to using read() for v4l2_read() when using mmap mode fails. Priority: normal Signed-off-by: Hans de Goede --- v4l2-apps/libv4l/libv4l2/libv4l2-priv.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'v4l2-apps/libv4l/libv4l2/libv4l2-priv.h') diff --git a/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h b/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h index d976093d5..8256cfdb6 100644 --- a/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h +++ b/v4l2-apps/libv4l/libv4l2/libv4l2-priv.h @@ -80,6 +80,9 @@ struct v4l2_dev_info { int frame_queued; /* 1 status bit per frame */ /* mapping tracking of our fake (converting mmap) frame buffers */ unsigned char frame_map_count[V4L2_MAX_NO_FRAMES]; + /* buffer when doing conversion and using read() for read() */ + int readbuf_size; + unsigned char *readbuf; }; /* From log.c */ -- cgit v1.2.3