Skip to content

Commit

Permalink
Add libCEC support.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Mark Kendall committed Oct 26, 2011
1 parent 145b209 commit e090e99
Show file tree
Hide file tree
Showing 8 changed files with 846 additions and 2 deletions.
26 changes: 26 additions & 0 deletions mythtv/configure
Expand Up @@ -105,6 +105,9 @@ Advanced options (experts only):
--enable-valgrind disables timeouts for valgrind memory debugging
--disable-lirc disable lirc support (Infrared Remotes)
--disable-joystick-menu disable joystick menu
--disable-libcec disable libCEC device support
--libcec-path=HDRLOC location of directory containing
cec.h [$libcec_path_default]
--disable-firewire disable support for FireWire cable boxes
--disable-iptv disable support for recording RTSP/UDP/RTP streams
--disable-hdhomerun disable support for HDHomeRun boxes
Expand Down Expand Up @@ -1346,6 +1349,7 @@ MYTHTV_CONFIG_LIST='
ivtv
asi
joystick_menu
libcec
libfftw3
libmpeg2external
libxml2
Expand Down Expand Up @@ -1428,6 +1432,7 @@ PATHS_LIST='
datadir
dvb_path
incdir
libcec_path
libdir
mandir
prefix
Expand Down Expand Up @@ -1986,6 +1991,7 @@ enable ivtv
enable asi
enable lamemp3
enable libass
enable libcec
enable libxml2
enable libudf
enable lirc
Expand All @@ -2006,6 +2012,7 @@ disable indevs
# mythtv paths
dvb_path_default="${sysroot}/usr/include"
x11_path_default="${sysroot}/usr/X11R6/include"
libcec_path_default="${sysroot}/usr/include/libcec"
libxml2_path_default="${sysroot}/usr/include/libxml2"

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

enabled libcec && check_cxx -I"$libcec_path" <<EOF || { echolog "libCEC support needs libcec >= 7" && disable libcec; }
#include <libcec/cec.h>
#include <iostream>
using namespace std;
using namespace CEC;
#include <libcec/cecloader.h>
int main(void) {
if (CEC_LIB_VERSION < 7)
return 0;
return (long) LoadLibCec;
}
EOF

if enabled libxml2 ; then
if pkg-config --exists libxml-2.0 ; then
libxml2_path=`pkg-config --cflags-only-I libxml-2.0|sed -n "s/-I\([^ ]*\) *$/\1/p"`
Expand Down Expand Up @@ -4437,6 +4457,7 @@ if enabled frontend; then
echo "# Input Support"
echo "Joystick menu ${joystick_menu-no}"
echo "lirc support ${lirc-no}"
echo "libCEC device support ${libcec-no} [$libcec_path]"
if test x"$target_os" = x"darwin" ; then
echo "Apple Remote ${appleremote-no}"
fi
Expand Down Expand Up @@ -4830,6 +4851,11 @@ if enabled dvb; then
append CONFIG_INCLUDEPATH "$dvb_path"
fi

if enabled libcec; then
append CONFIG_DEFINES "using_libcec"
append CONFIG_INCLUDEPATH "$libcec_path"
fi

if enabled libxml2; then
if [ -d $libxml2_path ] ; then
append CONFIG_INCLUDEPATH "$libxml2_path"
Expand Down

0 comments on commit e090e99

Please sign in to comment.