qv4l2: two field related fixes

Update the field combobox when changing inputs.

Don't clear the field combobox unless at least one valid field could
be found. This to prevent the combobox from clearing when trying to
change it while streaming is in progress.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: support top/bottom/alternate field settings.

Compensate for the half-height by changing the pixel aspect ratio. This
ensures that they are still shown at the right picture aspect ratio.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: add check if the shader function is available.

Skip formats that need a shader if there isn't any. Particularly useful
when running qv4l2 over ssh.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-compliance: check for presence of a tuner/modulator

If an input needs a tuner or an output needs a modulator, then test
that at least one tuner or modulator was found.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-compliance: improve format matching code.

Do a precise match based on the format type and print the values for
v4l2_pix_format if they are different.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: initialize comboboxes with sensible initial sizes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: QUERYSTD returns STD_UNKNOWN if there is no standard

Replace STD_ALL by STD_UNKNOWN in the qv4l2 checked for whether there is a
signal or not.

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

Several bugs: the frequency validation wasn't done correctly allowing
out-of-range frequencies to be set, and the frequencies tables were
never shown due to a wrong condition.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: disable what shouldn't be touched while streaming.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-compliance: add tests for queuing operations with invalid indices.

Check what happens when queuing/preparing an already queued/prepared buffer,
or if the buffer index is out of range.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
v4l2-compliance: more nasty evil stream I/O checks

After queuing buffers, then calling STREAMOFF without having called STREAMON
we should be able to queue those buffers again.

After queuing buffers, then calling REQBUFS without having called STREAMON
all the old buffers should be freed correctly: good check for making sure all
the vb2 ops stay balanced.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
libv4lconvert: Add ASUS A7M to upside down table

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
qv4l2: fix incorrect call to s_fmt when disabling width/height

When the frame width and height fields are disabled because we start
streaming, the editingFinished event is triggered as well, which
causes an attempt to change the format. This causes EBUSY warnings
because it really isn't allowed to do that anymore. Check if the
field is really enabled before we change the format, thus squashing
the warnings.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
qv4l2: fix incorrect handling of fields

I assumed that the format height stays the same when the field value
changes to TOP/BOTTOM/ALTERNATE, but it turns out that the height will
match that of the field height.

So update qv4l2 to match what drivers actually do.

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