video-infos : more informations displayed

This commit is contained in:
2019-07-22 04:10:00 +02:00
parent 991308f5b2
commit 4e687db723
3 changed files with 97 additions and 12 deletions

View File

@@ -18,13 +18,22 @@
int verbosity;
/* --------------------------------------------------------------------- */
static int enum_input(char *txt, int k)
{
return -1;
}
/* --------------------------------------------------------------------- */
int show_webcam_infos(char *devname, int k)
{
int vfd, foo;
struct v4l2_capability cap;
struct v4l2_format fmt;
// struct v4l2_format fmt;
struct v4l2_input input;
// int index;
// struct v4l2_requestbuffers reqbuf;
@@ -40,15 +49,21 @@ if (vfd < 0) {
fprintf(stderr, "\topen %s -> %d\n", devname, vfd);
memset(&cap, 0, sizeof(cap));
foo = ioctl(vfd, VIDIOC_QUERYCAP, &cap);
if (foo < 0) {
perror("ioctl QUERYCAP");
return -4;
}
pr_v4l2_capability(devname, &cap);
if ( ! (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
fprintf("%s : no video capture\n", devname);
memset(&input, 0, sizeof(input));
if (-1 == ioctl(vfd, VIDIOC_ENUMINPUT, &input)) {
perror("VIDIOC_ENUMINPUT");
exit(EXIT_FAILURE);
}
pr_v4l2_input("input 0", &input);
close(vfd);
@@ -95,7 +110,7 @@ while ((opt = getopt(argc, argv, "d:hK:lv")) != -1) {
if (verbosity) fimg_print_version(0);
foo = show_webcam_infos(device, K);
fprintf(stderr, "\tshow_webcam_infos -> %d\n", foo);
fprintf(stderr, "\n\tshow_webcam_infos -> %d\n", foo);
return 0;
}