From bad01ca943742b5a2938b3718abc8590a0f3929d Mon Sep 17 00:00:00 2001 From: "hans@localhost.localdomain" Date: Sun, 3 Aug 2008 14:35:38 +0200 Subject: libv4l: mpa buffers before queuing From: Hans de Goede With some drivers the buffers must be mapped before queuing, so when converting map the (real) buffers before calling the qbuf ioctl Signed-off-by: Hans de Goede --- v4l2-apps/lib/libv4l/ChangeLog | 2 ++ v4l2-apps/lib/libv4l/libv4l2/libv4l2.c | 5 +++++ 2 files changed, 7 insertions(+) (limited to 'v4l2-apps/lib') diff --git a/v4l2-apps/lib/libv4l/ChangeLog b/v4l2-apps/lib/libv4l/ChangeLog index 45c9cca63..cdd29fac8 100644 --- a/v4l2-apps/lib/libv4l/ChangeLog +++ b/v4l2-apps/lib/libv4l/ChangeLog @@ -3,6 +3,8 @@ libv4l-0.4.0 * Be more relaxed in our checks for mixing read and mmap access, we were being more strict in this then certain kernel drivers (bttv) making xawtv unhappy +* With some drivers the buffers must be mapped before queuing, so when + converting map the (real) buffers before calling the qbuf ioctl * Add support for conversion to RGB24 (before we only supported BGR24) based on a patch by Jean-Francois Moine * Various Makefile and pkgconfig file improvements by Gregor Jasny (Debian) diff --git a/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c b/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c index 2a0dd4837..d6a8a6d2a 100644 --- a/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c +++ b/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c @@ -798,6 +798,11 @@ int v4l2_ioctl (int fd, unsigned long int request, ...) if ((result = v4l2_deactivate_read_stream(index))) break; + /* With some drivers the buffers must be mapped before queuing */ + if (converting) + if ((result = v4l2_map_buffers(index))) + break; + result = syscall(SYS_ioctl, devices[index].fd, VIDIOC_QBUF, arg); break; -- cgit v1.2.3