aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-02-02 22:26:06 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-02-02 22:26:06 -0500
commit9e6235e997bf091326b2f3ac92217c2ac2e27eb5 (patch)
treed6f754ba270f53edb87ccdd90571b52a913c6e27 /Documentation
parent5c350d93ff4736086a1b08fef1d0b5e22138d2e0 (diff)
parent67e70baf043cfdcdaf5972bc94be82632071536b (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (45 commits) V4L/DVB (10411): s5h1409: Perform s5h1409 soft reset after tuning V4L/DVB (10403): saa7134-alsa: saa7130 doesn't support digital audio V4L/DVB (10229): ivtv: fix memory leak V4L/DVB (10385): gspca - main: Fix memory leak when USB disconnection while streaming. V4L/DVB (10325): em28xx: Fix for fail to submit URB with IRQs and Pre-emption Disabled V4L/DVB (10317): radio-mr800: fix radio->muted and radio->stereo V4L/DVB (10314): cx25840: ignore TUNER_SET_CONFIG in the command callback. V4L/DVB (10288): af9015: bug fix: stick does not work always when plugged V4L/DVB (10287): af9015: fix second FE V4L/DVB (10270): saa7146: fix unbalanced mutex_lock/unlock V4L/DVB (10265): budget.c driver: Kernel oops: "BUG: unable to handle kernel paging request at ffffffff V4L/DVB (10261): em28xx: fix kernel panic on audio shutdown V4L/DVB (10257): em28xx: Fix for KWorld 330U Board V4L/DVB (10256): em28xx: Fix for KWorld 330U AC97 V4L/DVB (10254): em28xx: Fix audio URB transfer buffer race condition V4L/DVB (10250): cx25840: fix regression: fw not loaded on first use V4L/DVB (10248): v4l-dvb: fix a bunch of compile warnings. V4L/DVB (10243): em28xx: fix compile warning V4L/DVB (10240): Fix obvious swapped names in v4l2_subdev logic V4L/DVB (10233): [PATCH] Terratec Cinergy DT XS Diversity new USB ID (0ccd:0081) ...
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/video4linux/v4lgrab.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/Documentation/video4linux/v4lgrab.c b/Documentation/video4linux/v4lgrab.c
index 079b628481cf..d6e70bef8ad0 100644
--- a/Documentation/video4linux/v4lgrab.c
+++ b/Documentation/video4linux/v4lgrab.c
@@ -4,12 +4,21 @@
4 * 4 *
5 * Compile with: 5 * Compile with:
6 * gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab 6 * gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
7 * Use as: 7 * Use as:
8 * v4lgrab >image.ppm 8 * v4lgrab >image.ppm
9 * 9 *
10 * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org> 10 * Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org>
11 * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c 11 * Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
12 * with minor modifications (Dave Forrest, drf5n@virginia.edu). 12 * with minor modifications (Dave Forrest, drf5n@virginia.edu).
13 *
14 *
15 * For some cameras you may need to pre-load libv4l to perform
16 * the necessary decompression, e.g.:
17 *
18 * export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
19 * ./v4lgrab >image.ppm
20 *
21 * see http://hansdegoede.livejournal.com/3636.html for details.
13 * 22 *
14 */ 23 */
15 24
@@ -24,7 +33,7 @@
24#include <linux/types.h> 33#include <linux/types.h>
25#include <linux/videodev.h> 34#include <linux/videodev.h>
26 35
27#define FILE "/dev/video0" 36#define VIDEO_DEV "/dev/video0"
28 37
29/* Stole this from tvset.c */ 38/* Stole this from tvset.c */
30 39
@@ -90,7 +99,7 @@ int get_brightness_adj(unsigned char *image, long size, int *brightness) {
90 99
91int main(int argc, char ** argv) 100int main(int argc, char ** argv)
92{ 101{
93 int fd = open(FILE, O_RDONLY), f; 102 int fd = open(VIDEO_DEV, O_RDONLY), f;
94 struct video_capability cap; 103 struct video_capability cap;
95 struct video_window win; 104 struct video_window win;
96 struct video_picture vpic; 105 struct video_picture vpic;
@@ -100,13 +109,13 @@ int main(int argc, char ** argv)
100 unsigned int i, src_depth; 109 unsigned int i, src_depth;
101 110
102 if (fd < 0) { 111 if (fd < 0) {
103 perror(FILE); 112 perror(VIDEO_DEV);
104 exit(1); 113 exit(1);
105 } 114 }
106 115
107 if (ioctl(fd, VIDIOCGCAP, &cap) < 0) { 116 if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
108 perror("VIDIOGCAP"); 117 perror("VIDIOGCAP");
109 fprintf(stderr, "(" FILE " not a video4linux device?)\n"); 118 fprintf(stderr, "(" VIDEO_DEV " not a video4linux device?)\n");
110 close(fd); 119 close(fd);
111 exit(1); 120 exit(1);
112 } 121 }