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 timeout when waiting for event
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Fri Jun 14 12:50:02 2019 +0200

The test for the stateful decoder that checks for a SOURCE_CHANGE
event when you start streaming needs to wait for up to one second
before calling dqevent. Otherwise the HW may not have had the
chance yet to raise this event.

So use select() to wait for an exception with a 1s timeout.

Reported-by: Stanimir Varbanov <stanimir.varba...@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>

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

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=f0a5b17d94e113527786621baaf19df91abd3567
diff --git a/utils/v4l2-compliance/v4l2-test-buffers.cpp 
b/utils/v4l2-compliance/v4l2-test-buffers.cpp
index f078a4a474bf..bc5d219e4757 100644
--- a/utils/v4l2-compliance/v4l2-test-buffers.cpp
+++ b/utils/v4l2-compliance/v4l2-test-buffers.cpp
@@ -1318,9 +1318,16 @@ int testMmap(struct node *node, unsigned frame_count, 
enum poll_mode pollmode)
                if (node->is_m2m) {
                        if (node->codec_mask & STATEFUL_DECODER) {
                                int fd_flags = fcntl(node->g_fd(), F_GETFL);
+                               struct timeval tv = { 1, 0 };
+                               fd_set efds;
                                v4l2_event ev;
 
                                fcntl(node->g_fd(), F_SETFL, fd_flags | 
O_NONBLOCK);
+                               FD_ZERO(&efds);
+                               FD_SET(node->g_fd(), &efds);
+                               ret = select(node->g_fd() + 1, NULL, NULL, 
&efds, &tv);
+                               fail_on_test(ret < 0);
+                               fail_on_test(ret == 0);
                                fail_on_test(node->dqevent(ev));
                                fcntl(node->g_fd(), F_SETFL, fd_flags);
                                fail_on_test(ev.type != 
V4L2_EVENT_SOURCE_CHANGE);

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

Reply via email to