aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-14 15:14:11 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-10-14 15:14:11 +0200
commit670ffe8cd308f1d0daf1182742a944a14f566021 (patch)
treeefb5c1e2d1d3845438bbf3bed44227634ac5a7ab
parent2bae5c1f8ed4c7d9f51c26b41bc4e6b1229ebd47 (diff)
cec-compliance: Improve the INACTIVE_SOURCE test
A TV should reply with ACTIVE_SOURCE or SET_STREAM_PATH. Verify this rather than relying on the interactive mode. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-compliance/cec-test.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index ec07d886..b6d8efee 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -434,19 +434,27 @@ static struct remote_subtest osd_string_subtests[] = {
static int routing_control_inactive_source(struct node *node, unsigned me, unsigned la, bool interactive)
{
+ __u32 mode = CEC_MODE_INITIATOR | CEC_MODE_FOLLOWER;
struct cec_msg msg = {};
+ int response;
+ doioctl(node, CEC_S_MODE, &mode);
interactive_info(true, "Please make sure that the TV is currently viewing this source.");
cec_msg_init(&msg, me, la);
cec_msg_inactive_source(&msg, node->phys_addr);
- fail_on_test(!transmit_timeout(node, &msg));
+ fail_on_test(!transmit(node, &msg));
if (unrecognized_op(&msg))
return NOTSUPPORTED;
if (refused(&msg))
return REFUSED;
// It may take a bit of time for the Inactive Source message to take
// effect, so sleep a bit.
- sleep(3);
+ response = util_receive(node, CEC_LOG_ADDR_TV, 3000, &msg,
+ CEC_MSG_INACTIVE_SOURCE,
+ CEC_MSG_ACTIVE_SOURCE, CEC_MSG_SET_STREAM_PATH);
+ mode = CEC_MODE_INITIATOR;
+ doioctl(node, CEC_S_MODE, &mode);
+ fail_on_test(response < 0);
fail_on_test(interactive && !question("Did the TV switch away from or stop showing this source?"));
if (interactive)
@@ -522,9 +530,9 @@ static int routing_control_set_stream_path(struct node *node, unsigned me, unsig
}
static struct remote_subtest routing_control_subtests[] = {
- { "Inactive Source", CEC_LOG_ADDR_MASK_TV, routing_control_inactive_source },
{ "Active Source", CEC_LOG_ADDR_MASK_TV, routing_control_active_source },
{ "Request Active Source", CEC_LOG_ADDR_MASK_ALL, routing_control_req_active_source },
+ { "Inactive Source", CEC_LOG_ADDR_MASK_TV, routing_control_inactive_source },
{ "Set Stream Path", CEC_LOG_ADDR_MASK_ALL, routing_control_set_stream_path },
};

Privacy Policy