summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yavta.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/yavta.c b/yavta.c
index 4c0d97b..3d42915 100644
--- a/yavta.c
+++ b/yavta.c
@@ -42,6 +42,7 @@ struct device
enum v4l2_memory memtype;
unsigned int nbufs;
unsigned int bufsize;
+ unsigned int imagesize;
void **mem;
};
@@ -186,6 +187,8 @@ static int video_get_format(struct device *dev)
return ret;
}
+ dev->imagesize = fmt.fmt.pix.bytesperline ? fmt.fmt.pix.sizeimage : 0;
+
printf("Video format: %c%c%c%c (%08x) %ux%u\n",
(fmt.fmt.pix.pixelformat >> 0) & 0xff,
(fmt.fmt.pix.pixelformat >> 8) & 0xff,
@@ -765,6 +768,11 @@ static int video_do_capture(struct device *dev, unsigned int nframes,
buf.m.userptr = (unsigned long)dev->mem[i];
}
+ if (dev->type == V4L2_BUF_TYPE_VIDEO_CAPTURE &&
+ dev->imagesize != 0 && buf.bytesused != dev->imagesize)
+ printf("Warning: bytes used %u != image size %u\n",
+ buf.bytesused, dev->imagesize);
+
size += buf.bytesused;
gettimeofday(&ts, NULL);