8 years agoDo not divide by zero.
Sakari Ailus [Fri, 6 Aug 2010 13:03:35 +0000 (16:03 +0300)]
Do not divide by zero.

If only one buffer was processed the performance measurement calculation
caused a division by zero. Do not do show measurements if they are bad.

Signed-off-by: Sakari Ailus <>
8 years agoBasic test pattern support for video output devices
Laurent Pinchart [Fri, 6 Aug 2010 13:10:37 +0000 (15:10 +0200)]
Basic test pattern support for video output devices

Instead of filling video output buffers with 0s, generate and user a
test pattern.

If the -F argument is given, the test pattern is read from the specified
file. The file size must be at equal to or bigger than the image size.

If the -F argument is not given, a basic test pattern is generated
automatically. Every byte is set to the sum of its X and Y coordinates.

Signed-off-by: Laurent Pinchart <>
8 years agoOptimise for safer free() usage.
Sakari Ailus [Sun, 1 Aug 2010 11:08:04 +0000 (14:08 +0300)]
Optimise for safer free() usage.

Signed-off-by: Sakari Ailus <>
8 years agoMake -c and -F options accept an optional argument
Laurent Pinchart [Fri, 30 Jul 2010 13:21:32 +0000 (15:21 +0200)]
Make -c and -F options accept an optional argument

The long --capture and --file options have an optional argument, fix the
short versions.

Signed-off-by: Laurent Pinchart <>
8 years agoDo accept CFLAGS and LDFLAGS from environment.
Sakari Ailus [Thu, 29 Jul 2010 15:01:10 +0000 (18:01 +0300)]
Do accept CFLAGS and LDFLAGS from environment.

Signed-off-by: Sakari Ailus <>
8 years agoAdd support for the V4L2_PIX_FMT_Y16 format
Laurent Pinchart [Thu, 22 Jul 2010 20:09:28 +0000 (22:09 +0200)]
Add support for the V4L2_PIX_FMT_Y16 format

Signed-off-by: Laurent Pinchart <>
8 years agoAdd --offset option to select userspace buffer alignment
Laurent Pinchart [Wed, 23 Jun 2010 07:30:41 +0000 (09:30 +0200)]
Add --offset option to select userspace buffer alignment

For driver testing purpose the --offset option can be used to modify the
userspace buffers alignment. Instead of a fixed page-boundary alignment,
buffers can now be aligned to a fixed offset starting to the beginning
of the page.

Signed-off-by: Laurent Pinchart <>
8 years agoSet the v4l2_buffer::length field when queueing a buffer
Laurent Pinchart [Wed, 2 Jun 2010 12:21:31 +0000 (14:21 +0200)]
Set the v4l2_buffer::length field when queueing a buffer

Userspace buffers size needs to be passed to drivers on VIDIOC_QBUF. Set
the v4l2_buffer::length field to the size of the allocated buffer before
calling VIDIOC_QBUF.

Signed-off-by: Laurent Pinchart <>
8 years agoAlign userspace buffers to a page size boundary
Laurent Pinchart [Wed, 2 Jun 2010 12:18:29 +0000 (14:18 +0200)]
Align userspace buffers to a page size boundary

Some devices need userspace buffers to be page-aligned. Use the
posix_memalign function instead of malloc to allocate page-aligned

Signed-off-by: Laurent Pinchart <>
8 years agoWarn when v4l2_buffer::bytesused has an unexpected value
Laurent Pinchart [Fri, 21 May 2010 13:17:31 +0000 (15:17 +0200)]
Warn when v4l2_buffer::bytesused has an unexpected value

For uncompressed formats in capture devices, the v4l2_buffer::bytesused
field should have the same value as the v4l2_pix_format::sizeimage field
reported by the VIDIOC_G_FMT ioctl.

Print a warning on VIDIOC_DQBUG when the values don't match.

Signed-off-by: Laurent Pinchart <>
8 years agoInitial import
Laurent Pinchart [Wed, 19 May 2010 09:59:00 +0000 (11:59 +0200)]
Initial import

Signed-off-by: Laurent Pinchart <>