aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Fjeldtvedt <jaffe1@gmail.com>2016-07-22 15:25:04 +0200
committerHans Verkuil <hans.verkuil@cisco.com>2016-07-22 15:35:05 +0200
commit8acf2767e24f8bfdaeaddb8949cbdf1cbb6999ed (patch)
tree3e398afe730420e57cc1aa782d2effe957277524
parentda6e8deb3752f59c522227fdc4e6f4be302dc65c (diff)
add test for Deck Control feature
This adds rudimentary subtests for the various messages in the Deck Control feature. The follower is extended with minimal support. Signed-off-by: Johan Fjeldtvedt <jaffe1@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
-rw-r--r--utils/cec-compliance/cec-compliance.cpp4
-rw-r--r--utils/cec-compliance/cec-compliance.h1
-rw-r--r--utils/cec-compliance/cec-test.cpp86
-rw-r--r--utils/cec-follower/cec-follower.cpp1
-rw-r--r--utils/cec-follower/cec-follower.h1
-rw-r--r--utils/cec-follower/cec-processing.cpp22
6 files changed, 115 insertions, 0 deletions
diff --git a/utils/cec-compliance/cec-compliance.cpp b/utils/cec-compliance/cec-compliance.cpp
index f6ddbd1a..90394879 100644
--- a/utils/cec-compliance/cec-compliance.cpp
+++ b/utils/cec-compliance/cec-compliance.cpp
@@ -843,6 +843,8 @@ static void topology_probe_device(struct node *node, unsigned i, unsigned la)
(*dev_features & CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX) != 0;
node->remote[i].has_aud_rate =
(*dev_features & CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE) != 0;
+ node->remote[i].has_deck_ctl =
+ (*dev_features & CEC_OP_FEAT_DEV_HAS_DECK_CONTROL) != 0;
}
}
@@ -951,6 +953,8 @@ int main(int argc, char **argv)
test_tags |= TAG_ARC_CONTROL;
if (options[OptTestCapDiscoveryControl])
test_tags |= TAG_CAP_DISCOVERY_CONTROL;
+ if (options[OptTestDeckControl])
+ test_tags |= TAG_DECK_CONTROL;
if (options[OptTestDeviceMenuControl])
test_tags |= TAG_DEVICE_MENU_CONTROL;
if (options[OptTestDeviceOSDTransfer])
diff --git a/utils/cec-compliance/cec-compliance.h b/utils/cec-compliance/cec-compliance.h
index 3cd67d00..b2d95ea3 100644
--- a/utils/cec-compliance/cec-compliance.h
+++ b/utils/cec-compliance/cec-compliance.h
@@ -147,6 +147,7 @@ struct remote {
__u8 volume;
__u8 mute;
bool has_aud_rate;
+ bool has_deck_ctl;
};
struct node {
diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
index 1cb98cfa..36f28aab 100644
--- a/utils/cec-compliance/cec-test.cpp
+++ b/utils/cec-compliance/cec-test.cpp
@@ -156,6 +156,9 @@ static int system_info_give_features(struct node *node, unsigned me, unsigned la
node->remote[la].has_aud_rate) {
return fail("Only Playback, Recording or Tuner devices shall set the Set Audio Rate bit");
}
+ if (!(cec_has_playback(1 << la) || cec_has_record(1 << la)) && node->remote[la].has_deck_ctl)
+ return fail("Only Playback and Recording devices shall set the Supports Deck Control bit");
+
return 0;
}
@@ -555,6 +558,86 @@ static struct remote_subtest dev_menu_ctl_subtests[] = {
};
+/* Deck Control */
+
+static int deck_ctl_give_status(struct node *node, unsigned me, unsigned la, bool interactive)
+{
+ struct cec_msg msg = {};
+
+ cec_msg_init(&msg, me, la);
+ cec_msg_give_deck_status(&msg, true, CEC_OP_STATUS_REQ_ONCE);
+ fail_on_test(!transmit_timeout(node, &msg));
+ fail_on_test(timed_out(&msg));
+ fail_on_test_v2(node->remote[la].cec_version, node->remote[la].has_deck_ctl &&
+ cec_msg_status_is_abort(&msg));
+ fail_on_test_v2(node->remote[la].cec_version, !node->remote[la].has_deck_ctl);
+ if (cec_msg_status_is_abort(&msg))
+ return NOTSUPPORTED;
+
+ return 0;
+}
+
+static int deck_ctl_deck_status(struct node *node, unsigned me, unsigned la, bool interactive)
+{
+ struct cec_msg msg = {};
+
+ cec_msg_init(&msg, me, la);
+ cec_msg_deck_status(&msg, CEC_OP_DECK_INFO_STOP);
+ fail_on_test(!transmit_timeout(node, &msg));
+ if (cec_msg_status_is_abort(&msg))
+ return NOTSUPPORTED;
+
+ return 0;
+}
+
+static int deck_ctl_deck_ctl(struct node *node, unsigned me, unsigned la, bool interactive)
+{
+ struct cec_msg msg = {};
+
+ cec_msg_init(&msg, me, la);
+ cec_msg_deck_control(&msg, CEC_OP_DECK_CTL_MODE_STOP);
+ fail_on_test(!transmit_timeout(node, &msg));
+ fail_on_test_v2(node->remote[la].cec_version, node->remote[la].has_deck_ctl &&
+ cec_msg_status_is_abort(&msg) && abort_reason(&msg) == CEC_OP_ABORT_UNRECOGNIZED_OP);
+ fail_on_test_v2(node->remote[la].cec_version, !node->remote[la].has_deck_ctl);
+ if (cec_msg_status_is_abort(&msg) && abort_reason(&msg) == CEC_OP_ABORT_UNRECOGNIZED_OP)
+ return NOTSUPPORTED;
+
+ return 0;
+}
+
+static int deck_ctl_play(struct node *node, unsigned me, unsigned la, bool interactive)
+{
+ struct cec_msg msg = {};
+
+ cec_msg_init(&msg, me, la);
+ cec_msg_play(&msg, CEC_OP_PLAY_MODE_PLAY_STILL);
+ fail_on_test(!transmit_timeout(node, &msg));
+ fail_on_test_v2(node->remote[la].cec_version, node->remote[la].has_deck_ctl &&
+ cec_msg_status_is_abort(&msg) && abort_reason(&msg) == CEC_OP_ABORT_UNRECOGNIZED_OP);
+ fail_on_test_v2(node->remote[la].cec_version, !node->remote[la].has_deck_ctl);
+ if (cec_msg_status_is_abort(&msg) && abort_reason(&msg) == CEC_OP_ABORT_UNRECOGNIZED_OP)
+ return NOTSUPPORTED;
+
+ return 0;
+}
+
+static struct remote_subtest deck_ctl_subtests[] = {
+ { "Give Deck Status",
+ CEC_LOG_ADDR_MASK_PLAYBACK | CEC_LOG_ADDR_MASK_RECORD,
+ deck_ctl_give_status },
+ { "Deck Status",
+ CEC_LOG_ADDR_MASK_ALL,
+ deck_ctl_deck_status },
+ { "Deck Control",
+ CEC_LOG_ADDR_MASK_PLAYBACK | CEC_LOG_ADDR_MASK_RECORD,
+ deck_ctl_deck_ctl },
+ { "Play",
+ CEC_LOG_ADDR_MASK_PLAYBACK | CEC_LOG_ADDR_MASK_RECORD,
+ deck_ctl_play },
+};
+
+
/* Post-test checks */
static int post_test_check_recognized(struct node *node, unsigned me, unsigned la, bool interactive)
@@ -603,6 +686,9 @@ static struct remote_test tests[] = {
test_case("Device Menu Control feature",
TAG_DEVICE_MENU_CONTROL,
dev_menu_ctl_subtests),
+ test_case("Deck Control feature",
+ TAG_DECK_CONTROL,
+ deck_ctl_subtests),
test_case_ext("Dynamic Auto Lipsync feature",
TAG_DYNAMIC_AUTO_LIPSYNC,
dal_subtests),
diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
index 4fd86fc1..e1bd1c32 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -704,6 +704,7 @@ int main(int argc, char **argv)
node.has_arc_rx = (byte & CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX) != 0;
node.has_arc_tx = (byte & CEC_OP_FEAT_DEV_SINK_HAS_ARC_TX) != 0;
node.has_aud_rate = (byte & CEC_OP_FEAT_DEV_HAS_SET_AUDIO_RATE) != 0;
+ node.has_deck_ctl = (byte & CEC_OP_FEAT_DEV_HAS_DECK_CONTROL) != 0;
printf("\t Device Features :\n%s",
dev_feat2s(byte).c_str());
}
diff --git a/utils/cec-follower/cec-follower.h b/utils/cec-follower/cec-follower.h
index 05e5d3b4..19858c7b 100644
--- a/utils/cec-follower/cec-follower.h
+++ b/utils/cec-follower/cec-follower.h
@@ -70,6 +70,7 @@ struct node {
bool has_arc_rx;
bool has_arc_tx;
bool has_aud_rate;
+ bool has_deck_ctl;
};
struct la_info {
diff --git a/utils/cec-follower/cec-processing.cpp b/utils/cec-follower/cec-processing.cpp
index dff659f2..a2fd7e83 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -502,6 +502,28 @@ static void processMsg(struct node *node, struct cec_msg &msg, unsigned me)
break;
+ /* Deck Control */
+
+ case CEC_MSG_GIVE_DECK_STATUS:
+ if (node->has_deck_ctl) {
+ cec_msg_set_reply_to(&msg, &msg);
+ cec_msg_deck_status(&msg, CEC_OP_DECK_INFO_STOP);
+ transmit(node, &msg);
+ return;
+ }
+ break;
+ case CEC_MSG_PLAY:
+ if (node->has_deck_ctl)
+ return;
+ break;
+ case CEC_MSG_DECK_CONTROL:
+ if (node->has_deck_ctl)
+ return;
+ break;
+ case CEC_MSG_DECK_STATUS:
+ return;
+
+
/* Dynamic Auto Lipsync */
case CEC_MSG_REQUEST_CURRENT_LATENCY: {

Privacy Policy