PATCH: libv4l-sync-with-0.3.3-release.patch
Hi,
This patch syncs mercurial with the 0.3.3 tarbal I've just released. note, please "hg add" all the files under appl-patches, you forgot this the last time, so these files are not in mercurial yet.
Let me know if you want this split up in 3 or 4 incremental patches.
Regards,
Hans
Sync with the 0.3.3 tarbal release, changes:
* Add open64 and mmap64 wrappers to the LD_PRELOAD wrapper libs, so that they also work for applications compiled with FILE_OFFSET_BITS=64, this fixes using them with v4l-info
* While looking at xawtv in general, found a few bugs in xawtv itself, added a patch to fix those to the appl-patches dir
* Talking about the appl-patches dir, restore that as it accidentally got dropped from 0.3.2
* Be more verbose in various places when it comes to logging (esp errors)
* Change v4lconvert_enum_fmt code a bit, so that it is easier to add more supported destination formats to libv4lconvert
* Don't return -EINVAL from try_fmt when we cannot convert because the cam doesn't have any formats we know. Instead just return as format whatever the cam returns from try_fmt, this new behavior is compliant with the v4l2 api as documented
v4l2-apps/lib/libv4l/ChangeLog +17 -0
@@ -1,3 +1,20 @@ +libv4l-0.3.3 +------------ +* Add open64 and mmap64 wrappers to the LD_PRELOAD wrapper libs, so that + they also work for applications compiled with FILE_OFFSET_BITS=64, this + fixes using them with v4l-info +* While looking at xawtv in general, found a few bugs in xawtv itself, added + a patch to fix those to the appl-patches dir +* Talking about the appl-patches dir, restore that as it accidentally got + dropped from 0.3.2 +* Be more verbose in various places when it comes to logging (esp errors) +* Change v4lconvert_enum_fmt code a bit, so that it is easier to add more + supported destination formats to libv4lconvert +* Don't return -EINVAL from try_fmt when we cannot convert because the cam + doesn't have any formats we know. Instead just return as format whatever the + cam returns from try_fmt, this new behavior is compliant with the v4l2 + api as documented + libv4l-0.3.2 ------------ * Add support for converting from sn9c10x compressed data
v4l2-apps/lib/libv4l/appl-patches/camorama-0.19-fixes.patch new file +90 -0
90 lines not on this page · raw message
v4l2-apps/lib/libv4l/appl-patches/vlc-0.8.6-libv4l1.patch new file +319 -0
319 lines not on this page · raw message
v4l2-apps/lib/libv4l/appl-patches/xawtv-3.95-fixes.patch new file +29 -0
@@ -0,0 +1,29 @@ +--- xawtv-3.95/libng/plugins/drv0-v4l2.c 2005-02-11 18:56:24.000000000 +0100 ++++ xawtv-3.95.new/libng/plugins/drv0-v4l2.c 2008-07-05 21:12:37.000000000 +0200 +@@ -161,7 +161,7 @@ + #define PREFIX "ioctl: " + + static int +-xioctl(int fd, int cmd, void *arg, int mayfail) ++xioctl(int fd, unsigned long int cmd, void *arg, int mayfail) + { + int rc; + +@@ -768,6 +768,7 @@ + /* get it */ + memset(&buf,0,sizeof(buf)); + buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ++ buf.memory = V4L2_MEMORY_MMAP; + if (-1 == xioctl(h->fd,VIDIOC_DQBUF,&buf, 0)) + return -1; + h->waiton++; +@@ -813,8 +814,7 @@ + if (-1 == xioctl(h->fd, VIDIOC_QUERYBUF, &h->buf_v4l2[i], 0)) + return -1; + h->buf_me[i].fmt = h->fmt_me; +- h->buf_me[i].size = h->buf_me[i].fmt.bytesperline * +- h->buf_me[i].fmt.height; ++ h->buf_me[i].size = h->buf_v4l2[i].length; + h->buf_me[i].data = mmap(NULL, h->buf_v4l2[i].length, + PROT_READ | PROT_WRITE, MAP_SHARED, + h->fd, h->buf_v4l2[i].m.offset);
v4l2-apps/lib/libv4l/include/libv4l1.h +1 -1
@@ -57,7 +57,7 @@int v4l1_ioctl (int fd,unsigned long int request, ...);ssize_t v4l1_read (int fd,void * buffer,size_t n);void *v4l1_mmap (void *start,size_t length,int prot,int flags,int fd, -off_t offset); +__off64_t offset);int v4l1_munmap (void *_start,size_t length);#ifdef __cplusplus
v4l2-apps/lib/libv4l/include/libv4l2.h +1 -1
@@ -58,7 +58,7 @@int v4l2_ioctl (int fd,unsigned long int request, ...);ssize_t v4l2_read (int fd,void * buffer,size_t n);void *v4l2_mmap (void *start,size_t length,int prot,int flags,int fd, -off_t offset); +__off64_t offset);int v4l2_munmap (void *_start,size_t length);
v4l2-apps/lib/libv4l/libv4l1/libv4l1.c +3 -5
@@ -40,9 +40,6 @@in turn will call v4l1_open, so therefor v4l1_open (for example) may not use the regular open()! */ - -#define _LARGEFILE64_SOURCE 1 -#include <errno.h> #include <stdarg.h> #include <stdio.h>
@@ -642,7 +639,8 @@ }if (devices[index].v4l1_frame_pointer ==MAP_FAILED ) { - devices[index].v4l1_frame_pointer =mmap64 (NULL , mbuf->size, + devices[index].v4l1_frame_pointer = (void *)syscall (SYS_mmap,NULL , + (size_t )mbuf->size,PROT_READ |PROT_WRITE ,MAP_ANONYMOUS |MAP_PRIVATE ,-1 ,0 );if (devices[index].v4l1_frame_pointer ==MAP_FAILED ) {
@@ -749,7 +747,7 @@void *v4l1_mmap (void *start,size_t length,int prot,int flags,int fd, -__off_t offset) +__off64_t offset) {int index;void *result;
v4l2-apps/lib/libv4l/libv4l1/v4l1compat.c +29 -0
@@ -18,6 +18,8 @@# along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#define _LARGEFILE64_SOURCE 1#include <stdlib.h> #include <stdarg.h>
@@ -46,6 +48,27 @@va_end (ap); }else fd =v4l1_open (file, oflag); + +return fd; +} + +int open64 (const char *file,int oflag, ...) +{ +int fd; + +if (oflag &O_CREAT ) + { +va_list ap; +mode_t mode; + +va_start (ap, oflag); + mode =va_arg (ap, mode_t); + + fd =v4l1_open (file, oflag |O_LARGEFILE , mode); + +va_end (ap); + }else + fd =v4l1_open (file, oflag |O_LARGEFILE );return fd; }
@@ -82,6 +105,12 @@return v4l1_mmap (start, length, prot, flags, fd, offset); } +void mmap64 (void *start,size_t length,int prot,int flags,int fd, +__off64_t offset) +{ +return v4l1_mmap (start, length, prot, flags, fd, offset); +} +int munmap (void *start,size_t length) {return v4l1_munmap (start, length);
v4l2-apps/lib/libv4l/libv4l2/libv4l2-priv.h +9 -0
@@ -22,6 +22,15 @@#include <stdio.h> #include <pthread.h> #include <libv4lconvert.h> /* includes videodev2.h for us */ + +/* On 32 bits archs we always use mmap2, on 64 bits archs there is no mmap2 */ +#ifdef __NR_mmap2 +#define SYS_mmap2 __NR_mmap2 +#define MMAP2_PAGE_SHIFT 12 +#else +#define SYS_mmap2 SYS_mmap +#define MMAP2_PAGE_SHIFT 0 +#endif #define V4L2_MAX_DEVICES 16/* Warning when making this larger the frame_queued and frame_mapped members of
v4l2-apps/lib/libv4l/libv4l2/libv4l2.c +41 -17
119 lines not on this page · raw message
v4l2-apps/lib/libv4l/libv4l2/v4l2convert.c +31 -0
@@ -19,6 +19,8 @@# along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#define _LARGEFILE64_SOURCE 1#include <stdarg.h> #include <stdlib.h>
@@ -82,6 +84,29 @@return fd; } +int open64 (const char *file,int oflag, ...) +{ +int fd; + +/* original open code */ +if (oflag &O_CREAT ) + { +va_list ap; +mode_t mode; + +va_start (ap, oflag); + mode =va_arg (ap, mode_t); + + fd =open (file, oflag |O_LARGEFILE , mode); + +va_end (ap); + }else + fd =open (file, oflag |O_LARGEFILE ); +/* end of original open code */ + +return fd; +} +int close (int fd) {return v4l2_close (fd);
@@ -115,6 +140,12 @@return v4l2_mmap (start, length, prot, flags, fd, offset); } +void mmap64 (void *start,size_t length,int prot,int flags,int fd, +__off64_t offset) +{ +return v4l2_mmap (start, length, prot, flags, fd, offset); +} +int munmap (void *start,size_t length) {return v4l2_munmap (start, length);
v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c +31 -28
93 lines not on this page · raw message
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 8 lines · Hans de Goede
Hi,
This patch syncs mercurial with the 0.3.3 tarbal I've just released. note, please "hg add" all the files under appl-patches, you forgot this the last time, so these files are not in mercurial yet.
Let me know if you want this split up in 3 or 4 incremental patches.
I would prefer next time since this would help to avoid forgotten things like the appl-patches/ directory. I checked with your own 0.3.2 archive but found no difference so I stated my imports OK.
Do you send these patches to the application maintainers?
They may correct some annoying bugs that many people can expect to see corrected...
Quoted 4 lines
Regards,
Hans
I took a look at the usbvision driver to extract the decompression stuff into userspace, but it is not so easy.
I would like to make changes to the w9968cf driver too since I own a webcam based on this driver, in order to take benefit from your userspace decompression lib. I will start on documenting your library on the wiki, this will help me to go into the subject.
Cheers,
Thierry
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 7 lines · Thierry Merle
Quoted 6 lines · Hans de Goede
Hi,
This patch syncs mercurial with the 0.3.3 tarbal I've just released. note, please "hg add" all the files under appl-patches, you forgot this the last time, so these files are not in mercurial yet.
Quoted 6 lines
Quoted 2 lines
Let me know if you want this split up in 3 or 4 incremental patches.
I would prefer next time since this would help to avoid forgotten things like the appl-patches/ directory. I checked with your own 0.3.2 archive but found no difference so I stated my imports OK.
Do you send these patches to the application maintainers?
Once libv4l has proven itself the vlc patch will be sent to vlc (its libvlc specific), as for the other 2 patches, there upstreams are very much dead I'm afraid.
Regards,
Hans
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list