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: check that VIDIOC_TRY_EXT_CTRLS can be called with 
count == 0
Author:  Hans Verkuil <[email protected]>
Date:    Tue Sep 11 11:15:18 2012 +0200

The spec explicitly states that VIDIOC_TRY_EXT_CTRLS with a count of 0
should be used to test for valid control classes. Test this.

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

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

 utils/v4l2-compliance/v4l2-test-controls.cpp |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

---

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

diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp 
b/utils/v4l2-compliance/v4l2-test-controls.cpp
index 8656fa8..27c0117 100644
--- a/utils/v4l2-compliance/v4l2-test-controls.cpp
+++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
@@ -518,6 +518,21 @@ int testExtendedControls(struct node *node)
        if (check_0(ctrls.reserved, sizeof(ctrls.reserved)))
                return fail("reserved not zeroed\n");
 
+       memset(&ctrls, 0, sizeof(ctrls));
+       ret = doioctl(node, VIDIOC_TRY_EXT_CTRLS, &ctrls);
+       if (ret == ENOTTY && node->controls.empty())
+               return ret;
+       if (ret)
+               return fail("try_ext_ctrls does not support count == 0\n");
+       if (node->controls.empty())
+               return fail("try_ext_ctrls worked even when no controls are 
present\n");
+       if (ctrls.ctrl_class)
+               return fail("field ctrl_class changed\n");
+       if (ctrls.count)
+               return fail("field count changed\n");
+       if (check_0(ctrls.reserved, sizeof(ctrls.reserved)))
+               return fail("reserved not zeroed\n");
+
        for (iter = node->controls.begin(); iter != node->controls.end(); 
++iter) {
                info("checking extended control '%s' (0x%08x)\n", iter->name, 
iter->id);
                ctrl.id = iter->id;

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

Reply via email to