The patch number 8229 was added via Thierry MERLE <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Hans de Goede  <[EMAIL PROTECTED]>
v4l2-library: libv4l-really-sync-with-0.3.4.patch


* The mmap64 support in 0.3.3, has caused a bug in libv4l1 when running on
  32 bit systems (who uses those now a days?), this bug caused v4l1
  compatibility to not work at all, this release fixes this
* Some apps (xawtv, kopete) use an ioctl wrapper internally for various
  reasons. This wrappers request argument is an int, but the real ioctl's
  request argument is an unsigned long. Passing the VIDIOC_xxx defines through
  to the wrapper, and then to the real ioctl, causes the request to get sign
  extended on 64 bit args. The kernel seems to ignore the upper 32 bits,
  causing the sign extension to not make a difference. libv4l now also
  ignores the upper 32 bits of the libv4lx_ioctl request argument on 64 bit
  archs
* Add a bugfix patch for kopete in the appl-patches dir, currently it assumes
  that it got the width and height it asked for when doing a S_FMT, which is a
  wrong assumption

Signed-off-by: Hans de Goede <[EMAIL PROTECTED]>
Signed-off-by: Thierry MERLE <[EMAIL PROTECTED]>


---

 v4l2-apps/lib/libv4l/ChangeLog                                   |   18 
++++++++++
 v4l2-apps/lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch |   12 ++++++
 v4l2-apps/lib/libv4l/libv4l1/libv4l1.c                           |    5 ++
 v4l2-apps/lib/libv4l/libv4l2/libv4l2.c                           |    5 ++
 4 files changed, 40 insertions(+)

diff -r fb3e549faf69 -r 207da71e2fe3 v4l2-apps/lib/libv4l/ChangeLog
--- a/v4l2-apps/lib/libv4l/ChangeLog    Sun Jul 06 14:07:34 2008 +0200
+++ b/v4l2-apps/lib/libv4l/ChangeLog    Tue Jul 08 07:01:45 2008 +0200
@@ -1,3 +1,21 @@ libv4l-0.3.3
+libv4l-0.3.4
+------------
+* The mmap64 support in 0.3.3, has caused a bug in libv4l1 when running on
+  32 bit systems (who uses those now a days?), this bug caused v4l1
+  compatibility to not work at all, this release fixes this
+* Some apps (xawtv, kopete) use an ioctl wrapper internally for various
+  reasons. This wrappers request argument is an int, but the real ioctl's
+  request argument is an unsigned long. Passing the VIDIOC_xxx defines through
+  to the wrapper, and then to the real ioctl, causes the request to get sign
+  extended on 64 bit args. The kernel seems to ignore the upper 32 bits,
+  causing the sign extension to not make a difference. libv4l now also
+  ignores the upper 32 bits of the libv4lx_ioctl request argument on 64 bit
+  archs
+* Add a bugfix patch for kopete in the appl-patches dir, currently it assumes
+  that it got the width and height it asked for when doing a S_FMT, which is a
+  wrong assumption
+
+
 libv4l-0.3.3
 ------------
 * Add open64 and mmap64 wrappers to the LD_PRELOAD wrapper libs, so that
diff -r fb3e549faf69 -r 207da71e2fe3 
v4l2-apps/lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/v4l2-apps/lib/libv4l/appl-patches/kdenetwork-4.0.85-kopete.patch  Tue Jul 
08 07:01:45 2008 +0200
@@ -0,0 +1,12 @@
+diff -up kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp~ 
kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp
+--- kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp~       
2008-07-07 22:40:56.000000000 +0200
++++ kdenetwork-4.0.85/kopete/libkopete/avdevice/videodevice.cpp        
2008-07-07 22:40:56.000000000 +0200
+@@ -679,6 +679,8 @@ kDebug() << "VIDIOC_S_FMT worked (" << e
+                                       if (fmt.fmt.pix.sizeimage < min)
+                                               fmt.fmt.pix.sizeimage = min;
+                                       m_buffer_size=fmt.fmt.pix.sizeimage ;
++                                      currentwidth = fmt.fmt.pix.width;
++                                      currentheight = fmt.fmt.pix.height;
+                               }
+                               break;
+ #endif
diff -r fb3e549faf69 -r 207da71e2fe3 v4l2-apps/lib/libv4l/libv4l1/libv4l1.c
--- a/v4l2-apps/lib/libv4l/libv4l1/libv4l1.c    Sun Jul 06 14:07:34 2008 +0200
+++ b/v4l2-apps/lib/libv4l/libv4l1/libv4l1.c    Tue Jul 08 07:01:45 2008 +0200
@@ -454,6 +454,11 @@ int v4l1_ioctl (int fd, unsigned long in
   if ((index = v4l1_get_index(fd)) == -1)
     return syscall(SYS_ioctl, fd, request, arg);
 
+  /* Appearantly the kernel and / or glibc ignore the 32 most significant bits
+     when long = 64 bits, and some applications pass an int holding the req to
+     ioctl, causing it to get sign extended, depending upon this behavior */
+  request = (unsigned int)request;
+
   /* do we need to take the stream lock for this ioctl? */
   switch (request) {
     case VIDIOCSPICT:
diff -r fb3e549faf69 -r 207da71e2fe3 v4l2-apps/lib/libv4l/libv4l2/libv4l2.c
--- a/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c    Sun Jul 06 14:07:34 2008 +0200
+++ b/v4l2-apps/lib/libv4l/libv4l2/libv4l2.c    Tue Jul 08 07:01:45 2008 +0200
@@ -541,6 +541,11 @@ int v4l2_ioctl (int fd, unsigned long in
   if ((index = v4l2_get_index(fd)) == -1)
     return syscall(SYS_ioctl, fd, request, arg);
 
+  /* Appearantly the kernel and / or glibc ignore the 32 most significant bits
+     when long = 64 bits, and some applications pass an int holding the req to
+     ioctl, causing it to get sign extended, depending upon this behavior */
+  request = (unsigned int)request;
+
   /* Is this a capture request and do we need to take the stream lock? */
   switch (request) {
     case VIDIOC_ENUM_FMT:


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/207da71e2fe306be007fe13ec0426d4f2b1703dc

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to