Skip to content

Commit e090e99

Browse files
author
Mark Kendall
committed
Add libCEC support.
This adds initial support for CEC HDMI devices which allow bidirectional communication and control between CEC capable devices. There is a lot going on here, so I'll add a wiki page at some point. - will turn the display device on and switch to MythTV's HDMI input when MythTV is started (configurable). - the HDMI input is identified as 'MythTV'. - will turn the display off when exiting (configurable). - 'advanced' selection of HDMI port (physical address), CEC logical address and libCEC device (all default to 'auto'). - there is no settings UI. I will wait and see if we get new, libmythui settings pages before 0.25 (otherwise I'll add some old style settings pages). - added 2 new actions for powering the display on and off. - incoming keypresses from the display's remote control are mapped to standard keypresses. Certain functions are unmpapped (no obvious meaning in a MythTV context) and others have slightly unusual mappings to ensure each button has a unique keypress (and hence maximise the potential for customisation - but does limit 'out of the box' functionality). There is still some limited overlap (e.g. M) but most map to conventional, default MythTV bindings. Use the Key Editor to tweak. - no CEC commands (e.g. display telling MythTV to power off) are currently handled - either because there is no obvious way to handle them (menu language, power off) or I haven't seen them. There is a lot of potential for additional functionality, both within MythTV and libCEC itself, so this will no doubt be a moving feast for a while. The usefulness of CEC will largely depend on how much individual manufacturers have 'tailored' their CEC implementations. For me, with a Toshiba display (Regza-Link = CEC), Playstation3 and VESA mounted Ion box, everything is pretty seemless and largely 'just works'. N.B. The keymapping code may change depending on other changes in libmythui (and I may yet tweak the default keybindings).
1 parent 145b209 commit e090e99

File tree

8 files changed

+846
-2
lines changed

8 files changed

+846
-2
lines changed

mythtv/configure

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ Advanced options (experts only):
105105
--enable-valgrind disables timeouts for valgrind memory debugging
106106
--disable-lirc disable lirc support (Infrared Remotes)
107107
--disable-joystick-menu disable joystick menu
108+
--disable-libcec disable libCEC device support
109+
--libcec-path=HDRLOC location of directory containing
110+
cec.h [$libcec_path_default]
108111
--disable-firewire disable support for FireWire cable boxes
109112
--disable-iptv disable support for recording RTSP/UDP/RTP streams
110113
--disable-hdhomerun disable support for HDHomeRun boxes
@@ -1346,6 +1349,7 @@ MYTHTV_CONFIG_LIST='
13461349
ivtv
13471350
asi
13481351
joystick_menu
1352+
libcec
13491353
libfftw3
13501354
libmpeg2external
13511355
libxml2
@@ -1428,6 +1432,7 @@ PATHS_LIST='
14281432
datadir
14291433
dvb_path
14301434
incdir
1435+
libcec_path
14311436
libdir
14321437
mandir
14331438
prefix
@@ -1986,6 +1991,7 @@ enable ivtv
19861991
enable asi
19871992
enable lamemp3
19881993
enable libass
1994+
enable libcec
19891995
enable libxml2
19901996
enable libudf
19911997
enable lirc
@@ -2006,6 +2012,7 @@ disable indevs
20062012
# mythtv paths
20072013
dvb_path_default="${sysroot}/usr/include"
20082014
x11_path_default="${sysroot}/usr/X11R6/include"
2015+
libcec_path_default="${sysroot}/usr/include/libcec"
20092016
libxml2_path_default="${sysroot}/usr/include/libxml2"
20102017

20112018
# configurable options
@@ -4105,6 +4112,19 @@ enabled libfftw3 && check_lib2 fftw3.h fftw_init_threads -lfftw3_threads -lfftw3
41054112
# ass_flush_events was added in 0.9.10
41064113
enabled libass && check_lib2 ass/ass.h ass_flush_events -lass || disable libass
41074114

4115+
enabled libcec && check_cxx -I"$libcec_path" <<EOF || { echolog "libCEC support needs libcec >= 7" && disable libcec; }
4116+
#include <libcec/cec.h>
4117+
#include <iostream>
4118+
using namespace std;
4119+
using namespace CEC;
4120+
#include <libcec/cecloader.h>
4121+
int main(void) {
4122+
if (CEC_LIB_VERSION < 7)
4123+
return 0;
4124+
return (long) LoadLibCec;
4125+
}
4126+
EOF
4127+
41084128
if enabled libxml2 ; then
41094129
if pkg-config --exists libxml-2.0 ; then
41104130
libxml2_path=`pkg-config --cflags-only-I libxml-2.0|sed -n "s/-I\([^ ]*\) *$/\1/p"`
@@ -4437,6 +4457,7 @@ if enabled frontend; then
44374457
echo "# Input Support"
44384458
echo "Joystick menu ${joystick_menu-no}"
44394459
echo "lirc support ${lirc-no}"
4460+
echo "libCEC device support ${libcec-no} [$libcec_path]"
44404461
if test x"$target_os" = x"darwin" ; then
44414462
echo "Apple Remote ${appleremote-no}"
44424463
fi
@@ -4830,6 +4851,11 @@ if enabled dvb; then
48304851
append CONFIG_INCLUDEPATH "$dvb_path"
48314852
fi
48324853

4854+
if enabled libcec; then
4855+
append CONFIG_DEFINES "using_libcec"
4856+
append CONFIG_INCLUDEPATH "$libcec_path"
4857+
fi
4858+
48334859
if enabled libxml2; then
48344860
if [ -d $libxml2_path ] ; then
48354861
append CONFIG_INCLUDEPATH "$libxml2_path"

0 commit comments

Comments
 (0)