From aa3b895fc0f85de57a4731cee25f28ac5961ac52 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 1 Dec 2006 18:10:54 -0200 Subject: Fix driver_test for a non-compliance on bttv driver From: Mauro Carvalho Chehab bttv driver presents a non-compliance: When S_FMT is called, pix.sizeimage reports a different size than when QUERYBUF is called, for the same S_FMT. The current code can work fine with this non-compliance, but an error should be reported. Those are the reports from bttv driver, by running driver-test: FMT SET: 640x480, fourcc=YVU9, 640 bytes/line, 345600 bytes/frame, colorspace=0x00000000 QUERYBUF: 00:00:00.00000000 index=0, type=video-cap, bytesused=0, flags=0x00000000, field=any, sequence=0, memory=mmap, offset=0x00000000, length=348160 TIMECODE: 00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000 QUERYBUF: ERROR: VIDIOC_S_FMT said buffer should have 345600 size, but received 348160 from QUERYBUF! Signed-off-by: Mauro Carvalho Chehab --- v4l2-apps/lib/v4l2_driver.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'v4l2-apps') diff --git a/v4l2-apps/lib/v4l2_driver.c b/v4l2-apps/lib/v4l2_driver.c index 7d6b549a2..b57d0b02e 100644 --- a/v4l2-apps/lib/v4l2_driver.c +++ b/v4l2-apps/lib/v4l2_driver.c @@ -619,13 +619,8 @@ int v4l2_mmap_bufs(struct v4l2_driver *drv, unsigned int num_buffers) if (drv->sizeimage != p->length) { if (drv->sizeimage < p->length) { - fprintf (stderr, "QUERYBUF: Expecting %d size, received %d buff length (LESS THAN ALLOCATED!)\n", + fprintf (stderr, "QUERYBUF: ERROR: VIDIOC_S_FMT said buffer should have %d size, but received %d from QUERYBUF!\n", drv->sizeimage, p->length); - - free (drv->v4l2_bufs[drv->n_bufs]); - v4l2_free_bufs(drv); - - return -1; } else { fprintf (stderr, "QUERYBUF: Expecting %d size, received %d buff length\n", drv->sizeimage, p->length); @@ -699,7 +694,7 @@ int v4l2_rcvbuf(struct v4l2_driver *drv, v4l2_recebe_buffer *rec_buf) int v4l2_start_streaming(struct v4l2_driver *drv) { uint32_t i; - struct v4l2_buffer buf; + struct v4l2_buffer buf; if (drv->debug) printf("Activating %d queues\n", drv->n_bufs); -- cgit v1.2.3