display all inputs

This commit is contained in:
tth 2019-07-30 14:56:35 +02:00
parent a47730d09d
commit b23ebec4a5

View File

@ -59,6 +59,7 @@ static int enum_inputs(int fd, char *txt, int k)
{ {
int index, foo; int index, foo;
struct v4l2_input input; struct v4l2_input input;
char ligne[50];
printf("-- inputs enumeration '%s'\n", txt); printf("-- inputs enumeration '%s'\n", txt);
@ -75,8 +76,14 @@ for(;;) {
} }
} }
if (verbosity) {
sprintf(ligne, "input %d", index);
pr_v4l2_input(ligne, &input);
}
else {
printf("%-32s | %-10s\n", input.name, printf("%-32s | %-10s\n", input.name,
str_input_type(input.type)); str_input_type(input.type));
}
index++; index++;
} }
@ -191,6 +198,9 @@ if (foo < 0) {
} }
pr_v4l2_capability(devname, &cap); pr_v4l2_capability(devname, &cap);
foo = enum_inputs(vfd, "on peut voir quoi ?", 0);
/***
memset(&input, 0, sizeof(input)); memset(&input, 0, sizeof(input));
input.index = 1; input.index = 1;
if (-1 == ioctl(vfd, VIDIOC_ENUMINPUT, &input)) { if (-1 == ioctl(vfd, VIDIOC_ENUMINPUT, &input)) {
@ -199,8 +209,7 @@ if (-1 == ioctl(vfd, VIDIOC_ENUMINPUT, &input)) {
} }
sprintf(ligne, "input %d", input.index); sprintf(ligne, "input %d", input.index);
pr_v4l2_input(ligne, &input); pr_v4l2_input(ligne, &input);
***/
foo = enum_inputs(vfd, "on peut voir quoi ?", 0);
foo = enum_image_formats(vfd, "Experimental", 0); foo = enum_image_formats(vfd, "Experimental", 0);