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: cec-follower: switch to the new CEC utilities library
Author:  Hans Verkuil <hverkuil-ci...@xs4all.nl>
Date:    Wed Oct 2 17:19:30 2019 +0200

Use the new CEC utilities library.

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

 utils/cec-follower/.gitignore         |  2 --
 utils/cec-follower/Makefile.am        | 26 +++++---------------------
 utils/cec-follower/cec-follower.cpp   | 18 ++++++++----------
 utils/cec-follower/cec-follower.h     |  2 +-
 utils/cec-follower/cec-info.cpp       |  1 -
 utils/cec-follower/cec-log.cpp        |  1 -
 utils/cec-follower/cec-processing.cpp | 12 ++++++------
 7 files changed, 20 insertions(+), 42 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=70e98e5ec93e8a7b104c3c1a15e584bbbcaebae2
diff --git a/utils/cec-follower/.gitignore b/utils/cec-follower/.gitignore
index a5d7c24a65c3..eecce74dec3b 100644
--- a/utils/cec-follower/.gitignore
+++ b/utils/cec-follower/.gitignore
@@ -1,5 +1,3 @@
 cec-follower
 cec-follower.1
-cec-log-gen.h
-cec-table.h
 version.h
diff --git a/utils/cec-follower/Makefile.am b/utils/cec-follower/Makefile.am
index 18c1972d891d..6b2185438552 100644
--- a/utils/cec-follower/Makefile.am
+++ b/utils/cec-follower/Makefile.am
@@ -1,27 +1,11 @@
 bin_PROGRAMS = cec-follower
 man_MANS = cec-follower.1
 
-cec_follower_SOURCES = cec-follower.cpp cec-follower.h cec-processing.cpp 
cec-tuner.cpp cec-log.cpp cec-info.cpp
-cec_follower_CPPFLAGS = -I$(top_srcdir)/utils/common
-cec_follower_LDFLAGS = -lrt
+cec_follower_SOURCES = cec-follower.cpp cec-follower.h cec-processing.cpp 
cec-tuner.cpp
+cec_follower_CPPFLAGS = -I$(top_srcdir)/utils/libcecutil 
-I$(top_srcdir)/utils/common
+cec_follower_LDFLAGS = -lrt ../libcecutil/libcecutil.la
 
-cec-log.cpp: cec-log-gen.h
-
-cec-log-gen.h: $(top_srcdir)/utils/cec-ctl/msg2ctl.pl 
$(top_srcdir)/include/linux/cec.h \
-               $(top_srcdir)/utils/common/cec-htng.h 
$(top_srcdir)/include/linux/cec-funcs.h \
-               $(top_srcdir)/utils/common/cec-htng-funcs.h
-       $(top_srcdir)/utils/cec-ctl/msg2ctl.pl 1 
$(top_srcdir)/include/linux/cec.h \
-               $(top_srcdir)/utils/common/cec-htng.h 
$(top_srcdir)/include/linux/cec-funcs.h \
-               $(top_srcdir)/utils/common/cec-htng-funcs.h >$@
-
-cec-follower.cpp: cec-table.h version.h
-
-cec-table.h: $(top_srcdir)/utils/cec-ctl/msg2ctl.pl 
$(top_srcdir)/include/linux/cec.h \
-               $(top_srcdir)/utils/common/cec-htng.h 
$(top_srcdir)/include/linux/cec-funcs.h \
-               $(top_srcdir)/utils/common/cec-htng-funcs.h
-       $(top_srcdir)/utils/cec-ctl/msg2ctl.pl 2 
$(top_srcdir)/include/linux/cec.h \
-               $(top_srcdir)/utils/common/cec-htng.h 
$(top_srcdir)/include/linux/cec-funcs.h \
-               $(top_srcdir)/utils/common/cec-htng-funcs.h >$@
+cec-follower.cpp: version.h
 
 version.h:
        @if [ -d $(top_srcdir)/.git ]; then \
@@ -32,6 +16,6 @@ version.h:
        fi
 
 clean-local:
-       -rm -vf cec-log-gen.h cec-table.h version.h
+       -rm -vf version.h
 
 EXTRA_DIST = cec-follower.1
diff --git a/utils/cec-follower/cec-follower.cpp 
b/utils/cec-follower/cec-follower.cpp
index b208d14e6b67..00783d1541bb 100644
--- a/utils/cec-follower/cec-follower.cpp
+++ b/utils/cec-follower/cec-follower.cpp
@@ -23,8 +23,6 @@
 #include "version.h"
 #endif
 
