aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeborah Brouwer <deborahbrouwer3563@gmail.com>2021-06-03 19:40:52 -0700
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-06-04 09:10:14 +0200
commitc8d617cc229c5e2862bf54509405c83d3c16f89a (patch)
treebb89a1e08f13e652f730318eb0538e68ead8ce86
parent57a0264cd163793e4f86e907098baeb74f2e9723 (diff)
downloadv4l-utils-c8d617cc229c5e2862bf54509405c83d3c16f89a.tar.gz
cec-follower: emulate features for CEC versions < CEC 2.0
For CEC adapters using versions < CEC 2.0, read the CEC Features as configured in the CEC adapter and emulate the features that are present. Signed-off-by: Deborah Brouwer <deborahbrouwer3563@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/cec-follower/cec-follower.cpp42
-rw-r--r--utils/libcecutil/cec-info.cpp2
2 files changed, 23 insertions, 21 deletions
diff --git a/utils/cec-follower/cec-follower.cpp b/utils/cec-follower/cec-follower.cpp
index b7a41ac2..1f598fdf 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -508,26 +508,30 @@ int main(int argc, char **argv)
cec_driver_info(caps, laddrs, node.phys_addr, conn_info);
- if (laddrs.cec_version >= CEC_OP_CEC_VERSION_2_0) {
- bool is_dev_feat = false;
-
- for (__u8 byte : laddrs.features[0]) {
- if (is_dev_feat) {
- node.source_has_arc_rx = (byte & CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX) != 0;
- node.sink_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;
- node.has_rec_tv = (byte & CEC_OP_FEAT_DEV_HAS_RECORD_TV_SCREEN) != 0;
- node.has_osd_string = (byte & CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING) != 0;
- break;
- }
- if (byte & CEC_OP_FEAT_EXT)
- continue;
- if (!is_dev_feat)
- is_dev_feat = true;
- else
- break;
+ /*
+ * For CEC 1.4, features of a logical address may still be
+ * filled in according to the CEC 2.0 guidelines even though
+ * the CEC framework won’t use the features in the CEC 2.0
+ * CEC_MSG_REPORT_FEATURES.
+ */
+ bool is_dev_feat = false;
+
+ for (__u8 byte : laddrs.features[0]) {
+ if (is_dev_feat) {
+ node.source_has_arc_rx = (byte & CEC_OP_FEAT_DEV_SOURCE_HAS_ARC_RX) != 0;
+ node.sink_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;
+ node.has_rec_tv = (byte & CEC_OP_FEAT_DEV_HAS_RECORD_TV_SCREEN) != 0;
+ node.has_osd_string = (byte & CEC_OP_FEAT_DEV_HAS_SET_OSD_STRING) != 0;
+ break;
}
+ if (byte & CEC_OP_FEAT_EXT)
+ continue;
+ if (!is_dev_feat)
+ is_dev_feat = true;
+ else
+ break;
}
printf("\n");
diff --git a/utils/libcecutil/cec-info.cpp b/utils/libcecutil/cec-info.cpp
index 8b3c55e8..3c768261 100644
--- a/utils/libcecutil/cec-info.cpp
+++ b/utils/libcecutil/cec-info.cpp
@@ -448,8 +448,6 @@ void cec_driver_info(const struct cec_caps &caps,
cec_prim_type2s(laddrs.primary_device_type[i]));
printf("\t Logical Address Type : %s\n",
cec_la_type2s(laddrs.log_addr_type[i]));
- if (laddrs.cec_version < CEC_OP_CEC_VERSION_2_0)
- continue;
printf("\t All Device Types : %s\n",
cec_all_dev_types2s(laddrs.all_device_types[i]).c_str());