qv4l2: zero m_tpgLimRGBRange when the device is closed

The m_tpgLimRGBRange pointer was non-NULL when it shouldn't
be. Set it to NULL when the device is closed, that's the correct
place since after that it is invalid until a new device is opened.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: use "ADC Frequency" for SDR instead of just "Frequency"

This makes it more obvious what is going on.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: fix valgrind warnings

Mostly uninitialized fields, but there was also one inverted get_interval result
check.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
libv4l2: valgrind fixes

Initialize reserved fields and a v4l2_format struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: Removed bottom layout from capturewin

The information shown can be seen in the status bar
of the main window. The eventfilter that shows the bottom
layout can also be percieved as annoying.

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: keep the "Controls" text

Don't chop off the "Controls" text in the tab name: it turns out that
leaving that off makes it hard to tell the difference between tabs
that are setup by qv4l2 and tabs that contain controls from the driver.

If someone can come up with a better way of doing this then that would
be welcome, but for now this is the best I can come up with.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-ctl/qv4l2: sync to latest vivid-tpg.c

Main change: the 16x9 widescreen vertical lines for PAL/NTSC have been
corrected.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: correct PAL pixel aspect values

There are two almost-identical-but-not-quite possible pixel aspect
ratios in use for PAL: either 59:54 or 12:11. Since all our drivers
report 59:54 this is the one we should use in qv4l2 as well.

See also http://en.wikipedia.org/wiki/Pixel_aspect_ratio for more
information on why there are two competing pixel aspect ratios.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: Adding width and height scaling to the status bar

Signed-off-by: Anton Arbring <aarbring@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-compliance: add test for S_EDID and the E2BIG corner case

If you try to write a larger EDID than the driver/hardware can handle,
the driver should return E2BIG and edid.blocks should be set to the
maximum number of blocks allowed.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2/v4l2-ctl: add support for 14x9 video aspect ratio.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-compliance: allow EIO for control ioctls

The uvc driver has to pass on the new control values to the hardware,
and that may not always accept the new value, even though it was
reported as within the valid range. In that case EIO is returned
and v4l2-compliance should accept that as a valid error code. It's
not the uvc driver's fault that there are many devices with crappy
firmware.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: refactored cropSize to deliver cropped size

cropFrameSize returned the delta between the full frame and the cropped frame
instead of just returning the cropped frame. This made the code hard to read,
so switch to returning the cropped frame.

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: Fixed cropping bug

Pillar/letterboxing was assumed given by m_cropMethod, but is also depending on
pixelAspectRatio and frame aspect ratio

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: Add option to enable linear scaling filter

New menu option to enable linear scaling filter when using OpenGL. Default is to
use nearest neighbour

Signed-off-by: Ove Brynestad <ovebryne@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-compliance: reset control counters

The controls are checked for every input, but the counters that count
the number of standard and private controls are not reset to 0 before
doing the check for the current input. This gave wrong control counts.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>