Skip to content

Commit

Permalink
quote FOURCC-codes to show the space
Browse files Browse the repository at this point in the history
also print the hex-representation.
and align the table.

Closes: #510
  • Loading branch information
umlaeute committed Nov 9, 2022
1 parent 76434ab commit 8902b3f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions utils/v4l2loopback-ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,18 @@ static void help_setcaps(const char *program, int brief, int argc, char **argv)
"\n");
if (!argc) {
dprintf(2, "\nknown fourcc-codes"
"\n------------------"
"\n=================="
"\nFOURCC\thex \tdec \tdescription"
"\n------\t----------\t------------\t-----------"
"\n");
char fourcc[5];
const size_t num_formats = sizeof(formats) / sizeof(*formats);
size_t i = 0;
for (i = 0; i < num_formats; i++) {
const struct v4l2l_format *fmt = formats + i;
memset(fourcc, 0, 5);
dprintf(2, "%4s\t%d\t%s\n",
fourcc2str(fmt->fourcc, fourcc), fmt->fourcc,
dprintf(2, "'%4s'\t0x%08X\t%12d\t%s\n",
fourcc2str(fmt->fourcc, fourcc), fmt->fourcc, fmt->fourcc,
fmt->name);
}
}
Expand Down

0 comments on commit 8902b3f

Please sign in to comment.