This commit is contained in:
tTh 2023-02-13 14:27:01 +01:00
parent 3e66e822f2
commit e00423ed9b
4 changed files with 7 additions and 5 deletions

View File

@ -78,7 +78,7 @@ if (-1 == stat(device, &st)) {
} }
if (!S_ISCHR(st.st_mode)) { if (!S_ISCHR(st.st_mode)) {
fprintf(stderr, "%s is no device\n", device); fprintf(stderr, "%s is not a char device\n", device);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@ -267,7 +267,7 @@ type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
xioctl(fd, VIDIOC_STREAMON, &type); xioctl(fd, VIDIOC_STREAMON, &type);
#if 1 #if 1
if (verbosity) fprintf(stderr,"pid %d is going to grab %d picz...\n", if (verbosity) fprintf(stderr,"pid %d is going to grab %d frames...\n",
getpid(), nbre_capt); getpid(), nbre_capt);
#endif #endif

View File

@ -26,7 +26,9 @@ int vfd, foo;
struct v4l2_format fmt; struct v4l2_format fmt;
// struct v4l2_requestbuffers reqbuf; // struct v4l2_requestbuffers reqbuf;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k); fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k);
#endif
vfd = open_device(dev); vfd = open_device(dev);
if (verbosity) fprintf(stderr, "\topen %s -> %d\n", dev, vfd); if (verbosity) fprintf(stderr, "\topen %s -> %d\n", dev, vfd);
@ -34,7 +36,7 @@ if (verbosity) fprintf(stderr, "\topen %s -> %d\n", dev, vfd);
memset(&fmt, 0, sizeof(fmt)); memset(&fmt, 0, sizeof(fmt));
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
foo = ioctl(vfd, VIDIOC_G_FMT, &fmt); foo = ioctl(vfd, VIDIOC_G_FMT, &fmt);
fprintf(stderr, "%s : ioctl -> %d\n", __func__, foo); if (verbosity) fprintf(stderr, "%s: ioctl -> %d\n", __func__, foo);
if (0 != foo) { if (0 != foo) {
perror("ioctl G_FMT"); perror("ioctl G_FMT");
return -1; return -1;
@ -82,7 +84,7 @@ while ((opt = getopt(argc, argv, "d:hK:v")) != -1) {
if (verbosity) fimg_print_version(0); if (verbosity) fimg_print_version(0);
foo = essai_get_fmt(device, K); foo = essai_get_fmt(device, K);
fprintf(stderr, "\tessai -> %d\n", foo); if (verbosity || foo) fprintf(stderr, "%s: essai -> %d\n", __func__, foo);
return 0; return 0;
} }

View File

@ -218,7 +218,7 @@ return "???";
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
int pr_v4l2_format(char *txt, struct v4l2_format *ptr) int pr_v4l2_format(char *txt, struct v4l2_format *ptr)
{ {
fprintf(FP, "## v4l2_format, %-15s %p\n", txt, ptr); fprintf(FP, "## v4l2_format, %-15s, %p\n", txt, ptr);
fprintf(FP, " type %d %s\n", ptr->type,/* enum v4l2_buf_type */ fprintf(FP, " type %d %s\n", ptr->type,/* enum v4l2_buf_type */
fmttype2str(ptr->type)); fmttype2str(ptr->type));