diff options
author | msmith <msmith@FreeBSD.org> | 1998-02-18 13:46:23 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-02-18 13:46:23 +0000 |
commit | 892f7dbda182dbe6ec8f30dcc11b8c87c346604a (patch) | |
tree | 5b0685683a15d2bd43e5e640f7db5c2b997c434c | |
parent | 63ba0269a8a61377430a3e5a49612dbb22232e49 (diff) | |
download | FreeBSD-src-892f7dbda182dbe6ec8f30dcc11b8c87c346604a.zip FreeBSD-src-892f7dbda182dbe6ec8f30dcc11b8c87c346604a.tar.gz |
Remove qcam support programs.
Submitted by: pst
-rw-r--r-- | usr.sbin/qcamcontrol/Makefile | 3 | ||||
-rw-r--r-- | usr.sbin/qcamcontrol/qcamcontrol.1 | 68 | ||||
-rw-r--r-- | usr.sbin/qcamcontrol/qcamcontrol.c | 224 | ||||
-rw-r--r-- | usr.sbin/qcamcontrol/qcamtime/Makefile | 8 | ||||
-rw-r--r-- | usr.sbin/qcamcontrol/qcamtime/qcamtime.c | 101 |
5 files changed, 0 insertions, 404 deletions
diff --git a/usr.sbin/qcamcontrol/Makefile b/usr.sbin/qcamcontrol/Makefile deleted file mode 100644 index d5f42cf..0000000 --- a/usr.sbin/qcamcontrol/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -PROG= qcamcontrol - -.include <bsd.prog.mk> diff --git a/usr.sbin/qcamcontrol/qcamcontrol.1 b/usr.sbin/qcamcontrol/qcamcontrol.1 deleted file mode 100644 index eecb43b..0000000 --- a/usr.sbin/qcamcontrol/qcamcontrol.1 +++ /dev/null @@ -1,68 +0,0 @@ -.Dd Feburary 29, 1996 -.Dt QCAMCONTROL 1 -.Os FreeBSD -.Sh NAME -.Nm qcamcontrol -.Nd Connectix QuickCam control utility -.Sh SYNOPSIS -.Nm qcamcontrol -.Op Fl b Ar brightness -.Op Fl c Ar contrast -.Op Fl d Ar depth -.Op Fl p Ar device -.Op Fl w Ar whitebalance -.Op Fl x Ar xsize -.Op Fl y Ar ysize -.Op Fl z Ar zoom -.Sh DESCRIPTION -.Nm Qcamcontrol -is a program to demonstrate control over the Connectix QuickCam(TM) -parallel port camera and to take a single frame picture. -.Pp -If the device not specified, -.Pa /dev/qcam0 -is assumed. -If no command is given, then -.Nm -will use its defaults to grab a single frame from the camera. The control -program will output a portable pixmap (ppm) file to stdout. -.Pp -The following options are available: -.Bl -tag -width indent -.It Fl b Ar brightness -Control the brightness of the picture (0..255). -.It Fl c Ar contrast -Control the contrast of the picture (0..255). -.It Fl d Ar depth -16 or 64 shades of gray (specified as 4 or 6 bits per pixel). -.It Fl p Ar device -Quickcam device (port) (default is -.Pa /dev/qcam0 ) -.It Fl w Ar whitebalance -Amount of white in the picture (0..255). -.It Fl x Ar xsize -Width of image (320 or less). -.It Fl y Ar ysize -Height of image (240 or less). -.It Fl z Ar zoom -Zoom in (1x, 1.5x, or 2x). -.El -.Sh BUGS -.Nm Qcamcontrol -does not enforce a proper aspect ratio for x y sizes. -In practice, standard picture sizes are 320x240 and 180x160 and all smaller -sizes that maintain a similar aspect ratio. -Also, the camera is notoriously finicky until you get just the right -combination of white-balance, contrast, and brightness. Improper values -will return all-black or all-white pictures. -.Sh FILES -.Bl -tag -width /dev/qcam0 -compact -.It Pa /dev/qcam0 -.El -.Sh AUTHOR -.An Paul Traina -.Sh HISTORY -The -.Nm -command appeared in -.Fx 2.1.5 . diff --git a/usr.sbin/qcamcontrol/qcamcontrol.c b/usr.sbin/qcamcontrol/qcamcontrol.c deleted file mode 100644 index b52cca5..0000000 --- a/usr.sbin/qcamcontrol/qcamcontrol.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * QuickCam(TM) driver control program. - * Copyright (c) 1996, Paul Traina. - * - * QuickCam(TM) is a registered trademark of Connectix Inc. - * Use this driver at your own risk, it is not warranted by - * Connectix or the authors. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer - * in this position and unchanged. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software withough specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef lint -static const char rcsid[] = - "$Id$"; -#endif /* not lint */ - -#include <err.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/fcntl.h> -#include <sys/ioctl.h> -#include <machine/qcam.h> - -#ifdef LINUX -#include <getopt.h> -#endif - -void print_data(struct qcam *data) -{ - fprintf(stderr, "version=%d, (%d,%d) at (%d,%d) @%dbpp " - "zoom=%d, exp=%d, b/w/c=%d/%d/%d\n", - data->qc_version, - data->qc_xsize, data->qc_ysize, - data->qc_xorigin, data->qc_yorigin, - data->qc_bpp, - data->qc_zoom, - data->qc_exposure, - data->qc_brightness, - data->qc_whitebalance, - data->qc_contrast); -} - -static void -usage(void) -{ - fprintf(stderr, "usage: qcamcontrol [-p port] [-x xsize] [-y ysize] " - "[-z zoom] [-d depth]\n" - " [-b brightness] [-w whitebal] " - "[-c contrast] [-e exposure]\n"); - exit(2); -} - -int -main(int argc, char **argv) -{ - struct qcam info; - int fd, len; - size_t bytes; - char opt; - - static char buffer[QC_MAX_XSIZE*QC_MAX_YSIZE]; - - char *port = "/dev/qcam0"; - int x_size, y_size, zoom, depth, brightness, whitebalance, contrast, - exposure; - - /* - * Default everything to unset. - */ - x_size = y_size = zoom = depth = brightness = whitebalance = - contrast = exposure = -1; - - while ((opt = getopt(argc, argv, "p:x:y:z:d:b:w:c:e:")) != -1) { - switch (opt) { - case 'p': - port = optarg; - break; - - case 'x': - x_size = atoi(optarg); - if (x_size > QC_MAX_XSIZE) - errx(2, "x size too large (max %d)", QC_MAX_XSIZE); - break; - - case 'y': - y_size = atoi(optarg); - if (y_size > QC_MAX_YSIZE) - errx(2, "x size too large (max %d)", QC_MAX_YSIZE); - break; - - case 'z': - zoom = atoi(optarg); - if (zoom > QC_ZOOM_200) - errx(2, "zoom too large (max %d)", QC_ZOOM_200); - break; - - case 'd': - depth = atoi(optarg); - if (depth != 4 && depth != 6) - errx(2, "invalid depth (4 or 6)"); - break; - - case 'b': - brightness = atoi(optarg); - if (brightness > 255) - errx(2, "bad brightness (max 255)"); - break; - - case 'w': - whitebalance = atoi(optarg); - if (whitebalance > 255) - errx(2, "bad white balance (max 255)"); - break; - - case 'c': - contrast = atoi(optarg); - if (contrast > 255) - errx(2, "bad contrast (max 255)"); - break; - - case 'e': - exposure = atoi(optarg); - if (exposure < 100) - errx(2, "bad exposure (min 100)"); - break; - - default: - usage(); - } - } - argc -= optind; - argv += optind; - - /* open device */ - if ((fd = open(port, O_RDONLY)) < 0) - err(1, "open"); - - - - if (ioctl(fd, QC_GET, &info) < 0) /* read in default info */ - err(1, "ioctl(QC_GET)"); - - if (x_size > -1) - info.qc_xsize = x_size; - if (y_size > -1) - info.qc_ysize = y_size; - if (depth > -1) - info.qc_bpp = depth; - if (zoom > -1) - info.qc_zoom = zoom; - if (brightness > -1) - info.qc_brightness = brightness; - if (whitebalance > -1) - info.qc_whitebalance = whitebalance; - if (contrast > -1) - info.qc_contrast = contrast; - if (exposure > -1) - info.qc_exposure = exposure; - - /* - * make sure we're in sync with the kernel version of the driver - * ioctl structure - */ - info.qc_version = QC_IOCTL_VERSION; - - if (ioctl(fd, QC_SET, &info) < 0) - err(1, "ioctl(QC_SET)"); - - /* - * Tell us what the kernel thinks we're asking for - */ - if (ioctl(fd, QC_GET, &info) < 0) - err(1, "ioctl(QC_SET)"); - - print_data(&info); - - /* - * Grab a frame -- a single read will always work, but give a - * particularly paranoid example. - */ - len = info.qc_xsize * info.qc_ysize; - while (len) { - bytes = read(fd, buffer, len); - if (bytes < 0) - err(1, "read"); - len -= bytes; - - if (bytes == 0) - exit(0); - } - - /* - * Write the frame to stdout as a PGM image. - */ - fprintf(stdout, "P5\n%d %d\n%d\n", - info.qc_xsize, info.qc_ysize, (1<<info.qc_bpp) - 1); - fflush(stdout); - - if (write(1, buffer, info.qc_xsize * info.qc_ysize) < 0) - err(1, "write"); - return(0); -} diff --git a/usr.sbin/qcamcontrol/qcamtime/Makefile b/usr.sbin/qcamcontrol/qcamtime/Makefile deleted file mode 100644 index 03c040c..0000000 --- a/usr.sbin/qcamcontrol/qcamtime/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# -# qcamtime is a program for snarfing timing histograms out of the kernel -# it is only meant for use by driver developers -# -PROG= qcamtime -NOMAN= - -.include <bsd.prog.mk> diff --git a/usr.sbin/qcamcontrol/qcamtime/qcamtime.c b/usr.sbin/qcamcontrol/qcamtime/qcamtime.c deleted file mode 100644 index d8a32f0..0000000 --- a/usr.sbin/qcamcontrol/qcamtime/qcamtime.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Print out timing statistics from a QuickCam scan run yes, this is ugly, - * it's just for simple analysis of driver timing. This is not normally - * part of the system. - * - * Paul Traina, Feburary 1996 - */ - -#include <err.h> -#include <nlist.h> -#include <paths.h> -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/fcntl.h> - -#include <machine/qcam.h> - -int kmem = -1; - -struct nlist names[] = { - {"_qcam_rsbhigh"}, - {"_qcam_rsblow"} -}; -#define MAX_SYMBOLS 2 - -#define FBUFSIZE (QC_MAX_XSIZE*QC_MAX_YSIZE)+50 -static u_short high_times[FBUFSIZE]; -static u_short low_times[FBUFSIZE]; - -void -getaddrs(void) -{ - int i; - - if (kmem < 0) { - if ((kmem = open(_PATH_KMEM, 0, 0)) < 0) - err(1, "open kmem"); - (void) fcntl(kmem, F_SETFD, 1); - - for (i = 0; i < MAX_SYMBOLS; i++) { - if (nlist("/kernel", &names[i]) < 0) - err(1, "nlist"); - if (names[i].n_value == 0) - errx(1, "couldn't find names[%d]", i); - } - } -} - -void -getdata(void) -{ - if (lseek(kmem, (off_t) names[0].n_value, SEEK_SET) < 0) - err(1, "lseek high"); - if (read(kmem, (u_short *) high_times, sizeof(high_times)) < 0) - err(1, "read high"); - if (lseek(kmem, (off_t) names[1].n_value, SEEK_SET) < 0) - err(1, "lseek low"); - if (read(kmem, (u_short *) low_times, sizeof(low_times)) < 0) - err(1, "read low"); -} - - -/* - * slow and stupid, who cares? we're just learning about the camera's - * behavior - */ -int -printdata(u_short * p, int length) -{ - int i, j, non_zero; - - for (i = 0; i < length;) { - non_zero = 0; - for (j = 0; j < 16; j++) - if (p[j]) - non_zero++; - - if (non_zero) { - printf("%8d:", i); - - for (j = 0; j < 16; j++) { - printf(" %d", *p++); - i++; - } - printf("\n"); - } else - i += 16; - } - return(0); -} - -int -main(void) -{ - getaddrs(); - getdata(); - printdata(high_times, FBUFSIZE); - printdata(low_times, FBUFSIZE); - return(0); -} |