Browse Source

enum_image_framesizes not working

master
tth 3 years ago
parent
commit
7abdf7b43e
  1. 35
      v4l2/video-infos.c

35
v4l2/video-infos.c

@ -19,6 +19,38 @@ @@ -19,6 +19,38 @@
int verbosity;
/* --------------------------------------------------------------------- */
/*
* this code was written from a strace output :)
*/
int enum_image_framesizes(int fd, char *txt, int k)
{
int foo, idx;
struct v4l2_frmsizeenum fmtsz;
printf("-- image framesizes enumeration (%s)\n", txt);
for (idx=0; ; idx++) {
memset(&fmtsz, 0, sizeof(fmtsz));
fmtsz.index = idx;
foo = ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &fmtsz);
if (foo) {
if (EINVAL==errno) {
break;
}
else {
perror(__func__);
break;
}
}
printf("%4d %4d %4d\n", idx, fmtsz.pixel_format, fmtsz.type);
}
return 0;
}
/* --------------------------------------------------------------------- */
int enum_image_formats(int fd, char *txt, int k)
{
@ -61,7 +93,7 @@ int index, foo; @@ -61,7 +93,7 @@ int index, foo;
struct v4l2_input input;
char ligne[50];
printf("-- inputs enumeration '%s'\n", txt);
printf("-- inputs enumeration (%s)\n", txt);
index = 0;
for(;;) {
@ -219,6 +251,7 @@ foo = enum_controls(vfd, "is that working ?", 0); @@ -219,6 +251,7 @@ foo = enum_controls(vfd, "is that working ?", 0);
foo = enum_extended_controls(vfd, "looking for extended", 0);
enum_image_framesizes(vfd, "code pas fini", 0);
close(vfd);

Loading…
Cancel
Save