This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: v4l2-compliance: improve std input/output mask checks.
Author:  Hans Verkuil <[email protected]>
Date:    Mon Jul 23 11:56:10 2012 +0200

Make sure that ENUMSTD returns the same mask as is specified by
ENUMINPUT/OUTPUT. Also, test that QUERYSTD isn't supported for outputs.

Signed-off-by: Hans Verkuil <[email protected]>
(cherry picked from commit 41d78ac113a587953c79a6708ed7b3553922b418)

Signed-off-by: Gregor Jasny <[email protected]>

 utils/v4l2-compliance/v4l2-test-io-config.cpp |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=99cc64c3df119d912daabad6910412379b619baa

diff --git a/utils/v4l2-compliance/v4l2-test-io-config.cpp 
b/utils/v4l2-compliance/v4l2-test-io-config.cpp
index 09e2dc4..44610fd 100644
--- a/utils/v4l2-compliance/v4l2-test-io-config.cpp
+++ b/utils/v4l2-compliance/v4l2-test-io-config.cpp
@@ -31,7 +31,7 @@
 #include <sys/ioctl.h>
 #include "v4l2-compliance.h"
 
-static int checkStd(struct node *node, bool has_std, v4l2_std_id mask)
+static int checkStd(struct node *node, bool has_std, v4l2_std_id mask, bool 
is_input)
 {
        v4l2_std_id std_mask = 0;
        v4l2_std_id std;
@@ -46,7 +46,7 @@ static int checkStd(struct node *node, bool has_std, 
v4l2_std_id mask)
                return fail("STD cap not set, but could still get a 
standard\n");
        if (!ret && has_std) {
                if (std & ~mask)
-                       warn("current standard is invalid according to the 
input standard mask\n");
+                       warn("current standard is invalid according to the 
standard mask\n");
                if (std == 0)
                        return fail("Standard == 0?!\n");
                if (std & V4L2_STD_ATSC)
@@ -91,10 +91,15 @@ static int checkStd(struct node *node, bool has_std, 
v4l2_std_id mask)
                return fail("STD cap was not set, but standards can be 
enumerated\n");
        if (std_mask & V4L2_STD_ATSC)
                return fail("STD mask contains ATSC standards. This is no 
longer supported\n");
+       if (has_std && std_mask != mask)
+               return fail("the union of ENUMSTD does not match the standard 
mask (%llx != %llx)\n",
+                               std_mask, mask);
        ret = doioctl(node, VIDIOC_QUERYSTD, &std);
        if (!ret && !has_std)
                return fail("STD cap was not set, but could still query 
standard\n");
-       if (!ret && (std & ~std_mask))
+       if (ret != ENOTTY && !is_input)
+               return fail("this is an output, but could still query 
standard\n");
+       if (!ret && is_input && (std & ~std_mask))
                return fail("QUERYSTD gives back an unsupported standard\n");
        return 0;
 }
@@ -117,7 +122,7 @@ int testStd(struct node *node)
                        return fail("could not select input %d.\n", i);
                if (input.capabilities & V4L2_IN_CAP_STD)
                        has_std = true;
-               if (checkStd(node, input.capabilities & V4L2_IN_CAP_STD, 
input.std))
+               if (checkStd(node, input.capabilities & V4L2_IN_CAP_STD, 
input.std, true))
                        return fail("STD failed for input %d.\n", i);
        }
 
@@ -133,7 +138,7 @@ int testStd(struct node *node)
                        return fail("could not select output %d.\n", o);
                if (output.capabilities & V4L2_OUT_CAP_STD)
                        has_std = true;
-               if (checkStd(node, output.capabilities & V4L2_OUT_CAP_STD, 
output.std))
+               if (checkStd(node, output.capabilities & V4L2_OUT_CAP_STD, 
output.std, false))
                        return fail("STD failed for output %d.\n", o);
        }
        return has_std ? 0 : ENOTTY;

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to