libv4lconvert: Use bytesperline instead of width
authorRobert Abel <abel@uni-bielefeld.de>
Sat, 25 Feb 2012 17:12:38 +0000 (18:12 +0100)
committerHans de Goede <hdegoede@redhat.com>
Mon, 9 Apr 2012 06:57:05 +0000 (08:57 +0200)
commitadf05a335f62de873997a81c8602016548b9e303
treec265db5ce75ded174d9d1741f817d526ec8e96dc
parent0f9030e1bf65895ebcee2300fbe1acffa4c9eafa
libv4lconvert: Use bytesperline instead of width

Basically, I found that libv4l and its conversion functions usually
choose to ignore v4l2_pix_format.bytesperline, which seems to work out
most of the time.

I'm currently working with the mt9v032 camera on a Gumstix Overo board.
The mt9v032's driver pads output lines to 768 pixels, giving 0x900 bytes
per line. All code in bayer.c (the camera uses raw bayer pattern) is
written to assume bytesperline = width and thus everything goes horribly
wrong.

Anyway, the patch for bayer => rgb as well as bayer => yuv is attached.
Basically, every time where width was assumed to be the offset to the
neighboring pixel below, now step is used.

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
lib/libv4lconvert/bayer.c
lib/libv4lconvert/libv4lconvert-priv.h
lib/libv4lconvert/libv4lconvert.c