enum_image_framesizes not working

This commit is contained in:
tth 2019-08-31 19:46:37 +02:00
parent 144498d68e
commit 7abdf7b43e
1 changed files with 34 additions and 1 deletions

View File

@ -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;
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);
foo = enum_extended_controls(vfd, "looking for extended", 0);
enum_image_framesizes(vfd, "code pas fini", 0);
close(vfd);