-#include "cec-table.h"
-
 /* Short option list
 
    Please keep in alphabetical order.
@@ -229,22 +227,22 @@ std::string opcode2s(const struct cec_msg *msg)
 {
        std::stringstream oss;
        __u8 opcode = msg->msg[1];
+       const char *name;
 
        if (opcode == CEC_MSG_CDC_MESSAGE) {
                __u8 cdc_opcode = msg->msg[4];
+               name = cec_cdc_opcode2s(cdc_opcode);
 
-               for (unsigned i = 0; i < ARRAY_SIZE(cdcmsgtable); i++) {
-                       if (cdcmsgtable[i].opcode == cdc_opcode)
-                               return cdcmsgtable[i].name;
-               }
+               if (name)
+                       return name;
                oss << "CDC: 0x" << std::hex << (unsigned)cdc_opcode;
                return oss.str();
        }
 
-       for (unsigned i = 0; i < ARRAY_SIZE(msgtable); i++) {
-               if (msgtable[i].opcode == opcode)
-                       return msgtable[i].name;
-       }
+       name = cec_opcode2s(opcode);
+
+       if (name)
+               return name;
        oss << "0x" << std::hex << (unsigned)opcode;
        return oss.str();
 }
diff --git a/utils/cec-follower/cec-follower.h 
b/utils/cec-follower/cec-follower.h
index 04019c9ae1a3..fc335b144047 100644
--- a/utils/cec-follower/cec-follower.h
+++ b/utils/cec-follower/cec-follower.h
@@ -22,7 +22,7 @@
 #endif
 
 #include <cec-info.h>
-#include "../common/cec-log.h"
+#include <cec-log.h>
 
 #define ARRAY_SIZE(a) \
        (sizeof(a) / sizeof(*a))
diff --git a/utils/cec-follower/cec-info.cpp b/utils/cec-follower/cec-info.cpp
deleted file mode 120000
index 33d3aae6b827..000000000000
--- a/utils/cec-follower/cec-info.cpp
+++ /dev/null
@@ -1 +0,0 @@
-../common/cec-info.cpp
\ No newline at end of file
diff --git a/utils/cec-follower/cec-log.cpp b/utils/cec-follower/cec-log.cpp
deleted file mode 120000
index 6995a88dfad6..000000000000
--- a/utils/cec-follower/cec-log.cpp
+++ /dev/null
@@ -1 +0,0 @@
-../common/cec-log.cpp
\ No newline at end of file
diff --git a/utils/cec-follower/cec-processing.cpp 
b/utils/cec-follower/cec-processing.cpp
index 8157b81bd81d..2496a84989ce 100644
--- a/utils/cec-follower/cec-processing.cpp
+++ b/utils/cec-follower/cec-processing.cpp
@@ -50,7 +50,7 @@ static struct timeval start_timeofday;
 
 static const char *get_ui_cmd_string(__u8 ui_cmd)
 {
-       return ui_cmd_string(ui_cmd) ? : "Unknown";
+       return cec_log_ui_cmd_string(ui_cmd) ? : "Unknown";
 }
 
 static std::string ts2s(__u64 ts, bool wallclock)
@@ -131,7 +131,7 @@ void reply_feature_abort(struct node *node, struct cec_msg 
*msg, __u8 reason)
                           the same message to the same Follower again at that 
time to avoid saturating
                           the bus. */
                        warn("Received message %s from LA %d (%s) shortly 
after\n",
-                            opcode2s(msg).c_str(), la, la2s(la));
+                            opcode2s(msg).c_str(), la, cec_la2s(la));
                        warn("replying Feature Abort [Unrecognized Opcode] to 
the same message.\n");
                }
        }
@@ -915,15 +915,15 @@ void testProcessing(struct node *node, bool wallclock)
                            la_info[from].feature_aborted[opcode].ts &&
                            ts_to_ms(get_ts() - 
la_info[from].feature_aborted[opcode].ts) < 200) {
                                warn("Received message %s from LA %d (%s) less 
than 200 ms after\n",
-                                    opcode2s(&msg).c_str(), from, la2s(from));
+                                    opcode2s(&msg).c_str(), from, 
cec_la2s(from));
                                warn("replying Feature Abort (not [Unrecognized 
Opcode]) to the same message.\n");
                        }
                        if (from != CEC_LOG_ADDR_UNREGISTERED && 
!la_info[from].ts)
-                               dev_info("Logical address %d (%s) 
discovered.\n", from, la2s(from));
+                               dev_info("Logical address %d (%s) 
discovered.\n", from, cec_la2s(from));
                        if (show_msgs) {
                                printf("    %s to %s (%d to %d): ",
-                                      la2s(from), to == 0xf ? "all" : 
la2s(to), from, to);
-                               log_msg(&msg);
+                                      cec_la2s(from), to == 0xf ? "all" : 
cec_la2s(to), from, to);
+                               cec_log_msg(&msg);
                                if (show_info)
                                        printf("\tSequence: %u Rx Timestamp: 
%s\n",
                                               msg.sequence, ts2s(msg.rx_ts, 
wallclock).c_str());

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

Reply via email to