v4l2-compliance: check for presence of a tuner/modulator
authorHans Verkuil <hans.verkuil@cisco.com>
Thu, 27 Feb 2014 07:28:57 +0000 (08:28 +0100)
committerHans Verkuil <hans.verkuil@cisco.com>
Fri, 28 Feb 2014 13:43:21 +0000 (14:43 +0100)
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>
utils/v4l2-compliance/v4l2-test-input-output.cpp

index 7528a81..a32338a 100644 (file)
@@ -351,6 +351,8 @@ static int checkInput(struct node *node, const struct v4l2_input &descr, unsigne
                return fail("invalid type\n");
        if (descr.type == V4L2_INPUT_TYPE_CAMERA && descr.tuner)
                return fail("invalid tuner\n");
+       if (descr.type == V4L2_INPUT_TYPE_TUNER && node->tuners == 0)
+               return fail("no tuners found for tuner input\n");
        if (!(descr.capabilities & V4L2_IN_CAP_STD) && descr.std)
                return fail("invalid std\n");
        if ((descr.capabilities & V4L2_IN_CAP_STD) && !descr.std)
@@ -700,6 +702,8 @@ static int checkOutput(struct node *node, const struct v4l2_output &descr, unsig
                return fail("invalid type\n");
        if (descr.type == V4L2_OUTPUT_TYPE_ANALOG && descr.modulator)
                return fail("invalid modulator\n");
+       if (descr.type == V4L2_OUTPUT_TYPE_MODULATOR && node->modulators == 0)
+               return fail("no modulators found for modulator output\n");
        if (!(descr.capabilities & V4L2_OUT_CAP_STD) && descr.std)
                return fail("invalid std\n");
        if ((descr.capabilities & V4L2_OUT_CAP_STD) && !descr.std)