v4l2-ctl: properly close filehandles on error

The capture and output filehandles weren't closed explicitly if an
error occurs.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l-utils: sync with latest kernel.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-ctl: set b.num_planes to 1 for single plane output formats.

For normal non-multiplanar output formats b.num_planes was never set to 1,
so fill_buffer_from_file() wouldn't actually read any data from a file, since
b.num_planes was uninitialized (usually 0).

The same situation for capture formats was handled correctly, it was only the
output that failed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: Add cropping option to remove pillarbox

Signed-off-by: Baard Eirik Winther <baard.e.winther@wintherstormer.no>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: crop: take pixel aspect ratio into account.

When cropping to a desired letterboxed/pillarboxed picture ratio you
need to take the pixel aspect ratio into account as well.

Also use 4.0/3.0 instead of 1.33 due to rounding errors (ditto for 1.57
and 1.78).

Finally the pillarbox ratio was calculated the wrong way around.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
buildsystem: use subdir-objects automake option as suggested by automake

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
buildsystem: Do not specify library version for static libs

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
buildsystem: Use autoconf variable for symbol visibility flag

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
buildsystem: Use C99 by default

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>