This commit is contained in:
tth 2019-08-30 14:46:08 +02:00
parent 5c17358a37
commit 4417575163
1 changed files with 6 additions and 3 deletions

View File

@ -36,6 +36,9 @@
#define SAVE_AS_PNM 0 #define SAVE_AS_PNM 0
#define SAVE_AS_FIMG 0 #define SAVE_AS_FIMG 0
#define WIDTH 1920
#define HEIGHT 1080
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
#define CLEAR(x) memset(&(x), 0, sizeof(x)) #define CLEAR(x) memset(&(x), 0, sizeof(x))
@ -132,8 +135,8 @@ if (fd < 0) {
CLEAR(fmt); CLEAR(fmt);
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
fmt.fmt.pix.width = 640; fmt.fmt.pix.width = WIDTH;
fmt.fmt.pix.height = 480; fmt.fmt.pix.height = HEIGHT;
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;
fmt.fmt.pix.field = V4L2_FIELD_INTERLACED; fmt.fmt.pix.field = V4L2_FIELD_INTERLACED;
xioctl(fd, VIDIOC_S_FMT, &fmt); xioctl(fd, VIDIOC_S_FMT, &fmt);
@ -141,7 +144,7 @@ if (fmt.fmt.pix.pixelformat != V4L2_PIX_FMT_RGB24) {
printf("Libv4l didn't accept RGB24 format. Can't proceed.\n"); printf("Libv4l didn't accept RGB24 format. Can't proceed.\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if ((fmt.fmt.pix.width != 640) || (fmt.fmt.pix.height != 480)) { if ((fmt.fmt.pix.width != WIDTH) || (fmt.fmt.pix.height != HEIGHT)) {
printf("Warning: driver is sending image at %dx%d\n", printf("Warning: driver is sending image at %dx%d\n",
fmt.fmt.pix.width, fmt.fmt.pix.height); fmt.fmt.pix.width, fmt.fmt.pix.height);
} }