diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-25 07:21:43 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-25 07:29:32 -0500 |
commit | 48773e685b118ef56dcf5258ef7388a4bea16137 (patch) | |
tree | 2d3755b848eafaa6dc70b7d3b68a9ffe8f5d458d /Documentation/video4linux/CQcam.txt | |
parent | d56410e0a594150c5ca06319da7bc8901c4d455e (diff) |
V4L/DVB (3599c): Whitespace cleanups under Documentation/video4linux
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'Documentation/video4linux/CQcam.txt')
-rw-r--r-- | Documentation/video4linux/CQcam.txt | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/Documentation/video4linux/CQcam.txt b/Documentation/video4linux/CQcam.txt index e415e3604539..464e4cec94cb 100644 --- a/Documentation/video4linux/CQcam.txt +++ b/Documentation/video4linux/CQcam.txt | |||
@@ -1,7 +1,7 @@ | |||
1 | c-qcam - Connectix Color QuickCam video4linux kernel driver | 1 | c-qcam - Connectix Color QuickCam video4linux kernel driver |
2 | 2 | ||
3 | Copyright (C) 1999 Dave Forrest <drf5n@virginia.edu> | 3 | Copyright (C) 1999 Dave Forrest <drf5n@virginia.edu> |
4 | released under GNU GPL. | 4 | released under GNU GPL. |
5 | 5 | ||
6 | 1999-12-08 Dave Forrest, written with kernel version 2.2.12 in mind | 6 | 1999-12-08 Dave Forrest, written with kernel version 2.2.12 in mind |
7 | 7 | ||
@@ -45,21 +45,21 @@ configuration. The appropriate flags are: | |||
45 | CONFIG_PNP_PARPORT M for autoprobe.o IEEE1284 readback module | 45 | CONFIG_PNP_PARPORT M for autoprobe.o IEEE1284 readback module |
46 | CONFIG_PRINTER_READBACK M for parport_probe.o IEEE1284 readback module | 46 | CONFIG_PRINTER_READBACK M for parport_probe.o IEEE1284 readback module |
47 | CONFIG_VIDEO_DEV M for videodev.o video4linux module | 47 | CONFIG_VIDEO_DEV M for videodev.o video4linux module |
48 | CONFIG_VIDEO_CQCAM M for c-qcam.o Color Quickcam module | 48 | CONFIG_VIDEO_CQCAM M for c-qcam.o Color Quickcam module |
49 | 49 | ||
50 | With these flags, the kernel should compile and install the modules. | 50 | With these flags, the kernel should compile and install the modules. |
51 | To record and monitor the compilation, I use: | 51 | To record and monitor the compilation, I use: |
52 | 52 | ||
53 | (make zlilo ; \ | 53 | (make zlilo ; \ |
54 | make modules; \ | 54 | make modules; \ |
55 | make modules_install ; | 55 | make modules_install ; |
56 | depmod -a ) &>log & | 56 | depmod -a ) &>log & |
57 | less log # then a capital 'F' to watch the progress | 57 | less log # then a capital 'F' to watch the progress |
58 | 58 | ||
59 | But that is my personal preference. | 59 | But that is my personal preference. |
60 | 60 | ||
61 | 2.2 Configuration | 61 | 2.2 Configuration |
62 | 62 | ||
63 | The configuration requires module configuration and device | 63 | The configuration requires module configuration and device |
64 | configuration. I like kmod or kerneld process with the | 64 | configuration. I like kmod or kerneld process with the |
65 | /etc/modprobe.conf file so the modules can automatically load/unload as | 65 | /etc/modprobe.conf file so the modules can automatically load/unload as |
@@ -68,7 +68,7 @@ using MAKEDEV, or need to be created. The following sections detail | |||
68 | these procedures. | 68 | these procedures. |
69 | 69 | ||
70 | 70 | ||
71 | 2.1 Module Configuration | 71 | 2.1 Module Configuration |
72 | 72 | ||
73 | Using modules requires a bit of work to install and pass the | 73 | Using modules requires a bit of work to install and pass the |
74 | parameters. Understand that entries in /etc/modprobe.conf of: | 74 | parameters. Understand that entries in /etc/modprobe.conf of: |
@@ -128,9 +128,9 @@ system (CONFIG_PROC_FS), the parallel printer support | |||
128 | (CONFIG_PRINTER), the IEEE 1284 system,(CONFIG_PRINTER_READBACK), you | 128 | (CONFIG_PRINTER), the IEEE 1284 system,(CONFIG_PRINTER_READBACK), you |
129 | should be able to read some identification from your quickcam with | 129 | should be able to read some identification from your quickcam with |
130 | 130 | ||
131 | modprobe -v parport | 131 | modprobe -v parport |
132 | modprobe -v parport_probe | 132 | modprobe -v parport_probe |
133 | cat /proc/parport/PORTNUMBER/autoprobe | 133 | cat /proc/parport/PORTNUMBER/autoprobe |
134 | Returns: | 134 | Returns: |
135 | CLASS:MEDIA; | 135 | CLASS:MEDIA; |
136 | MODEL:Color QuickCam 2.0; | 136 | MODEL:Color QuickCam 2.0; |
@@ -140,7 +140,7 @@ Returns: | |||
140 | and well. A common problem is that the current driver does not | 140 | and well. A common problem is that the current driver does not |
141 | reliably detect a c-qcam, even though one is attached. In this case, | 141 | reliably detect a c-qcam, even though one is attached. In this case, |
142 | 142 | ||
143 | modprobe -v c-qcam | 143 | modprobe -v c-qcam |
144 | or | 144 | or |
145 | insmod -v c-qcam | 145 | insmod -v c-qcam |
146 | 146 | ||
@@ -152,16 +152,16 @@ video4linux mailing list and archive for more current information. | |||
152 | 3.1 Checklist: | 152 | 3.1 Checklist: |
153 | 153 | ||
154 | Can you get an image? | 154 | Can you get an image? |
155 | v4lgrab >qcam.ppm ; wc qcam.ppm ; xv qcam.ppm | 155 | v4lgrab >qcam.ppm ; wc qcam.ppm ; xv qcam.ppm |
156 | 156 | ||
157 | Is a working c-qcam connected to the port? | 157 | Is a working c-qcam connected to the port? |
158 | grep ^ /proc/parport/?/autoprobe | 158 | grep ^ /proc/parport/?/autoprobe |
159 | 159 | ||
160 | Do the /dev/video* files exist? | 160 | Do the /dev/video* files exist? |
161 | ls -lad /dev/video | 161 | ls -lad /dev/video |
162 | 162 | ||
163 | Is the c-qcam module loaded? | 163 | Is the c-qcam module loaded? |
164 | modprobe -v c-qcam ; lsmod | 164 | modprobe -v c-qcam ; lsmod |
165 | 165 | ||
166 | Does the camera work with alternate programs? cqcam, etc? | 166 | Does the camera work with alternate programs? cqcam, etc? |
167 | 167 | ||
@@ -174,7 +174,7 @@ video4linux mailing list and archive for more current information. | |||
174 | isn't, you might try patching the c-qcam module to add a parport=xxx | 174 | isn't, you might try patching the c-qcam module to add a parport=xxx |
175 | option as in the bw-qcam module so you can specify the parallel port: | 175 | option as in the bw-qcam module so you can specify the parallel port: |
176 | 176 | ||
177 | insmod -v c-qcam parport=0 | 177 | insmod -v c-qcam parport=0 |
178 | 178 | ||
179 | And bypass the detection code, see ../../drivers/char/c-qcam.c and | 179 | And bypass the detection code, see ../../drivers/char/c-qcam.c and |
180 | look for the 'qc_detect' code and call. | 180 | look for the 'qc_detect' code and call. |
@@ -183,12 +183,12 @@ look for the 'qc_detect' code and call. | |||
183 | this work is documented at the video4linux2 site listed below. | 183 | this work is documented at the video4linux2 site listed below. |
184 | 184 | ||
185 | 185 | ||
186 | 9.0 --- A sample program using v4lgrabber, | 186 | 9.0 --- A sample program using v4lgrabber, |
187 | 187 | ||
188 | This program is a simple image grabber that will copy a frame from the | 188 | This program is a simple image grabber that will copy a frame from the |
189 | first video device, /dev/video0 to standard output in portable pixmap | 189 | first video device, /dev/video0 to standard output in portable pixmap |
190 | format (.ppm) Using this like: 'v4lgrab | convert - c-qcam.jpg' | 190 | format (.ppm) Using this like: 'v4lgrab | convert - c-qcam.jpg' |
191 | produced this picture of me at | 191 | produced this picture of me at |
192 | http://mug.sys.virginia.edu/~drf5n/extras/c-qcam.jpg | 192 | http://mug.sys.virginia.edu/~drf5n/extras/c-qcam.jpg |
193 | 193 | ||
194 | -------------------- 8< ---------------- 8< ----------------------------- | 194 | -------------------- 8< ---------------- 8< ----------------------------- |
@@ -202,8 +202,8 @@ produced this picture of me at | |||
202 | * Use as: | 202 | * Use as: |
203 | * v4lgrab >image.ppm | 203 | * v4lgrab >image.ppm |
204 | * | 204 | * |
205 | * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org> | 205 | * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org> |
206 | * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c | 206 | * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c |
207 | * with minor modifications (Dave Forrest, drf5n@virginia.edu). | 207 | * with minor modifications (Dave Forrest, drf5n@virginia.edu). |
208 | * | 208 | * |
209 | */ | 209 | */ |
@@ -225,55 +225,55 @@ produced this picture of me at | |||
225 | 225 | ||
226 | #define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \ | 226 | #define READ_VIDEO_PIXEL(buf, format, depth, r, g, b) \ |
227 | { \ | 227 | { \ |
228 | switch (format) \ | 228 | switch (format) \ |
229 | { \ | 229 | { \ |
230 | case VIDEO_PALETTE_GREY: \ | 230 | case VIDEO_PALETTE_GREY: \ |
231 | switch (depth) \ | 231 | switch (depth) \ |
232 | { \ | 232 | { \ |
233 | case 4: \ | 233 | case 4: \ |
234 | case 6: \ | 234 | case 6: \ |
235 | case 8: \ | 235 | case 8: \ |
236 | (r) = (g) = (b) = (*buf++ << 8);\ | 236 | (r) = (g) = (b) = (*buf++ << 8);\ |
237 | break; \ | 237 | break; \ |
238 | \ | 238 | \ |
239 | case 16: \ | 239 | case 16: \ |
240 | (r) = (g) = (b) = \ | 240 | (r) = (g) = (b) = \ |
241 | *((unsigned short *) buf); \ | 241 | *((unsigned short *) buf); \ |
242 | buf += 2; \ | 242 | buf += 2; \ |
243 | break; \ | 243 | break; \ |
244 | } \ | 244 | } \ |
245 | break; \ | 245 | break; \ |
246 | \ | 246 | \ |
247 | \ | 247 | \ |
248 | case VIDEO_PALETTE_RGB565: \ | 248 | case VIDEO_PALETTE_RGB565: \ |
249 | { \ | 249 | { \ |
250 | unsigned short tmp = *(unsigned short *)buf; \ | 250 | unsigned short tmp = *(unsigned short *)buf; \ |
251 | (r) = tmp&0xF800; \ | 251 | (r) = tmp&0xF800; \ |
252 | (g) = (tmp<<5)&0xFC00; \ | 252 | (g) = (tmp<<5)&0xFC00; \ |
253 | (b) = (tmp<<11)&0xF800; \ | 253 | (b) = (tmp<<11)&0xF800; \ |
254 | buf += 2; \ | 254 | buf += 2; \ |
255 | } \ | 255 | } \ |
256 | break; \ | 256 | break; \ |
257 | \ | 257 | \ |
258 | case VIDEO_PALETTE_RGB555: \ | 258 | case VIDEO_PALETTE_RGB555: \ |
259 | (r) = (buf[0]&0xF8)<<8; \ | 259 | (r) = (buf[0]&0xF8)<<8; \ |
260 | (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \ | 260 | (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8; \ |
261 | (b) = ((buf[1] << 2 ) & 0xF8)<<8; \ | 261 | (b) = ((buf[1] << 2 ) & 0xF8)<<8; \ |
262 | buf += 2; \ | 262 | buf += 2; \ |
263 | break; \ | 263 | break; \ |
264 | \ | 264 | \ |
265 | case VIDEO_PALETTE_RGB24: \ | 265 | case VIDEO_PALETTE_RGB24: \ |
266 | (r) = buf[0] << 8; (g) = buf[1] << 8; \ | 266 | (r) = buf[0] << 8; (g) = buf[1] << 8; \ |
267 | (b) = buf[2] << 8; \ | 267 | (b) = buf[2] << 8; \ |
268 | buf += 3; \ | 268 | buf += 3; \ |
269 | break; \ | 269 | break; \ |
270 | \ | 270 | \ |
271 | default: \ | 271 | default: \ |
272 | fprintf(stderr, \ | 272 | fprintf(stderr, \ |
273 | "Format %d not yet supported\n", \ | 273 | "Format %d not yet supported\n", \ |
274 | format); \ | 274 | format); \ |
275 | } \ | 275 | } \ |
276 | } | 276 | } |
277 | 277 | ||
278 | int get_brightness_adj(unsigned char *image, long size, int *brightness) { | 278 | int get_brightness_adj(unsigned char *image, long size, int *brightness) { |
279 | long i, tot = 0; | 279 | long i, tot = 0; |
@@ -324,40 +324,40 @@ int main(int argc, char ** argv) | |||
324 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | 324 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { |
325 | vpic.depth=6; | 325 | vpic.depth=6; |
326 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | 326 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { |
327 | vpic.depth=4; | 327 | vpic.depth=4; |
328 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | 328 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { |
329 | fprintf(stderr, "Unable to find a supported capture format.\n"); | 329 | fprintf(stderr, "Unable to find a supported capture format.\n"); |
330 | close(fd); | 330 | close(fd); |
331 | exit(1); | 331 | exit(1); |
332 | } | 332 | } |
333 | } | 333 | } |
334 | } | 334 | } |
335 | } else { | 335 | } else { |
336 | vpic.depth=24; | 336 | vpic.depth=24; |
337 | vpic.palette=VIDEO_PALETTE_RGB24; | 337 | vpic.palette=VIDEO_PALETTE_RGB24; |
338 | 338 | ||
339 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { | 339 | if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) { |
340 | vpic.palette=VIDEO_PALETTE_RGB565; | 340 | vpic.palette=VIDEO_PALETTE_RGB565; |
341 | vpic.depth=16; | 341 | vpic.depth=16; |
342 | 342 | ||
343 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | 343 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { |
344 | vpic.palette=VIDEO_PALETTE_RGB555; | 344 | vpic.palette=VIDEO_PALETTE_RGB555; |
345 | vpic.depth=15; | 345 | vpic.depth=15; |
346 | 346 | ||
347 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | 347 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { |
348 | fprintf(stderr, "Unable to find a supported capture format.\n"); | 348 | fprintf(stderr, "Unable to find a supported capture format.\n"); |
349 | return -1; | 349 | return -1; |
350 | } | 350 | } |
351 | } | 351 | } |
352 | } | 352 | } |
353 | } | 353 | } |
354 | 354 | ||
355 | buffer = malloc(win.width * win.height * bpp); | 355 | buffer = malloc(win.width * win.height * bpp); |
356 | if (!buffer) { | 356 | if (!buffer) { |
357 | fprintf(stderr, "Out of memory.\n"); | 357 | fprintf(stderr, "Out of memory.\n"); |
358 | exit(1); | 358 | exit(1); |
359 | } | 359 | } |
360 | 360 | ||
361 | do { | 361 | do { |
362 | int newbright; | 362 | int newbright; |
363 | read(fd, buffer, win.width * win.height * bpp); | 363 | read(fd, buffer, win.width * win.height * bpp); |
@@ -365,8 +365,8 @@ int main(int argc, char ** argv) | |||
365 | if (f) { | 365 | if (f) { |
366 | vpic.brightness += (newbright << 8); | 366 | vpic.brightness += (newbright << 8); |
367 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { | 367 | if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) { |
368 | perror("VIDIOSPICT"); | 368 | perror("VIDIOSPICT"); |
369 | break; | 369 | break; |
370 | } | 370 | } |
371 | } | 371 | } |
372 | } while (f); | 372 | } while (f); |
@@ -381,7 +381,7 @@ int main(int argc, char ** argv) | |||
381 | fputc(g>>8, stdout); | 381 | fputc(g>>8, stdout); |
382 | fputc(b>>8, stdout); | 382 | fputc(b>>8, stdout); |
383 | } | 383 | } |
384 | 384 | ||
385 | close(fd); | 385 | close(fd); |
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |