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

Subject: v4l2-compliance: add V4L2_EVENT_SOURCE_CHANGE/EOS checks
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Thu Jan 31 14:40:48 2019 +0100

Codecs have special requirements w.r.t. these event. Verify
that they are implemented correctly.

Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

 utils/v4l2-compliance/v4l2-test-controls.cpp | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=4c0c905d23c65158d7a090097489ec8e6bcfa4db
diff --git a/utils/v4l2-compliance/v4l2-test-controls.cpp 
b/utils/v4l2-compliance/v4l2-test-controls.cpp
index 4d86035e234c..4f354a43149c 100644
--- a/utils/v4l2-compliance/v4l2-test-controls.cpp
+++ b/utils/v4l2-compliance/v4l2-test-controls.cpp
@@ -866,6 +866,34 @@ int testEvents(struct node *node)
                }
        }
 
+       struct v4l2_event_subscription sub = { 0 };
+
+       sub.type = V4L2_EVENT_EOS;
+       bool have_eos = !doioctl(node, VIDIOC_SUBSCRIBE_EVENT, &sub);
+       if (have_eos)
+               fail_on_test(doioctl(node, VIDIOC_UNSUBSCRIBE_EVENT, &sub));
+       sub.type = V4L2_EVENT_SOURCE_CHANGE;
+       bool have_source_change = !doioctl(node, VIDIOC_SUBSCRIBE_EVENT, &sub);
+       if (have_source_change)
+               fail_on_test(doioctl(node, VIDIOC_UNSUBSCRIBE_EVENT, &sub));
+
+       switch (node->codec_mask) {
+       case STATEFUL_ENCODER:
+               fail_on_test(have_source_change || !have_eos);
+               break;
+       case STATEFUL_DECODER:
+               fail_on_test(!have_source_change || !have_eos);
+               break;
+       case STATELESS_ENCODER:
+       case STATELESS_DECODER:
+               fail_on_test(have_source_change || have_eos);
+               break;
+       default:
+               break;
+       }
+       if (node->can_output && !node->is_m2m)
+               fail_on_test(have_source_change);
+
        if (node->controls.empty())
                return ENOTTY;
        return 0;

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to