[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

graphics/vid port update && maintainer




Hey Gang,

So, I wrote previously about graphics/vid not working as expected [0].
Since then I have gotten it working.  I have an update here for testing.
If it is accepted please make me the maintainer of graphics/vid.

I have only tested this with a D-Link DSB-C300 (see the pkg/DESCR for more
models that work).  It works fine at home, even with the isochronous
endpoint (I haven't yet heard back from aaron@ on this part of the ugen(4)
device).  

The vid binary can be used in the following ways:

1) find the OV511/OV511+ device automatically:
   % vid | pnmtopng > test.png
2) specify a device:
   % vid -d /dev/ugen0.00 | pnmtopng > test.png
  or
   % vid --device-name=/dev/ugen0.00 | pnmtopng > test.png

Please also make sure that the package level change is okay for this
(vid-1.0.1 vs. vid-1.0.1p1).  If there are any problems or suggestions
please let me know (and I freely accept pointers on my potentially bad C
hacks, working with Perl for 2 years straight can do that to you).

Anyway, please test this and commit it if it is okay

-dan

footnotes:
[0] http://www.sigmasoft.com/~openbsd/archive/openbsd-ports/200108/msg00457.html

[diff to bring up to date]
------------%< snip %<----------------------%< snip %<------------
diff -u -r -p0 vid.orig/Makefile vid/Makefile
--- vid.orig/Makefile	Wed Aug 29 15:03:57 2001
+++ vid/Makefile	Wed Aug 29 15:18:27 2001
@@ -7,0 +8 @@ DISTNAME=	vid-1.0.1
+PKGNAME=        ${DISTNAME}p1
@@ -9 +10 @@ CATEGORIES=	graphics
-NEED_VERSION=   1.402
+NEED_VERSION=   1.444
@@ -11 +12,2 @@ NEED_VERSION=   1.402
-HOMEPAGE=	http://members.home.com/housel/
+HOMEPAGE=	http://outvid-bsd.sourceforge.net/
+MASTER_SITES=   http://members.home.com/housel/
@@ -13 +15 @@ HOMEPAGE=	http://members.home.com/housel
-MAINTAINER=	ports@openbsd.org
+MAINTAINER=	Dan Weeks <danimal@danimal.org>
@@ -20,2 +21,0 @@ PERMIT_DISTFILES_FTP=	    Yes
-
-MASTER_SITES=	http://members.home.com/housel/
diff -u -r -p0 vid.orig/patches/patch-vid_c vid/patches/patch-vid_c
--- vid.orig/patches/patch-vid_c	Wed Aug 29 15:03:57 2001
+++ vid/patches/patch-vid_c	Wed Aug 29 15:25:59 2001
@@ -1 +0,0 @@
-$OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/19 03:25:08 angelos Exp $
@@ -3,2 +2,9 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-+++ vid.c	Sat Jun  9 01:33:37 2001
-@@ -217,12 +217,15 @@ main(int argc, char *argv[]) {
++++ vid.c	Wed Aug 29 15:25:42 2001
+@@ -213,16 +213,22 @@ main(int argc, char *argv[]) {
+   char dev[FILENAME_MAX];	/* for constructing device names */
+   char isocdev[FILENAME_MAX];	/* for constructing endpoint 1 device names */
+   char *devname = NULL;		/* device name */
++  char *p = NULL;               /* for string ops */
++  int slen = -1;                 /* string length holder */
++  int plen = -1;                 /* string length holder */
+   int len = -1;			/* isochronous input read length */
@@ -21 +27 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-@@ -235,7 +238,7 @@ main(int argc, char *argv[]) {
+@@ -235,7 +241,7 @@ main(int argc, char *argv[]) {
@@ -30 +36,12 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-@@ -287,8 +290,9 @@ main(int argc, char *argv[]) {
+@@ -276,7 +282,9 @@ main(int argc, char *argv[]) {
+   }
+ 
+   if(devname) {
+-    if((fd = open(devname, O_RDWR)) < 0) {
++    snprintf(dev, sizeof(dev), "%s", devname);
++
++    if((fd = open(dev, O_RDWR)) < 0) {
+       perror(devname);
+       exit(1);
+     }
+@@ -287,18 +295,20 @@ main(int argc, char *argv[]) {
@@ -42 +59,4 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-@@ -298,7 +302,8 @@ main(int argc, char *argv[]) {
+     int i = 0;
+     for(i = 0; i < 15; ++i) {
+-      sprintf(dev, "/dev/ugen%d", i);
++      snprintf(dev, sizeof(dev), "/dev/ugen%d.00", i);
@@ -52 +72 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-@@ -308,12 +313,15 @@ main(int argc, char *argv[]) {
+@@ -308,12 +318,15 @@ main(int argc, char *argv[]) {
@@ -69 +89 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-@@ -398,23 +406,55 @@ main(int argc, char *argv[]) {
+@@ -398,23 +411,55 @@ main(int argc, char *argv[]) {
@@ -141 +161 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-@@ -442,14 +482,14 @@ main(int argc, char *argv[]) {
+@@ -442,14 +487,14 @@ main(int argc, char *argv[]) {
@@ -158 +178,26 @@ $OpenBSD: patch-vid_c,v 1.1.1.1 2001/06/
-@@ -475,36 +515,38 @@ main(int argc, char *argv[]) {
+@@ -468,43 +513,62 @@ main(int argc, char *argv[]) {
+   vs.xels = pnm_allocarray(vs.width, vs.height);
+ 
+   /* open the isochronous endpoint (endpoint 1) */
+-  sprintf(isocdev, "%s.1", devname);
++  /* first we need to construct the endpoint device from */
++  /* the given device */
++  p    = strchr(devname, '.');
++  slen = strlen(devname);
++  if(p == NULL) {
++    /* there is no dot, just append the isoc endpoint */
++    /* this is horribly contrived and needs some work, */
++    /* at this point OpenBSD doesn't use /dev/ugenX so */
++    /* it will get fixed if soon */
++    snprintf(isocdev, sizeof(isocdev), "%s.01", devname);
++  } else {
++    /* there is a dot */
++    plen = strlen(p);
++    snprintf(isocdev, sizeof(isocdev), "%s", devname);
++    isocdev[slen - plen] = NULL;
++    snprintf(isocdev, sizeof(isocdev), "%s.01", isocdev);
++  }
++  
+   if((isoc = open(isocdev, O_RDONLY)) < 0) {
+     perror(isocdev);
+     exit(1);
diff -u -r -p0 vid.orig/pkg/DESCR vid/pkg/DESCR
--- vid.orig/pkg/DESCR	Wed Aug 29 15:03:57 2001
+++ vid/pkg/DESCR	Wed Aug 29 15:20:29 2001
@@ -4 +3,0 @@ Omnivision OV511 and OV511+ chipset.
-
@@ -23,3 +21,0 @@ Older Creative WebCam 3's use the OV511 
-
-On my OV511+ Trust SpaceCam 300 the image appears orange. I'm investigating.
-
------------%< snip %<----------------------%< snip %<------------

-- 
dan weeks - codemonkey - http://danimal.org/