[arch-commits] Commit in xawtv/repos (5 files)
Thomas Baechler
thomas at archlinux.org
Sun Oct 26 14:56:52 UTC 2008
Date: Sunday, October 26, 2008 @ 10:56:52
Author: thomas
Revision: 17181
Merged revisions 17179 via svnmerge from
svn+ssh://archlinux.org/home/svn-packages/xawtv/trunk
........
r17179 | thomas | 2008-10-26 15:55:49 +0100 (So, 26 Okt 2008) | 1 line
upgpkg: xawtv 3.95-4
........
Added:
xawtv/repos/extra-i686/xawtv-3.95-fixes.patch
(from rev 17179, xawtv/trunk/xawtv-3.95-fixes.patch)
xawtv/repos/extra-i686/xawtv-3.95-libv4l2.patch
(from rev 17179, xawtv/trunk/xawtv-3.95-libv4l2.patch)
xawtv/repos/extra-i686/xawtv-3.95-no-dga.patch
(from rev 17179, xawtv/trunk/xawtv-3.95-no-dga.patch)
Modified:
xawtv/repos/extra-i686/ (properties)
xawtv/repos/extra-i686/PKGBUILD
--------------------------+
PKGBUILD | 35 ++++++--
xawtv-3.95-fixes.patch | 72 ++++++++++++++++++
xawtv-3.95-libv4l2.patch | 176 +++++++++++++++++++++++++++++++++++++++++++++
xawtv-3.95-no-dga.patch | 120 ++++++++++++++++++++++++++++++
4 files changed, 392 insertions(+), 11 deletions(-)
Property changes on: xawtv/repos/extra-i686
___________________________________________________________________
Name: svnmerge-integrated
- /xawtv/trunk:1-9410
+ /xawtv/trunk:1-17180
Modified: extra-i686/PKGBUILD
===================================================================
--- extra-i686/PKGBUILD 2008-10-26 14:56:08 UTC (rev 17180)
+++ extra-i686/PKGBUILD 2008-10-26 14:56:52 UTC (rev 17181)
@@ -4,25 +4,38 @@
pkgname=xawtv
pkgver=3.95
-pkgrel=3
+pkgrel=4
pkgdesc="Is a simple Xaw-based TV program which uses the bttv driver or video4linux."
arch=('i686' 'x86_64')
url="http://linux.bytesex.org/xawtv/"
license=('GPL')
-depends=('libjpeg' 'alsa-lib' 'lesstif' 'libdv' 'zvbi' 'aalib' \
- 'libxxf86dga' 'libfs' 'libxrandr' 'libxinerama' 'libxv' 'libxaw' \
- 'libxxf86vm' 'libgl' 'gpm>=1.20.4')
+depends=('libjpeg' 'alsa-lib' 'lesstif' 'libdv' 'zvbi' 'aalib'
+ 'libxxf86dga' 'libfs' 'libxrandr' 'libxinerama' 'libxv' 'libxaw'
+ 'libxxf86vm' 'libgl' 'gpm>=1.20.4' 'lirc-utils' 'libxft'
+ 'libv4l')
makedepends=('mesa')
options=('!makeflags')
-source=(http://dl.bytesex.org/releases/$pkgname/$pkgname-$pkgver.tar.gz \
- xawtv-395.diff xawtv-3.95-pagemask-fix.patch)
-md5sums=('ad25e03f7e128b318e392cb09f52207d' '87a87b6c62b39348053704f052141843'\
- '97493dfaac8c80084d8b66891becd76c')
-
+source=(http://dl.bytesex.org/releases/$pkgname/$pkgname-$pkgver.tar.gz
+ xawtv-395.diff
+ xawtv-3.95-pagemask-fix.patch
+ xawtv-3.95-fixes.patch
+ xawtv-3.95-libv4l2.patch
+ xawtv-3.95-no-dga.patch)
+md5sums=('ad25e03f7e128b318e392cb09f52207d'
+ '87a87b6c62b39348053704f052141843'
+ '97493dfaac8c80084d8b66891becd76c'
+ 'dc83378a5c76c029f4e49434214fc824'
+ '56932100c5060bf9dfc45b8af927e697'
+ 'c456147f15c8f836c678c6499f068085')
+
build() {
cd $startdir/src/$pkgname-$pkgver
- patch -Np1 < $startdir/src/xawtv-395.diff
- patch -Np1 < $startdir/src/xawtv-3.95-pagemask-fix.patch
+ patch -Np1 -i $startdir/src/xawtv-395.diff || return 1
+ patch -Np1 -i $startdir/src/xawtv-3.95-pagemask-fix.patch || return 1
+ # Add patches from https://bugzilla.redhat.com/show_bug.cgi?id=457796
+ patch -Np1 -i $startdir/src/xawtv-3.95-fixes.patch || return 1
+ patch -Np1 -i $startdir/src/xawtv-3.95-libv4l2.patch || return 1
+ patch -Np1 -i $startdir/src/xawtv-3.95-no-dga.patch || return 1
./configure --prefix=/usr --mandir=/usr/share/man
make || return 1
make DESTDIR=$startdir/pkg resdir=$startdir/pkg/usr/lib/X11 install
Copied: xawtv/repos/extra-i686/xawtv-3.95-fixes.patch (from rev 17179, xawtv/trunk/xawtv-3.95-fixes.patch)
===================================================================
--- extra-i686/xawtv-3.95-fixes.patch (rev 0)
+++ extra-i686/xawtv-3.95-fixes.patch 2008-10-26 14:56:52 UTC (rev 17181)
@@ -0,0 +1,72 @@
+diff -up xawtv-3.95.new/libng/plugins/drv0-v4l2.c.fixes xawtv-3.95.new/libng/plugins/drv0-v4l2.c
+--- xawtv-3.95.new/libng/plugins/drv0-v4l2.c.fixes 2005-02-11 18:56:24.000000000 +0100
++++ xawtv-3.95.new/libng/plugins/drv0-v4l2.c 2008-08-03 20:46:32.000000000 +0200
+@@ -91,6 +91,7 @@ struct v4l2_handle {
+ struct ng_video_fmt fmt_me;
+ struct v4l2_requestbuffers reqbufs;
+ struct v4l2_buffer buf_v4l2[WANTED_BUFFERS];
++ int buf_v4l2_size[WANTED_BUFFERS];
+ struct ng_video_buf buf_me[WANTED_BUFFERS];
+ unsigned int queue,waiton;
+
+@@ -166,7 +167,7 @@ xioctl(int fd, int cmd, void *arg, int m
+ int rc;
+
+ rc = ioctl(fd,cmd,arg);
+- if (0 == rc && ng_debug < 2)
++ if (rc >= 0 && ng_debug < 2)
+ return rc;
+ if (mayfail && errno == mayfail && ng_debug < 2)
+ return rc;
+@@ -768,6 +769,7 @@ v4l2_waiton(struct v4l2_handle *h)
+ /* 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++;
+@@ -812,6 +814,7 @@ v4l2_start_streaming(struct v4l2_handle
+ h->buf_v4l2[i].memory = V4L2_MEMORY_MMAP;
+ if (-1 == xioctl(h->fd, VIDIOC_QUERYBUF, &h->buf_v4l2[i], 0))
+ return -1;
++ h->buf_v4l2_size[i] = h->buf_v4l2[i].length;
+ 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;
+@@ -865,12 +868,16 @@ v4l2_stop_streaming(struct v4l2_handle *
+ ng_waiton_video_buf(&h->buf_me[i]);
+ if (ng_debug)
+ print_bufinfo(&h->buf_v4l2[i]);
+- if (-1 == munmap(h->buf_me[i].data,h->buf_me[i].size))
++ if (-1 == munmap(h->buf_me[i].data, h->buf_v4l2_size[i]))
+ perror("munmap");
+ }
+ h->queue = 0;
+ h->waiton = 0;
+
++ /* unrequest buffers (only needed for some drivers) */
++ h->reqbufs.count = 0;
++ xioctl(h->fd, VIDIOC_REQBUFS, &h->reqbufs, EINVAL);
++
+ /* turn on preview (if needed) */
+ if (h->ov_on != h->ov_enabled) {
+ h->ov_on = h->ov_enabled;
+@@ -907,6 +914,17 @@ v4l2_setformat(void *handle, struct ng_v
+ fmt->width = h->fmt_v4l2.fmt.pix.width;
+ fmt->height = h->fmt_v4l2.fmt.pix.height;
+ fmt->bytesperline = h->fmt_v4l2.fmt.pix.bytesperline;
++ /* struct v4l2_format.fmt.pix.bytesperline is bytesperline for the
++ main plane for planar formats, where as we want it to be the total
++ bytesperline for all planes */
++ switch (fmt->fmtid) {
++ case VIDEO_YUV422P:
++ fmt->bytesperline *= 2;
++ break;
++ case VIDEO_YUV420P:
++ fmt->bytesperline = fmt->bytesperline * 3 / 2;
++ break;
++ }
+ if (0 == fmt->bytesperline)
+ fmt->bytesperline = fmt->width * ng_vfmt_to_depth[fmt->fmtid] / 8;
+ h->fmt_me = *fmt;
Copied: xawtv/repos/extra-i686/xawtv-3.95-libv4l2.patch (from rev 17179, xawtv/trunk/xawtv-3.95-libv4l2.patch)
===================================================================
--- extra-i686/xawtv-3.95-libv4l2.patch (rev 0)
+++ extra-i686/xawtv-3.95-libv4l2.patch 2008-10-26 14:56:52 UTC (rev 17181)
@@ -0,0 +1,176 @@
+--- xawtv-3.95/libng/plugins/Subdir.mk~ 2008-07-30 09:51:01.000000000 +0200
++++ xawtv-3.95/libng/plugins/Subdir.mk 2008-07-30 09:51:01.000000000 +0200
+@@ -41,6 +41,7 @@ libng/plugins/read-qt.so : LDLIBS := $(
+ libng/plugins/write-qt.so : LDLIBS := $(QT_LIBS)
+ libng/plugins/read-dv.so : LDLIBS := $(DV_LIBS)
+ libng/plugins/write-dv.so : LDLIBS := $(DV_LIBS)
++libng/plugins/drv0-v4l2.so: LDLIBS := -lv4l2
+
+ # global targets
+ all:: $(TARGETS-plugins)
+diff -up xawtv-3.95/libng/plugins/drv0-v4l2.c.orig xawtv-3.95/libng/plugins/drv0-v4l2.c
+--- xawtv-3.95/libng/plugins/drv0-v4l2.c.orig 2008-08-03 21:26:13.000000000 +0200
++++ xawtv-3.95/libng/plugins/drv0-v4l2.c 2008-08-03 21:27:50.000000000 +0200
+@@ -29,11 +29,26 @@
+ #include "struct-dump.h"
+ #include "struct-v4l2.h"
+
++/* FIXME replace with autoconf detection */
++#define HAVE_LIBV4L
++
++#ifdef HAVE_LIBV4L
++#include <libv4l2.h>
++#else
++#define v4l2_fd_open(fd, flags) (fd)
++#define v4l2_close close
++#define v4l2_dup dup
++#define v4l2_ioctl ioctl
++#define v4l2_read read
++#define v4l2_mmap mmap
++#define v4l2_munmap munmap
++#endif
++
+ /* ---------------------------------------------------------------------- */
+
+ /* open+close */
+-static void* v4l2_open(char *device);
+-static int v4l2_close(void *handle);
++static void* v4l2_open_handle(char *device);
++static int v4l2_close_handle(void *handle);
+
+ /* attributes */
+ static char* v4l2_devname(void *handle);
+@@ -111,8 +126,8 @@ struct v4l2_handle {
+
+ struct ng_vid_driver v4l2_driver = {
+ name: "v4l2",
+- open: v4l2_open,
+- close: v4l2_close,
++ open: v4l2_open_handle,
++ close: v4l2_close_handle,
+
+ get_devname: v4l2_devname,
+ capabilities: v4l2_flags,
+@@ -166,7 +181,7 @@ xioctl(int fd, int cmd, void *arg, int m
+ {
+ int rc;
+
+- rc = ioctl(fd,cmd,arg);
++ rc = v4l2_ioctl(fd,cmd,arg);
+ if (rc >= 0 && ng_debug < 2)
+ return rc;
+ if (mayfail && errno == mayfail && ng_debug < 2)
+@@ -220,7 +235,7 @@ get_device_capabilities(struct v4l2_hand
+ }
+
+ h->streamparm.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+- ioctl(h->fd,VIDIOC_G_PARM,&h->streamparm);
++ v4l2_ioctl(h->fd,VIDIOC_G_PARM,&h->streamparm);
+
+ /* controls */
+ for (i = 0; i < MAX_CTRL; i++) {
+@@ -444,10 +459,10 @@ static void v4l2_write_attr(struct ng_at
+ /* ---------------------------------------------------------------------- */
+
+ static void*
+-v4l2_open(char *device)
++v4l2_open_handle(char *device)
+ {
+ struct v4l2_handle *h;
+- int i;
++ int i, libv4l2_fd;
+
+ h = malloc(sizeof(*h));
+ if (NULL == h)
+@@ -459,6 +474,16 @@ v4l2_open(char *device)
+ goto err;
+ }
+
++ /* Note the v4l2_xxx functions are designed so that if they get passed an
++ unknown fd, the will behave exactly as their regular xxx counterparts, so
++ if v4l2_fd_open fails, we continue as normal (missing the libv4l2 custom
++ cam format to normal formats conversion). Chances are big we will still
++ fail then though, as normally v4l2_fd_open only fails if the device is not
++ a v4l2 device. */
++ libv4l2_fd = v4l2_fd_open(h->fd, 0);
++ if (libv4l2_fd != -1)
++ h->fd = libv4l2_fd;
++
+ if (-1 == xioctl(h->fd,VIDIOC_QUERYCAP,&h->cap,EINVAL))
+ goto err;
+ if (ng_debug)
+@@ -495,21 +520,21 @@ v4l2_open(char *device)
+
+ err:
+ if (h->fd != -1)
+- close(h->fd);
++ v4l2_close(h->fd);
+ if (h)
+ free(h);
+ return NULL;
+ }
+
+ static int
+-v4l2_close(void *handle)
++v4l2_close_handle(void *handle)
+ {
+ struct v4l2_handle *h = handle;
+
+ if (ng_debug)
+ fprintf(stderr, "v4l2: close\n");
+
+- close(h->fd);
++ v4l2_close(h->fd);
+ free(h);
+ return 0;
+ }
+@@ -818,7 +843,7 @@ v4l2_start_streaming(struct v4l2_handle
+ 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].data = mmap(NULL, h->buf_v4l2[i].length,
++ h->buf_me[i].data = v4l2_mmap(NULL, h->buf_v4l2[i].length,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ h->fd, h->buf_v4l2[i].m.offset);
+ if (MAP_FAILED == h->buf_me[i].data) {
+@@ -859,7 +884,7 @@ v4l2_stop_streaming(struct v4l2_handle *
+ unsigned int i;
+
+ /* stop capture */
+- if (-1 == ioctl(h->fd,VIDIOC_STREAMOFF,&h->fmt_v4l2.type))
++ if (-1 == v4l2_ioctl(h->fd,VIDIOC_STREAMOFF,&h->fmt_v4l2.type))
+ perror("ioctl VIDIOC_STREAMOFF");
+
+ /* free buffers */
+@@ -868,7 +893,7 @@ v4l2_stop_streaming(struct v4l2_handle *
+ ng_waiton_video_buf(&h->buf_me[i]);
+ if (ng_debug)
+ print_bufinfo(&h->buf_v4l2[i]);
+- if (-1 == munmap(h->buf_me[i].data, h->buf_v4l2_size[i]))
++ if (-1 == v4l2_munmap(h->buf_me[i].data, h->buf_v4l2_size[i]))
+ perror("munmap");
+ }
+ h->queue = 0;
+@@ -989,7 +1014,7 @@ v4l2_nextframe(void *handle)
+ } else {
+ size = h->fmt_me.bytesperline * h->fmt_me.height;
+ buf = ng_malloc_video_buf(&h->fmt_me,size);
+- rc = read(h->fd,buf->data,size);
++ rc = v4l2_read(h->fd,buf->data,size);
+ if (rc != size) {
+ if (-1 == rc) {
+ perror("v4l2: read");
+@@ -1023,11 +1048,11 @@ v4l2_getimage(void *handle)
+ size = h->fmt_me.bytesperline * h->fmt_me.height;
+ buf = ng_malloc_video_buf(&h->fmt_me,size);
+ if (h->cap.capabilities & V4L2_CAP_READWRITE) {
+- rc = read(h->fd,buf->data,size);
++ rc = v4l2_read(h->fd,buf->data,size);
+ if (-1 == rc && EBUSY == errno && h->ov_on) {
+ h->ov_on = 0;
+ xioctl(h->fd, VIDIOC_OVERLAY, &h->ov_on, 0);
+- rc = read(h->fd,buf->data,size);
++ rc = v4l2_read(h->fd,buf->data,size);
+ h->ov_on = 1;
+ xioctl(h->fd, VIDIOC_OVERLAY, &h->ov_on, 0);
+ }
Copied: xawtv/repos/extra-i686/xawtv-3.95-no-dga.patch (from rev 17179, xawtv/trunk/xawtv-3.95-no-dga.patch)
===================================================================
--- extra-i686/xawtv-3.95-no-dga.patch (rev 0)
+++ extra-i686/xawtv-3.95-no-dga.patch 2008-10-26 14:56:52 UTC (rev 17181)
@@ -0,0 +1,120 @@
+diff -up xawtv-3.95/console/v4l-conf.c~ xawtv-3.95/console/v4l-conf.c
+--- xawtv-3.95/console/v4l-conf.c~ 2008-08-03 22:22:01.000000000 +0200
++++ xawtv-3.95/console/v4l-conf.c 2008-08-03 22:34:33.000000000 +0200
+@@ -221,6 +221,21 @@ displayinfo_x11(Display *dpy, struct DIS
+ }
+ }
+
++#ifdef HAVE_LIBXXF86DGA
++static int dga_error = 0;
++static int dga_error_base;
++static int (*orig_xfree_error_handler)(Display *, XErrorEvent *);
++
++static int dga_error_handler(Display *d, XErrorEvent *e)
++{
++ if (e->error_code == (dga_error_base + XF86DGANoDirectVideoMode)) {
++ dga_error = 1;
++ return 0;
++ }
++ return orig_xfree_error_handler(d, e);
++}
++#endif
++
+ static void
+ displayinfo_dga(Display *dpy, struct DISPLAYINFO *d)
+ {
+@@ -228,7 +243,7 @@ displayinfo_dga(Display *dpy, struct DIS
+ int width,bar,foo,major,minor,flags=0;
+ void *base = NULL;
+
+- if (!XF86DGAQueryExtension(dpy,&foo,&bar)) {
++ if (!XF86DGAQueryExtension(dpy,&foo,&dga_error_base)) {
+ fprintf(stderr,"WARNING: Your X-Server has no DGA support.\n");
+ return;
+ }
+@@ -240,7 +255,14 @@ displayinfo_dga(Display *dpy, struct DIS
+ fprintf(stderr,"WARNING: No DGA support available for this display.\n");
+ return;
+ }
++ orig_xfree_error_handler = XSetErrorHandler(dga_error_handler);
+ XF86DGAGetVideoLL(dpy,XDefaultScreen(dpy),(void*)&base,&width,&foo,&bar);
++ XSync(dpy, 0);
++ XSetErrorHandler(orig_xfree_error_handler);
++ if (dga_error) {
++ fprintf(stderr,"WARNING: No DGA direct video mode for this display.\n");
++ return;
++ }
+ d->bpl = width * d->bpp/8;
+ d->base = base;
+ #else
+diff -up xawtv-3.95/libng/plugins/drv0-v4l2.c~ xawtv-3.95/libng/plugins/drv0-v4l2.c
+--- xawtv-3.95/libng/plugins/drv0-v4l2.c~ 2008-08-03 21:52:41.000000000 +0200
++++ xawtv-3.95/libng/plugins/drv0-v4l2.c 2008-08-03 22:23:01.000000000 +0200
+@@ -618,7 +618,7 @@ v4l2_setupfb(void *handle, struct ng_vid
+ return -1;
+
+ /* double-check settings */
+- if (NULL != base && h->ov_fb.base != base) {
++ if ((NULL != base && h->ov_fb.base != base) || h->ov_fb.base == NULL) {
+ fprintf(stderr,"v4l2: WARNING: framebuffer base address mismatch\n");
+ fprintf(stderr,"v4l2: me=%p v4l=%p\n",base,h->ov_fb.base);
+ h->ov_error = 1;
+diff -up xawtv-3.95/x11/xt.c~ xawtv-3.95/x11/xt.c
+--- xawtv-3.95/x11/xt.c~ 2008-08-03 22:22:11.000000000 +0200
++++ xawtv-3.95/x11/xt.c 2008-08-03 22:35:14.000000000 +0200
+@@ -1247,18 +1247,21 @@ FilterAction(Widget widget, XEvent *even
+ }
+
+ /*----------------------------------------------------------------------*/
++#ifdef HAVE_LIBXXF86DGA
++static int xfree_dga_error_base;
++#endif
+
+ void
+ xfree_dga_init(Display *dpy)
+ {
+ #ifdef HAVE_LIBXXF86DGA
+- int flags,foo,bar,ma,mi;
++ int flags,foo,ma,mi;
+
+ if (!do_overlay)
+ return;
+
+ if (args.dga) {
+- if (XF86DGAQueryExtension(dpy,&foo,&bar)) {
++ if (XF86DGAQueryExtension(dpy,&foo,&xfree_dga_error_base)) {
+ XF86DGAQueryDirectVideo(dpy,XDefaultScreen(dpy),&flags);
+ if (flags & XF86DGADirectPresent) {
+ XF86DGAQueryVersion(dpy,&ma,&mi);
+@@ -1348,6 +1351,19 @@ xfree_xinerama_init(Display *dpy)
+ #endif
+ }
+
++#ifdef HAVE_LIBXXF86DGA
++static int (*orig_xfree_error_handler)(Display *, XErrorEvent *);
++
++static int xfree_dga_error_handler(Display *d, XErrorEvent *e)
++{
++ if (e->error_code == (xfree_dga_error_base + XF86DGANoDirectVideoMode)) {
++ have_dga = 0;
++ return 0;
++ }
++ return orig_xfree_error_handler(d, e);
++}
++#endif
++
+ void
+ grabber_init()
+ {
+@@ -1358,8 +1374,11 @@ grabber_init()
+ #ifdef HAVE_LIBXXF86DGA
+ if (have_dga) {
+ int bar,fred;
++ orig_xfree_error_handler = XSetErrorHandler(xfree_dga_error_handler);
+ XF86DGAGetVideoLL(dpy,XDefaultScreen(dpy),(void*)&base,
+ &screen.bytesperline,&bar,&fred);
++ XSync(dpy, 0);
++ XSetErrorHandler(orig_xfree_error_handler);
+ }
+ #endif
+ if (!do_overlay) {
More information about the arch-commits
mailing list