diff options
Diffstat (limited to 'v4l2-apps/libv4l')
-rw-r--r-- | v4l2-apps/libv4l/ChangeLog | 6 | ||||
-rw-r--r-- | v4l2-apps/libv4l/Makefile | 2 | ||||
-rw-r--r-- | v4l2-apps/libv4l/libv4l2/libv4l2.c | 11 |
3 files changed, 16 insertions, 3 deletions
diff --git a/v4l2-apps/libv4l/ChangeLog b/v4l2-apps/libv4l/ChangeLog index f53c32f0e..a2c598d08 100644 --- a/v4l2-apps/libv4l/ChangeLog +++ b/v4l2-apps/libv4l/ChangeLog @@ -1,3 +1,9 @@ +libv4l-0.5.6 +------------ +* Always do a s_fmt on uvc cams even if this changes nothing, as not doing + the s_fmt triggers a bug in the uvcvideo driver in kernel <= 2.6.28 + (with certain cams) + libv4l-0.5.5 ------------ * Avoid the use of try_fmt as much as possible on UVC cams, instead use the diff --git a/v4l2-apps/libv4l/Makefile b/v4l2-apps/libv4l/Makefile index 6de21ee77..55b3744ea 100644 --- a/v4l2-apps/libv4l/Makefile +++ b/v4l2-apps/libv4l/Makefile @@ -1,5 +1,5 @@ LIB_RELEASE=0 -V4L2_LIB_VERSION=$(LIB_RELEASE).5.5 +V4L2_LIB_VERSION=$(LIB_RELEASE).5.6 all clean install: $(MAKE) -C libv4lconvert V4L2_LIB_VERSION=$(V4L2_LIB_VERSION) $@ diff --git a/v4l2-apps/libv4l/libv4l2/libv4l2.c b/v4l2-apps/libv4l/libv4l2/libv4l2.c index 2685b9e19..720e91975 100644 --- a/v4l2-apps/libv4l/libv4l2/libv4l2.c +++ b/v4l2-apps/libv4l/libv4l2/libv4l2.c @@ -76,6 +76,7 @@ #define V4L2_BUFFERS_REQUESTED_BY_READ 0x0200 #define V4L2_STREAM_CONTROLLED_BY_READ 0x0400 #define V4L2_SUPPORTS_READ 0x0800 +#define V4L2_IS_UVC 0x1000 #define V4L2_MMAP_OFFSET_MAGIC 0xABCDEF00u @@ -492,6 +493,8 @@ int v4l2_fd_open(int fd, int v4l2_flags) devices[index].flags = v4l2_flags; if (cap.capabilities & V4L2_CAP_READWRITE) devices[index].flags |= V4L2_SUPPORTS_READ; + if (!strcmp((char *)cap.driver, "uvcvideo")) + devices[index].flags |= V4L2_IS_UVC; devices[index].open_count = 1; devices[index].src_fmt = fmt; devices[index].dest_fmt = fmt; @@ -768,7 +771,10 @@ int v4l2_ioctl (int fd, unsigned long int request, ...) struct v4l2_format src_fmt, *dest_fmt = arg; struct v4l2_pix_format req_pix_fmt; - if (v4l2_pix_fmt_identical(&devices[index].dest_fmt, dest_fmt)) { + /* Don't be lazy on uvc cams, as this triggers a bug in the uvcvideo + driver in kernel <= 2.6.28 (with certain cams) */ + if (!(devices[index].flags & V4L2_IS_UVC) && + v4l2_pix_fmt_identical(&devices[index].dest_fmt, dest_fmt)) { *dest_fmt = devices[index].dest_fmt; result = 0; break; @@ -813,7 +819,8 @@ int v4l2_ioctl (int fd, unsigned long int request, ...) /* Maybe after try format has adjusted width/height etc, to whats available nothing has changed (on the cam side) ? */ - if (v4l2_pix_fmt_identical(&devices[index].src_fmt, &src_fmt)) { + if (!(devices[index].flags & V4L2_IS_UVC) && + v4l2_pix_fmt_identical(&devices[index].src_fmt, &src_fmt)) { v4l2_set_src_and_dest_format(index, &devices[index].src_fmt, dest_fmt); result = 0; |