preparation du moteur de brotchage

This commit is contained in:
Tonton Th 2019-05-27 14:47:32 +02:00
parent 6527f5d398
commit 2a40718410
3 changed files with 8 additions and 3 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@ essai
v4l2/t v4l2/t
v4l2/capture v4l2/capture
v4l2/v4l2grab
v4l2/*.o v4l2/*.o
v4l2/*.ppm v4l2/*.ppm

View File

@ -13,5 +13,9 @@ t: t.c Makefile ${DEPS} funcs.o
# external things # external things
capture: capture.c Makefile capture: capture.c Makefile
gcc -Wall $< -o $@ gcc -Wall -g $< -o $@
v4l2grab: v4l2grab.c Makefile
gcc -Wall -g $< -lv4l2 -o $@

View File

@ -139,7 +139,7 @@
xioctl(fd, VIDIOC_DQBUF, &buf); xioctl(fd, VIDIOC_DQBUF, &buf);
sprintf(out_name, "out%03d.ppm", i); sprintf(out_name, "out%03d.ppm", i);
fprintf(stderr, "-- %s\n", out_name); fprintf(stderr, "--> %s\n", out_name);
fout = fopen(out_name, "w"); fout = fopen(out_name, "w");
if (!fout) { if (!fout) {
perror("Cannot open image"); perror("Cannot open image");
@ -149,7 +149,7 @@
fmt.fmt.pix.width, fmt.fmt.pix.height); fmt.fmt.pix.width, fmt.fmt.pix.height);
fwrite(buffers[buf.index].start, buf.bytesused, 1, fout); fwrite(buffers[buf.index].start, buf.bytesused, 1, fout);
fclose(fout); fclose(fout);
sleep(190); sleep(666);
xioctl(fd, VIDIOC_QBUF, &buf); xioctl(fd, VIDIOC_QBUF, &buf);
} }