./0000755000551200055120000000000010360420104007571 5ustar abelabel./license.txt0000644000551200055120000000017710360420104011761 0ustar abelabelThe license of this program can be obtained from: http://www.vanheusden.com/license.txt It is actually the GNU Public License. ./dov4l.10000644000551200055120000000322410360420104010704 0ustar abelabel.\" Copyright Folkert van Heusden, 2003 .\" .\" This file may be copied under the conditions described .\" in the GNU GENERAL PUBLIC LICENSE, Version 1, September 1998 .\" that should have been distributed together with this file. .\" .TH DOV4L 1 2003-05 "dov4l" .SH NAME dov4l \- set parameters on a video4linux device .SH SYNOPSIS .BI "dov4l [" options "] .sp options: .BI "[\-d device] [\-f frequency] [\-t tuner] [\-i inputchannel] [\-m mode]" .sp .SH DESCRIPTION The program .B dov4l lets you set parameters on a video4linux-device. .PP .SH OPTIONS .TP .B "\-q" Query capabilities and settings of your video4linux device. .TP .B "\-h" Usage .TP .B "\-d" device Select device. Default is /dev/video0 .TP .B "\-f" frequency Set frequency (in Hz!). .TP .B "\-t" tuner Select tuner. Most of the time the default (0) suffices. .TP .B "\-i" inputchannel Select inputchannel. TVcards, for example, sometimes have a tuner and a composite video input-channel. With this parameter you can select one. To get a list of input channels, run dov4l with the -q parameter. .TP .B "\-m" mode Select a mode. Mode can be: PAL, NTSC, SECAM or AUTO. .TP .B "\-b" brightness Set brightness. .TP .B "\-u" hue Set hue. .TP .B "\-c" color Set color. .TP .B "\-n" contrast Set contrast. .TP .B "\-w" whiteness Set whiteness. .TP .B "\-p" palette Set palette. .TP .B "\-s" width,height Set the width/height of the image, seperated with a ','. Warning: no spaces around the ','! .SH "SEE ALSO" .BR http://www.vanheusden.com/dov4l/ .SH NOTES This page describes .B dov4l as found in the dov4l-0.5 package; other versions may differ slightly. Mail corrections, bugs and additions to folkert@vanheusden.com ./dov4l.c0000644000551200055120000003402210360420104010766 0ustar abelabel#include #include #include #include #include #include #include #include #include #define _LINUX_TIME_H 1 #include #define M_S 0 /* set */ #define M_Q 1 /* query */ #ifndef VIDEO_PALETTE_JPEG #define VIDEO_PALETTE_JPEG 21 #endif typedef struct { char *name; int pal; } pals; pals palettes[]={ { "GREY", VIDEO_PALETTE_GREY }, { "HI240", VIDEO_PALETTE_HI240 }, { "RGB565", VIDEO_PALETTE_RGB565 }, { "RGB24", VIDEO_PALETTE_RGB24 }, { "RGB32", VIDEO_PALETTE_RGB32 }, { "RGB555", VIDEO_PALETTE_RGB555 }, { "YUV422", VIDEO_PALETTE_YUV422 }, { "YUYV", VIDEO_PALETTE_YUYV }, { "UYVY", VIDEO_PALETTE_UYVY }, { "YUV420", VIDEO_PALETTE_YUV420 }, { "YUV411", VIDEO_PALETTE_YUV411 }, { "RAW", VIDEO_PALETTE_RAW }, { "YUV422P", VIDEO_PALETTE_YUV422P }, { "YUV411P", VIDEO_PALETTE_YUV411P }, { "YUV420P", VIDEO_PALETTE_YUV420P }, { "YUV410P", VIDEO_PALETTE_YUV410P }, { "PLANAR", VIDEO_PALETTE_PLANAR }, { "COMPONENT", VIDEO_PALETTE_COMPONENT }, { "JPEG", VIDEO_PALETTE_JPEG }, { NULL, -1 } }; void usage(void) { printf("d device device to use (default is /dev/video0)\n"); printf("q query capabilities\n"); printf("i channel set input-channel\n"); printf("t tuner set tuner (most of the time 0)\n"); printf("m mode mode (PAL/NTSC/SECAM/AUTO)\n"); printf("f frequency set frequency\n"); printf("b brightness set brightness\n"); printf("u hue set hue\n"); printf("c color set color\n"); printf("n contrast set contrast\n"); printf("w whiteness set whiteness\n"); printf("p palette set palette (GREY, HI240, RGB565, RGB24,\n"); printf(" RGB32, RGB555, YUV422, YUYV, UYVY, YUV420,\n"); printf(" YUV411, RAW, YUV422P, YUV411P, YUV420P,\n"); printf(" YUV410P, PLANAR, COMPONENT, JPEG (spca5xx"); printf(" extension))\n"); printf("s width,height set size\n"); printf("\n"); printf("h this help\n"); } void myperror(char *str) { perror(str); exit(1); } void set_inputchannel(int fd, int channel) { struct video_channel vchan; vchan.channel = channel; /* get things like norm */ if (ioctl(fd, VIDIOCGCHAN, &vchan) == -1) myperror("VDIOCGCHAN"); /* do set */ if (ioctl(fd, VIDIOCSCHAN, &vchan) == -1) myperror("VIDIOCSCHAN"); } void query(int fd) { struct video_window vwin; struct video_picture vpic; int loop; struct video_capability vcap; if (ioctl(fd, VIDIOCGCAP, &vcap, sizeof(vcap)) == -1) { myperror("VIDIOCGCAP"); return; } printf("Canonical name for this interface: %s\n", vcap.name); printf("Type of interface:\n"); if (vcap.type & VID_TYPE_CAPTURE) printf(" Can capture to memory\n"); if (vcap.type & VID_TYPE_TUNER) printf(" Has a tuner of some form\n"); if (vcap.type & VID_TYPE_TELETEXT) printf(" Has teletext capability\n"); if (vcap.type & VID_TYPE_OVERLAY) printf(" Can overlay its image onto the frame buffer\n"); if (vcap.type & VID_TYPE_CHROMAKEY) printf(" Overlay is Chromakeyed\n"); if (vcap.type & VID_TYPE_CLIPPING) printf(" Overlay clipping is supported\n"); if (vcap.type & VID_TYPE_FRAMERAM) printf(" Overlay overwrites frame buffer memory\n"); if (vcap.type & VID_TYPE_SCALES) printf(" The hardware supports image scaling\n"); if (vcap.type & VID_TYPE_MONOCHROME) printf(" Image capture is grey scale only\n"); if (vcap.type & VID_TYPE_SUBCAPTURE) printf(" Capture can be of only part of the image\n"); printf("\n"); printf("Number of radio/tv channels if appropriate: %d\n", vcap.channels); printf("Number of audio devices if appropriate: %d\n", vcap.audios); printf("Maximum capture width in pixels: %d\n", vcap.maxwidth); printf("Maximum capture height in pixels: %d\n", vcap.maxheight); printf("Minimum capture width in pixels: %d\n", vcap.minwidth); printf("Minimum capture height in pixels: %d\n", vcap.minheight); printf("\n"); if (ioctl(fd, VIDIOCGWIN, &vwin, sizeof(vwin)) == -1) { myperror("VIDIOCGWIN"); return; } printf("Image size (x,y): %d, %d\n", vwin.width,vwin.height); printf("\n"); for(loop=0; loop