diff --git a/.gitignore b/.gitignore index 85501fc..ac00857 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ essai v4l2/t v4l2/capture +v4l2/v4l2grab v4l2/*.o v4l2/*.ppm diff --git a/v4l2/Makefile b/v4l2/Makefile index 916636a..6d9f032 100644 --- a/v4l2/Makefile +++ b/v4l2/Makefile @@ -13,5 +13,9 @@ t: t.c Makefile ${DEPS} funcs.o # external things capture: capture.c Makefile - gcc -Wall $< -o $@ + gcc -Wall -g $< -o $@ + +v4l2grab: v4l2grab.c Makefile + gcc -Wall -g $< -lv4l2 -o $@ + diff --git a/v4l2/v4l2grab.c b/v4l2/v4l2grab.c index d512702..9796144 100644 --- a/v4l2/v4l2grab.c +++ b/v4l2/v4l2grab.c @@ -139,7 +139,7 @@ xioctl(fd, VIDIOC_DQBUF, &buf); sprintf(out_name, "out%03d.ppm", i); - fprintf(stderr, "-- %s\n", out_name); + fprintf(stderr, "--> %s\n", out_name); fout = fopen(out_name, "w"); if (!fout) { perror("Cannot open image"); @@ -149,7 +149,7 @@ fmt.fmt.pix.width, fmt.fmt.pix.height); fwrite(buffers[buf.index].start, buf.bytesused, 1, fout); fclose(fout); - sleep(190); + sleep(666); xioctl(fd, VIDIOC_QBUF, &buf); }