testing v4l2 pretty struct pointer

This commit is contained in:
phyto 2019-07-02 22:23:12 +02:00
parent dc7734b49d
commit 22a014b676
1 changed files with 9 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#include <unistd.h>
#include <math.h>
#include <string.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
@ -40,6 +41,13 @@ fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
pr_v4l2_format("before ioctl", &fmt);
foo = ioctl(vfd, VIDIOC_S_FMT, &fmt);
fprintf(stderr, "ioctl -> %d\n", foo);
if (foo < 0)) perror("ioctl S_FMT");
pr_v4l2_format("after ioctl", &fmt);
/* todo V4L2_BUF_TYPE_VIDEO_CAPTURE */
return k;
}