Binary files /tmp/tmpYZA0ln/LqMzPIYs2L/vdr-plugin-cecremote-1.4.0/ceccmd.o and /tmp/tmpYZA0ln/ITOzIUZSjL/vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/ceccmd.o differ Binary files /tmp/tmpYZA0ln/LqMzPIYs2L/vdr-plugin-cecremote-1.4.0/cecconfigfileparser.o and /tmp/tmpYZA0ln/ITOzIUZSjL/vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecconfigfileparser.o differ diff -Nru vdr-plugin-cecremote-1.4.0/cecremote.cc vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecremote.cc --- vdr-plugin-cecremote-1.4.0/cecremote.cc 2016-04-30 16:00:57.515690059 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecremote.cc 2017-10-03 11:28:11.000000000 +0000 @@ -15,6 +15,7 @@ #include // We need this for cecloader.h #include +#include using namespace std; #include @@ -25,6 +26,24 @@ /* * Callback when libCEC receives a key press */ +#if CEC_LIB_VERSION_MAJOR >= 4 +static void CecKeyPressCallback(void *cbParam, const cec_keypress* key) +{ + static cec_user_control_code lastkey = CEC_USER_CONTROL_CODE_UNKNOWN; + cCECRemote *rem = (cCECRemote *)cbParam; + + Dsyslog("key pressed %02x (%d)", key->keycode, key->duration); + if ( + ((key->keycode >= 0) && (key->keycode <= CEC_USER_CONTROL_CODE_MAX)) && + ((key->duration == 0) || (key->keycode != lastkey)) + ) + { + lastkey = key->keycode; + cCmd cmd(CEC_KEYRPRESS, (int)key->keycode); + rem->PushCmd(cmd); + } +} +#else static int CecKeyPressCallback(void *cbParam, const cec_keypress key) { static cec_user_control_code lastkey = CEC_USER_CONTROL_CODE_UNKNOWN; @@ -42,11 +61,23 @@ } return 0; } +#endif /* * Callback function for libCEC command messages. * Currently only used for debugging. */ +#if CEC_LIB_VERSION_MAJOR >= 4 +static void CecCommandCallback(void *cbParam, const cec_command *command) +{ + cCECRemote *rem = (cCECRemote *)cbParam; + Dsyslog("CEC Command %d : %s Init %d Dest %d", command->opcode, + rem->mCECAdapter->ToString(command->opcode), + command->initiator, command->destination); + cCmd cmd(CEC_COMMAND, command->opcode, command->initiator); + rem->PushCmd(cmd); +} +#else static int CecCommandCallback(void *cbParam, const cec_command command) { cCECRemote *rem = (cCECRemote *)cbParam; @@ -58,14 +89,19 @@ return 0; } - +#endif /* * Callback function for libCEC alert messages. * Currently only used for debugging. */ +#if CEC_LIB_VERSION_MAJOR >= 4 +static void CecAlertCallback(void *cbParam, const libcec_alert type, + const libcec_parameter param) +#else static int CecAlertCallback(void *cbParam, const libcec_alert type, const libcec_parameter param) +#endif { cCECRemote *rem = (cCECRemote *)cbParam; Dsyslog("CecAlert %d", type); @@ -93,12 +129,55 @@ default: break; } +#if CEC_LIB_VERSION_MAJOR < 4 return 0; +#endif } /* * Callback function for libCEC to print out log messages. */ +#if CEC_LIB_VERSION_MAJOR >= 4 +static void CecLogMessageCallback(void *cbParam, const cec_log_message *message) +{ + cCECRemote *rem = (cCECRemote *)cbParam; + if ((message->level & rem->getCECLogLevel()) == message->level) + { + string strLevel; + switch (message->level) + { + case CEC_LOG_ERROR: + strLevel = "ERROR: "; + break; + case CEC_LOG_WARNING: + strLevel = "WARNING: "; + break; + case CEC_LOG_NOTICE: + strLevel = "NOTICE: "; + break; + case CEC_LOG_TRAFFIC: + strLevel = "TRAFFIC: "; + break; + case CEC_LOG_DEBUG: + strLevel = "DEBUG: "; + break; + default: + break; + } + + char strFullLog[1040]; + snprintf(strFullLog, 1039, "CEC %s %s", strLevel.c_str(), message->message); + if (message->level == CEC_LOG_ERROR) + { + Esyslog(strFullLog); + } + else + { + Dsyslog(strFullLog); + } + } +} +#else static int CecLogMessageCallback(void *cbParam, const cec_log_message message) { cCECRemote *rem = (cCECRemote *)cbParam; @@ -137,9 +216,10 @@ Dsyslog(strFullLog); } } + return 0; } - +#endif /* * Callback function for libCEC when a device gets activated. * Currently only used for debugging. @@ -155,13 +235,20 @@ * Callback function for libCEC when configuration changes. * Currently only used for debugging. */ +#if CEC_LIB_VERSION_MAJOR >= 4 +static void CECConfigurationCallback (void *cbParam, + const libcec_configuration *config) +{ + Csyslog("CECConfiguration"); +} +#else static int CECConfigurationCallback (void *cbParam, const libcec_configuration config) { Csyslog("CECConfiguration"); return CEC_TRUE; } - +#endif /* * Worker thread which processes the command queue and executes the * received commands. @@ -173,6 +260,10 @@ cec_logical_address addr; eKeys k; + // Allow some delay before the first connection to the CEC Adapter. + if (mStartupDelay > 0) { + sleep(mStartupDelay); + } Connect(); Dsyslog("cCECRemote start worker thread"); @@ -328,7 +419,8 @@ cThread("CEC receiver"), mProcessedSerial(-1), mDevicesFound(0), - mInExec(false) + mInExec(false), + mDeferredStartup(false) { mPlugin = plugin; mCECAdapter = NULL; @@ -342,6 +434,7 @@ mDeviceTypes = options.mDeviceTypes; mShutdownOnStandby = options.mShutdownOnStandby; mPowerOffOnStandby = options.mPowerOffOnStandby; + mStartupDelay = options.mStartupDelay; SetDescription("CEC Action Thread"); @@ -352,12 +445,17 @@ void cCECRemote::Startup() { - Csyslog("cCECRemote Startup"); - - if (mPlugin->GetStartManually()) { - PushCmdQueue(mOnManualStart); + if (mCECAdapter == NULL) { + Csyslog("cCECRemote Delayed Startup"); + mDeferredStartup = true; + } + else { + Csyslog("cCECRemote Startup"); + if (mPlugin->GetStartManually()) { + PushCmdQueue(mOnManualStart); + } + PushCmdQueue(mOnStart); } - PushCmdQueue(mOnStart); } void cCECRemote::Connect() @@ -368,13 +466,21 @@ } // Initialize Callbacks mCECCallbacks.Clear(); +#if CEC_LIB_VERSION_MAJOR >= 4 + mCECCallbacks.logMessage = &::CecLogMessageCallback; + mCECCallbacks.keyPress = &::CecKeyPressCallback; + mCECCallbacks.commandReceived = &::CecCommandCallback; + mCECCallbacks.alert = &::CecAlertCallback; + mCECCallbacks.sourceActivated = &::CECSourceActivatedCallback; + mCECCallbacks.configurationChanged = &::CECConfigurationCallback; +#else mCECCallbacks.CBCecLogMessage = &::CecLogMessageCallback; mCECCallbacks.CBCecKeyPress = &::CecKeyPressCallback; mCECCallbacks.CBCecCommand = &::CecCommandCallback; mCECCallbacks.CBCecAlert = &::CecAlertCallback; mCECCallbacks.CBCecSourceActivated = &::CECSourceActivatedCallback; mCECCallbacks.CBCecConfigurationChanged = &::CECConfigurationCallback; - +#endif // Setup CEC configuration mCECConfig.Clear(); strncpy(mCECConfig.strDeviceName, VDRNAME, sizeof(mCECConfig.strDeviceName)); @@ -391,7 +497,9 @@ mCECConfig.iHDMIPort = mHDMIPort; mCECConfig.wakeDevices.Clear(); mCECConfig.powerOffDevices.Clear(); +#if CEC_LIB_VERSION_MAJOR < 4 mCECConfig.bShutdownOnStandby = mShutdownOnStandby; +#endif mCECConfig.bPowerOffOnStandby = mPowerOffOnStandby; mCECConfig.baseDevice = mBaseDevice; // If no is specified in the , set default @@ -449,6 +557,7 @@ mCECAdapter = NULL; return; } + Csyslog("END cCECRemote::Open OK"); cec_logical_addresses devices = mCECAdapter->GetActiveDevices(); for (int j = 0; j < 16; j++) @@ -458,15 +567,28 @@ cec_logical_address logical_addres = (cec_logical_address) j; uint16_t phaddr = mCECAdapter->GetDevicePhysicalAddress(logical_addres); - cec_osd_name name = mCECAdapter->GetDeviceOSDName(logical_addres); + cec_vendor_id vendor = (cec_vendor_id)mCECAdapter->GetDeviceVendorId(logical_addres); +#if CEC_LIB_VERSION_MAJOR >= 4 + string name = mCECAdapter->GetDeviceOSDName(logical_addres); + Dsyslog(" %15.15s %d@%04x %15.15s %15.15s", + mCECAdapter->ToString(logical_addres), logical_addres, + phaddr, name.c_str(), mCECAdapter->ToString(vendor)); +#else + cec_osd_name name = mCECAdapter->GetDeviceOSDName(logical_addres); Dsyslog(" %15.15s %d@%04x %15.15s %15.15s", mCECAdapter->ToString(logical_addres), logical_addres, phaddr, name.name, mCECAdapter->ToString(vendor)); +#endif } } Csyslog("END cCECRemote::Initialize"); + + if (mDeferredStartup) { + mDeferredStartup = false; + Startup(); + } } void cCECRemote::Disconnect() @@ -505,7 +627,7 @@ { cString s = "Available CEC Devices:"; uint16_t phaddr; - cec_osd_name name; + string name; cec_vendor_id vendor; cec_power_status powerstatus; @@ -535,14 +657,19 @@ cec_logical_address logical_addres = (cec_logical_address)j; phaddr = mCECAdapter->GetDevicePhysicalAddress(logical_addres); +#if CEC_LIB_VERSION_MAJOR >= 4 name = mCECAdapter->GetDeviceOSDName(logical_addres); +#else + cec_osd_name oldname = mCECAdapter->GetDeviceOSDName(logical_addres); + name = oldname.name; +#endif vendor = (cec_vendor_id)mCECAdapter->GetDeviceVendorId(logical_addres); if (own[j]) { s = cString::sprintf("%s\n %d# %-15.15s@%04x %-15.15s %-14.14s %-15.15s", *s, logical_addres, mCECAdapter->ToString(logical_addres), - phaddr, name.name, + phaddr, name.c_str(), VDRNAME, VDRNAME); } else { @@ -550,8 +677,12 @@ s = cString::sprintf("%s\n %d# %-15.15s@%04x %-15.15s %-14.14s %-15.15s %-15.15s", *s, logical_addres, mCECAdapter->ToString(logical_addres), - phaddr, name.name, + phaddr, name.c_str(), +#if CEC_LIB_VERSION_MAJOR >= 4 + mCECAdapter->GetDeviceOSDName(logical_addres).c_str(), +#else mCECAdapter->GetDeviceOSDName(logical_addres).name, +#endif mCECAdapter->ToString(vendor), mCECAdapter->ToString(powerstatus)); } diff -Nru vdr-plugin-cecremote-1.4.0/cecremote.h vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecremote.h --- vdr-plugin-cecremote-1.4.0/cecremote.h 2016-04-18 17:10:25.481504367 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecremote.h 2017-10-03 11:28:11.000000000 +0000 @@ -48,12 +48,12 @@ void Reconnect(void); void Stop(void); void Startup(void); - ICECAdapter *mCECAdapter; private: static const char *VDRNAME; int mCECLogLevel; int mProcessedSerial; + int mStartupDelay; uint8_t mDevicesFound; uint8_t mHDMIPort; cec_logical_address mBaseDevice; @@ -77,6 +77,7 @@ bool mShutdownOnStandby; bool mPowerOffOnStandby; bool mInExec; + bool mDeferredStartup; cPluginCecremote *mPlugin; void Connect(void); diff -Nru vdr-plugin-cecremote-1.4.0/cecremoteplugin.cc vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecremoteplugin.cc --- vdr-plugin-cecremote-1.4.0/cecremoteplugin.cc 2016-04-30 16:02:23.612555386 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecremoteplugin.cc 2017-10-03 11:28:11.000000000 +0000 @@ -23,7 +23,7 @@ namespace cecplugin { -static const char *VERSION = "1.4.0"; +static const char *VERSION = "1.4.2"; static const char *DESCRIPTION = "Send/Receive CEC commands"; static const char *MAINMENUENTRY = "CECremote"; Binary files /tmp/tmpYZA0ln/LqMzPIYs2L/vdr-plugin-cecremote-1.4.0/cecstatusmonitor.o and /tmp/tmpYZA0ln/ITOzIUZSjL/vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/cecstatusmonitor.o differ diff -Nru vdr-plugin-cecremote-1.4.0/configfileparser.cc vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/configfileparser.cc --- vdr-plugin-cecremote-1.4.0/configfileparser.cc 2016-04-24 12:29:51.775700186 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/configfileparser.cc 2017-10-03 11:28:11.000000000 +0000 @@ -67,7 +67,7 @@ const char *cConfigFileParser::XML_COMMAND = "command"; const char *cConfigFileParser::XML_INITIATOR = "initiator"; const char *cConfigFileParser::XML_RTCDETECT = "rtcdetect"; - +const char *cConfigFileParser::XML_STARTUPDELAY = "startupdelay"; /* * Parse */ @@ -565,6 +565,13 @@ throw cCECConfigException( getLineNumber(currentNode.offset_debug()), s); } + } else if (strcasecmp(currentNode.name(), XML_STARTUPDELAY) == 0) { + if (!textToInt(currentNode.text().as_string("0"), + mGlobalOptions.mStartupDelay)) { + string s = "Invalid numeric in startupdelay"; + throw cCECConfigException( + getLineNumber(currentNode.offset_debug()), s); + } } else { string s = "Invalid Node "; s += currentNode.name(); diff -Nru vdr-plugin-cecremote-1.4.0/configfileparser.h vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/configfileparser.h --- vdr-plugin-cecremote-1.4.0/configfileparser.h 2016-04-24 12:27:35.372153534 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/configfileparser.h 2017-10-03 11:28:11.000000000 +0000 @@ -50,6 +50,7 @@ int cec_debug; uint32_t mComboKeyTimeoutMs; int mHDMIPort; + int mStartupDelay; cec_logical_address mBaseDevice; cCmdQueue mOnStart; cCmdQueue mOnStop; @@ -67,6 +68,7 @@ cCECGlobalOptions() : cec_debug(7), mComboKeyTimeoutMs(1000), mHDMIPort(CEC_DEFAULT_HDMI_PORT), + mStartupDelay(0), mBaseDevice(CECDEVICE_UNKNOWN), mCECKeymap(cKeyMaps::DEFAULTKEYMAP), mVDRKeymap(cKeyMaps::DEFAULTKEYMAP), @@ -246,6 +248,7 @@ static const char *XML_COMMAND; static const char *XML_INITIATOR; static const char *XML_RTCDETECT; + static const char *XML_STARTUPDELAY; // Filename of the configuration file. const char* mXmlFile; diff -Nru vdr-plugin-cecremote-1.4.0/contrib/cecremote_example.xml vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/contrib/cecremote_example.xml --- vdr-plugin-cecremote-1.4.0/contrib/cecremote_example.xml 2016-04-24 12:52:56.631302500 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/contrib/cecremote_example.xml 2017-10-03 11:28:11.000000000 +0000 @@ -14,6 +14,7 @@ 2 false 2 + 1 false false diff -Nru vdr-plugin-cecremote-1.4.0/debian/changelog vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/debian/changelog --- vdr-plugin-cecremote-1.4.0/debian/changelog 2017-05-24 08:56:51.000000000 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/debian/changelog 2017-10-10 08:46:50.000000000 +0000 @@ -1,8 +1,93 @@ -vdr-plugin-cecremote (1.4.0-0yavdr1~trusty) trusty; urgency=medium +vdr-plugin-cecremote (1.4.0+git20171003-2-c3d10df-0yavdr0~trusty) trusty; urgency=medium + + * new upstream snapshot + - Add startupdelay to global config + + -- Alexander Grothe Tue, 10 Oct 2017 10:37:16 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr10~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Fri, 30 Jun 2017 19:03:46 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr9~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Mon, 12 Jun 2017 11:41:01 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr8~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Sun, 11 Jun 2017 22:28:33 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr7~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Tue, 06 Jun 2017 11:47:52 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr6~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Sun, 04 Jun 2017 13:34:43 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr5~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Mon, 29 May 2017 11:14:04 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr4~xenial) xenial; urgency=medium * automatic rebuild - -- Alexander Grothe Wed, 24 May 2017 10:56:51 +0200 + -- Alexander Grothe Thu, 25 May 2017 22:33:16 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr3~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Thu, 25 May 2017 21:51:03 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr3~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Mon, 08 May 2017 10:01:16 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr2~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Mon, 01 May 2017 08:33:52 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr1~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Mon, 01 May 2017 08:19:14 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr0~xenial) xenial; urgency=medium + + * automatic rebuild + + -- Alexander Grothe Sun, 30 Apr 2017 19:46:13 +0200 + +vdr-plugin-cecremote (1.4.0+git20161110-0yavdr0~xenial) xenial; urgency=medium + + * new upstream snapshot for libcec4 compatibility + + -- Alexander Grothe Fri, 14 Apr 2017 12:00:21 +0200 + +vdr-plugin-cecremote (1.4.0-0yavdr1~xenial) xenial; urgency=medium + + * rebuild for xenial + + -- Alexander Grothe Fri, 14 Apr 2017 11:47:22 +0200 vdr-plugin-cecremote (1.4.0-0yavdr0~trusty) trusty; urgency=medium diff -Nru vdr-plugin-cecremote-1.4.0/debian/control vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/debian/control --- vdr-plugin-cecremote-1.4.0/debian/control 2017-02-12 17:48:06.000000000 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/debian/control 2017-10-10 08:37:09.000000000 +0000 @@ -3,7 +3,7 @@ Priority: extra Maintainer: Ulrich Eckhardt Uploaders: Frodo -Build-Depends: debhelper (>= 9), vdr-dev (>= 2.2.0-1), gettext, pkg-config, libcec-dev, libplatform-dev, libxerces-c-dev, libpugixml-dev +Build-Depends: debhelper (>= 9), vdr-dev (>= 2.2.0-1), gettext, pkg-config, libcec4-dev, libplatform-dev, libp8-platform-dev, libxerces-c-dev, libpugixml-dev, libudev-dev Standards-Version: 3.9.3 Homepage: http://hg.uli-eckhardt.de/ diff -Nru vdr-plugin-cecremote-1.4.0/.gitignore vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/.gitignore --- vdr-plugin-cecremote-1.4.0/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/.gitignore 2017-10-03 11:28:11.000000000 +0000 @@ -0,0 +1,14 @@ +syntax: glob +*~ +*.orig +*.o +*.so +vdr-cecremote*.tgz +.dependencies +po/*.mo +po/*.pot +push.sh +.cproject +.project +.settings + diff -Nru vdr-plugin-cecremote-1.4.0/HISTORY vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/HISTORY --- vdr-plugin-cecremote-1.4.0/HISTORY 2016-04-30 16:20:15.704494970 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/HISTORY 2017-10-03 11:28:11.000000000 +0000 @@ -109,3 +109,7 @@ false in the section. - Add a udev rule to the contrib directory which disables ModemManger or mtp-probe access to the pulse-eight CEC adapter. + +2016-11-10: Version 1.4.1 + +- Compiles with libCEC 4 diff -Nru vdr-plugin-cecremote-1.4.0/Makefile vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/Makefile --- vdr-plugin-cecremote-1.4.0/Makefile 2016-04-24 12:25:21.878610043 +0000 +++ vdr-plugin-cecremote-1.4.0+git20171003-2-c3d10df/Makefile 2017-10-03 11:28:11.000000000 +0000 @@ -69,7 +69,9 @@ # Flags for libcec LIBS += $(shell pkg-config --libs libcec) CFLAGS += $(shell pkg-config --cflags libcec) -CXXFLAGS += $(shell pkg-config --cflags libcec) +CXXFLAGS += $(shell pkg-config --cflags libcec) +# Uncomment if compile against libcec 4 +CXXFLAGS +=-std=c++11 # Flags for pugixml xml parser LIBS += -lpugixml