forked from tTh/FloatImg
aller chercher de la biere et des patates
This commit is contained in:
parent
bfc600f5a0
commit
6527f5d398
1
.gitignore
vendored
1
.gitignore
vendored
@ -14,6 +14,7 @@ essai
|
||||
v4l2/t
|
||||
v4l2/capture
|
||||
v4l2/*.o
|
||||
v4l2/*.ppm
|
||||
|
||||
tools/fimg2png
|
||||
tools/fimg2pnm
|
||||
|
5
v4l2/README.txt
Normal file
5
v4l2/README.txt
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
capture video
|
||||
-------------
|
||||
|
||||
|
@ -117,7 +117,7 @@
|
||||
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
|
||||
xioctl(fd, VIDIOC_STREAMON, &type);
|
||||
for (i = 0; i < 20; i++) {
|
||||
for (i = 0; i < 10; i++) {
|
||||
do {
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(fd, &fds);
|
||||
@ -139,6 +139,7 @@
|
||||
xioctl(fd, VIDIOC_DQBUF, &buf);
|
||||
|
||||
sprintf(out_name, "out%03d.ppm", i);
|
||||
fprintf(stderr, "-- %s\n", out_name);
|
||||
fout = fopen(out_name, "w");
|
||||
if (!fout) {
|
||||
perror("Cannot open image");
|
||||
@ -148,7 +149,7 @@
|
||||
fmt.fmt.pix.width, fmt.fmt.pix.height);
|
||||
fwrite(buffers[buf.index].start, buf.bytesused, 1, fout);
|
||||
fclose(fout);
|
||||
sleep(30);
|
||||
sleep(190);
|
||||
|
||||
xioctl(fd, VIDIOC_QBUF, &buf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user