From e00423ed9b79f37aab89447c83843a624bfc4220 Mon Sep 17 00:00:00 2001 From: tTh Date: Mon, 13 Feb 2023 14:27:01 +0100 Subject: [PATCH] cosmetic --- v4l2/funcs.c | 2 +- v4l2/grabvidseq.c | 2 +- v4l2/t.c | 6 ++++-- v4l2/v4l2_pr_structs.c | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/v4l2/funcs.c b/v4l2/funcs.c index 9fe97e6..cb36cd7 100644 --- a/v4l2/funcs.c +++ b/v4l2/funcs.c @@ -78,7 +78,7 @@ if (-1 == stat(device, &st)) { } 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); } diff --git a/v4l2/grabvidseq.c b/v4l2/grabvidseq.c index d23a042..2a23c9b 100644 --- a/v4l2/grabvidseq.c +++ b/v4l2/grabvidseq.c @@ -267,7 +267,7 @@ type = V4L2_BUF_TYPE_VIDEO_CAPTURE; xioctl(fd, VIDIOC_STREAMON, &type); #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); #endif diff --git a/v4l2/t.c b/v4l2/t.c index ccb6349..8582e3f 100644 --- a/v4l2/t.c +++ b/v4l2/t.c @@ -26,7 +26,9 @@ int vfd, foo; struct v4l2_format fmt; // struct v4l2_requestbuffers reqbuf; +#if DEBUG_LEVEL fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k); +#endif vfd = open_device(dev); 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)); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 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) { perror("ioctl G_FMT"); return -1; @@ -82,7 +84,7 @@ while ((opt = getopt(argc, argv, "d:hK:v")) != -1) { if (verbosity) fimg_print_version(0); 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; } diff --git a/v4l2/v4l2_pr_structs.c b/v4l2/v4l2_pr_structs.c index b09db47..5969cc5 100644 --- a/v4l2/v4l2_pr_structs.c +++ b/v4l2/v4l2_pr_structs.c @@ -218,7 +218,7 @@ return "???"; /* --------------------------------------------------------------------- */ 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 */ fmttype2str(ptr->type));