diff options
author | kwm <kwm@FreeBSD.org> | 2010-10-27 18:18:37 +0800 |
---|---|---|
committer | kwm <kwm@FreeBSD.org> | 2010-10-27 18:18:37 +0800 |
commit | b74bfd6b251b88fb3963bbb9b68cba252cfdb19a (patch) | |
tree | 27e53b3f255eb675ad2ad571938adc32b49c5b42 /multimedia | |
parent | 6fa22f373a7d8690849e4e7b72b70aba01c5ba7d (diff) | |
download | freebsd-ports-gnome-b74bfd6b251b88fb3963bbb9b68cba252cfdb19a.tar.gz freebsd-ports-gnome-b74bfd6b251b88fb3963bbb9b68cba252cfdb19a.tar.zst freebsd-ports-gnome-b74bfd6b251b88fb3963bbb9b68cba252cfdb19a.zip |
* Fix a segfault problem with the motionbuf arry in the detectmotion() function.
When using "pwcview -s svga -f 20 -k"
* When pwcview sets the resolution to use, the V4L layer will reply with the
actual resolution set. As close as possible to what pwcview requested.
Fix a bug in main() that it uses the wrong size value, the resolution pwcview
set instead of the size the V4L layer returned.
Submitted by: Ivan Brawley <ivan@brawley.id.au>
Approved by: hselasky@ (maintainer)
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/pwcview/Makefile | 2 | ||||
-rw-r--r-- | multimedia/pwcview/files/patch-pwcview.c | 33 |
2 files changed, 28 insertions, 7 deletions
diff --git a/multimedia/pwcview/Makefile b/multimedia/pwcview/Makefile index 89f0b0667966..9ab1de08de72 100644 --- a/multimedia/pwcview/Makefile +++ b/multimedia/pwcview/Makefile @@ -7,7 +7,7 @@ PORTNAME= pwcview PORTVERSION= 1.4.1 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= multimedia MASTER_SITES= http://raaf.atspace.org/ \ http://www.selasky.org/hans_petter/video4bsd/releases/ \ diff --git a/multimedia/pwcview/files/patch-pwcview.c b/multimedia/pwcview/files/patch-pwcview.c index af76831dbdf5..99cd652ca88e 100644 --- a/multimedia/pwcview/files/patch-pwcview.c +++ b/multimedia/pwcview/files/patch-pwcview.c @@ -1,5 +1,5 @@ ---- pwcview.c.orig 2007-10-09 03:23:58.000000000 -0400 -+++ pwcview.c 2010-01-22 17:09:20.000000000 -0500 +--- pwcview.c.orig 2007-10-09 09:23:58.000000000 +0200 ++++ pwcview.c 2010-09-09 16:42:31.000000000 +0200 @@ -37,11 +37,8 @@ #ifndef NOGUI #include <SDL.h> @@ -377,6 +377,24 @@ jpeg_stdio_dest(cinfo, outfile); jpeg_start_compress(cinfo, TRUE); +@@ -871,7 +870,7 @@ + { + static int newbuf; + static int skip = 5; +- static uint32_t motionbuf[2][60][80]; ++ static uint32_t motionbuf[2][150][200]; + static int rectime; + uint32_t diff; + int line, col, motiondetected = 0; +@@ -888,7 +887,7 @@ + } + } + +- memset(motionbuf[newbuf],0,60*80*sizeof(uint32_t)); ++ memset(motionbuf[newbuf],0,150*200*sizeof(uint32_t)); + + for(line = 0; line < height; ++line) { + int y = line / 8; tp = pt; @@ -1041,7 +1040,10 @@ } #endif @@ -411,16 +429,18 @@ return 1; } break; -@@ -1218,7 +1224,7 @@ +@@ -1216,9 +1222,8 @@ + vw.width = sizes[i].width; + vw.height= sizes[i].height; vw.flags = fps << PWC_FPS_SHIFT; - imgsize = (vw.width * vw.height * 3)/2; +- imgsize = (vw.width * vw.height * 3)/2; - if((fd = open(device, O_RDONLY)) < 0) { + if((fd = v4l1_open(device, O_RDONLY)) < 0) { if(errno == EBUSY) fprintf(stderr,"Failed to access webcam: Device in use\n"); else { -@@ -1236,17 +1242,17 @@ +@@ -1236,30 +1241,31 @@ } fcntl(fd,F_SETFD,FD_CLOEXEC); @@ -441,8 +461,9 @@ fprintf(stderr,"Failed to set webcam to: %dx%d (%s) at %d fps (%s)\n", vw.width,vw.height,sizes[i].name,fps,strerror(errno)); exit(1); -@@ -1254,12 +1260,12 @@ + } fprintf(stderr,"Webcam set to: %dx%d (%s) at %d fps\n",vw.width,vw.height,sizes[i].name,fps); ++ imgsize = (vw.width * vw.height * 3)/2; if(headless && snapcnt == 0 && motionrecord == 0) { /* Done */ - close(fd); |