[SCM] kodi/master: Revert to using libcec 3.1 until libcec4 becomes available in Debian
rbalint at users.alioth.debian.org
rbalint at users.alioth.debian.org
Thu Dec 22 01:18:07 UTC 2016
The following commit has been merged in the master branch:
commit c0919239145688d7817430cbd4304c5ea5611a29
Author: Balint Reczey <balint at balintreczey.hu>
Date: Sat Dec 17 23:03:59 2016 +0100
Revert to using libcec 3.1 until libcec4 becomes available in Debian
diff --git a/debian/patches/0005-Revert-cmake-Properly-find-correct-libcec-version.patch b/debian/patches/0005-Revert-cmake-Properly-find-correct-libcec-version.patch
new file mode 100644
index 0000000..93aa0fb
--- /dev/null
+++ b/debian/patches/0005-Revert-cmake-Properly-find-correct-libcec-version.patch
@@ -0,0 +1,44 @@
+From fe100a985d4027777a60fa9ec5c9c15cce8b8437 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Sat, 17 Dec 2016 21:54:25 +0100
+Subject: [PATCH 5/9] Revert "[cmake] Properly find correct libcec version"
+
+This reverts commit ec17ed2ed0e04795d8de60d425c34c670e0a6cba.
+---
+ project/cmake/modules/FindCEC.cmake | 16 +++-------------
+ 1 file changed, 3 insertions(+), 13 deletions(-)
+
+diff --git a/project/cmake/modules/FindCEC.cmake b/project/cmake/modules/FindCEC.cmake
+index bd6fd1d..9891d18 100644
+--- a/project/cmake/modules/FindCEC.cmake
++++ b/project/cmake/modules/FindCEC.cmake
+@@ -15,23 +15,13 @@
+ # CEC::CEC - The libCEC library
+
+ if(PKG_CONFIG_FOUND)
+- pkg_check_modules(PC_CEC libcec QUIET)
++ pkg_check_modules(PC_CEC libcec>=4.0.0 QUIET)
+ endif()
+
+-find_path(CEC_INCLUDE_DIR NAMES libcec/cec.h libCEC/CEC.h
++find_path(CEC_INCLUDE_DIR libcec/cec.h libCEC/CEC.h
+ PATHS ${PC_CEC_INCLUDEDIR})
+
+-if(PC_CEC_VERSION)
+- set(CEC_VERSION ${PC_CEC_VERSION})
+-elseif(CEC_INCLUDE_DIR AND EXISTS "${CEC_INCLUDE_DIR}/libcec/version.h")
+- file(STRINGS "${CEC_INCLUDE_DIR}/libcec/version.h" cec_version_str REGEX "^[\t ]+LIBCEC_VERSION_TO_UINT\\(.*\\)")
+- string(REGEX REPLACE "^[\t ]+LIBCEC_VERSION_TO_UINT\\(([0-9]+), ([0-9]+), ([0-9]+)\\)" "\\1.\\2.\\3" CEC_VERSION "${cec_version_str}")
+- unset(cec_version_str)
+-endif()
+-
+-if(NOT CEC_FIND_VERSION)
+- set(CEC_FIND_VERSION 4.0.0)
+-endif()
++set(CEC_VERSION ${PC_CEC_VERSION})
+
+ include(FindPackageHandleStandardArgs)
+ if(NOT WIN32)
+--
+2.1.4
+
diff --git a/debian/patches/0006-Revert-cec-added-setting-to-make-libCEC-wake-up-the-.patch b/debian/patches/0006-Revert-cec-added-setting-to-make-libCEC-wake-up-the-.patch
new file mode 100644
index 0000000..7e8bade
--- /dev/null
+++ b/debian/patches/0006-Revert-cec-added-setting-to-make-libCEC-wake-up-the-.patch
@@ -0,0 +1,61 @@
+From 34a6f4b2f2657b014df073862809a33df4c60b74 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Sat, 17 Dec 2016 23:00:33 +0100
+Subject: [PATCH 6/9] Revert "[cec] added: setting to make libCEC wake up the
+ AVR explicitly when activating the source."
+
+This reverts commit cfcfb4c98cf1a6d756fc3962e6d803c297917684.
+
+Conflicts:
+ system/peripherals.xml
+---
+ addons/resource.language.en_gb/resources/strings.po | 7 +------
+ system/peripherals.xml | 3 +--
+ xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 1 -
+ 3 files changed, 2 insertions(+), 9 deletions(-)
+
+--- a/addons/resource.language.en_gb/resources/strings.po
++++ b/addons/resource.language.en_gb/resources/strings.po
+@@ -16534,12 +16534,7 @@
+ msgid "Pause Playback"
+ msgstr ""
+
+-#: system/peripherals.xml
+-msgctxt "#36046"
+-msgid "Force AVR to wake up when Kodi is activated"
+-msgstr ""
+-
+-#empty strings from id 36047 to 36098
++#empty strings from id 36046 to 36098
+
+ #: system/settings/settings.xml
+ msgctxt "#36099"
+--- a/system/peripherals.xml
++++ b/system/peripherals.xml
+@@ -16,7 +16,7 @@
+ <setting key="send_inactive_source" type="bool" value="1" label="36025" order="5" />
+ <setting key="cec_standby_screensaver" type="bool" value="0" label="36009" order="6" />
+ <setting key="cec_wake_screensaver" type="bool" value="1" label="36010" order="7" />
+- <setting key="standby_pc_on_tv_standby" type="enum" value="13011" label="36029" order="8" lvalues="36028|13005|13011|13009|36044|36046" />
++ <setting key="standby_pc_on_tv_standby" type="enum" value="13011" label="36029" order="8" lvalues="36028|13005|13011|13009|36043|36045" />
+ <setting key="standby_tv_on_pc_standby" type="bool" value="1" label="36026" order="9" />
+ <setting key="use_tv_menu_language" type="bool" value="1" label="36018" order="10" />
+ <setting key="pause_playback_on_deactivate" type="bool" value="1" label="36033" configurable="0" />
+@@ -24,7 +24,6 @@
+ <setting key="connected_device" type="enum" label="36019" value="36037" lvalues="36037|36038" order="12" />
+ <setting key="cec_hdmi_port" type="int" value="1" min="1" max="15" label="36015" order="13" />
+ <setting key="physical_address" type="string" label="36021" value="0" order="14" />
+- <setting key="power_avr_on_as" type="bool" label="36045" value="0" order="15" />
+
+ <setting key="tv_vendor" type="int" value="0" configurable="0" />
+ <setting key="device_name" type="string" value="Kodi" configurable="0" />
+--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+@@ -1384,7 +1384,6 @@
+ m_bPowerOffScreensaver = GetSettingBool("cec_standby_screensaver") ? 1 : 0;
+ m_bPowerOnScreensaver = GetSettingBool("cec_wake_screensaver") ? 1 : 0;
+ m_bSendInactiveSource = GetSettingBool("send_inactive_source") ? 1 : 0;
+- m_configuration.bAutoWakeAVR = GetSettingBool("power_avr_on_as") ? 1 : 0;
+
+ // read the mutually exclusive boolean settings
+ int iStandbyAction(GetSettingInt("standby_pc_on_tv_standby"));
diff --git a/debian/patches/0007-Revert-cec-add-CEC-IMX-adapter-as-known-type-and-set.patch b/debian/patches/0007-Revert-cec-add-CEC-IMX-adapter-as-known-type-and-set.patch
new file mode 100644
index 0000000..590e988
--- /dev/null
+++ b/debian/patches/0007-Revert-cec-add-CEC-IMX-adapter-as-known-type-and-set.patch
@@ -0,0 +1,62 @@
+From 363973899576904cda4922663d98c8a092569a9b Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Sat, 17 Dec 2016 23:00:39 +0100
+Subject: [PATCH 7/9] Revert "[cec] add CEC IMX adapter as known type and set
+ no polling."
+
+This reverts commit f0e1725617e41e841c9c24a20f1fc9b37347c8c3.
+---
+ xbmc/peripherals/PeripheralTypes.h | 5 -----
+ xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp | 6 ------
+ 2 files changed, 11 deletions(-)
+
+diff --git a/xbmc/peripherals/PeripheralTypes.h b/xbmc/peripherals/PeripheralTypes.h
+index c87242f..34ce2ef 100644
+--- a/xbmc/peripherals/PeripheralTypes.h
++++ b/xbmc/peripherals/PeripheralTypes.h
+@@ -45,7 +45,6 @@ namespace PERIPHERALS
+ #ifdef TARGET_ANDROID
+ PERIPHERAL_BUS_ANDROID,
+ #endif
+- PERIPHERAL_BUS_IMX,
+ };
+
+ enum PeripheralFeature
+@@ -174,8 +173,6 @@ namespace PERIPHERALS
+ return "pci";
+ case PERIPHERAL_BUS_RPI:
+ return "rpi";
+- case PERIPHERAL_BUS_IMX:
+- return "imx";
+ case PERIPHERAL_BUS_CEC:
+ return "cec";
+ case PERIPHERAL_BUS_ADDON:
+@@ -200,8 +197,6 @@ namespace PERIPHERALS
+ return PERIPHERAL_BUS_PCI;
+ else if (strTypeLowerCase == "rpi")
+ return PERIPHERAL_BUS_RPI;
+- else if (strTypeLowerCase == "imx")
+- return PERIPHERAL_BUS_IMX;
+ else if (strTypeLowerCase == "cec")
+ return PERIPHERAL_BUS_CEC;
+ else if (strTypeLowerCase == "addon")
+diff --git a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp b/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp
+index abd0a6b..b04fe00 100644
+--- a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp
++++ b/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp
+@@ -102,12 +102,6 @@ bool CPeripheralBusCEC::PerformDeviceScan(PeripheralScanResults &results)
+ /** the Pi's adapter cannot be removed, no need to rescan */
+ m_bNeedsPolling = false;
+ break;
+-#if defined(HAS_IMXVPU)
+- case ADAPTERTYPE_IMX:
+- result.m_mappedBusType = PERIPHERAL_BUS_IMX;
+- m_bNeedsPolling = false;
+- break;
+-#endif
+ default:
+ break;
+ }
+--
+2.1.4
+
diff --git a/debian/patches/0008-Revert-cec-Added-advanced-settings-for-action-when-T.patch b/debian/patches/0008-Revert-cec-Added-advanced-settings-for-action-when-T.patch
new file mode 100644
index 0000000..ca2302e
--- /dev/null
+++ b/debian/patches/0008-Revert-cec-Added-advanced-settings-for-action-when-T.patch
@@ -0,0 +1,130 @@
+From 2214636c7eebf5bd7d73b542b1d481e7ac21421f Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Sat, 17 Dec 2016 23:00:47 +0100
+Subject: [PATCH 8/9] Revert "[cec] Added advanced settings for action when TV
+ goes standby"
+
+This reverts commit 82fe52deb8c11df31fbdf8c298b28a5e1a1491aa.
+---
+ system/peripherals.xml | 2 +-
+ xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 47 +++++------------------
+ xbmc/peripherals/devices/PeripheralCecAdapter.h | 1 -
+ 3 files changed, 11 insertions(+), 39 deletions(-)
+
+diff --git a/system/peripherals.xml b/system/peripherals.xml
+index 1fa31e1..58a9d24 100644
+--- a/system/peripherals.xml
++++ b/system/peripherals.xml
+@@ -16,7 +16,7 @@
+ <setting key="send_inactive_source" type="bool" value="1" label="36025" order="5" />
+ <setting key="cec_standby_screensaver" type="bool" value="0" label="36009" order="6" />
+ <setting key="cec_wake_screensaver" type="bool" value="1" label="36010" order="7" />
+- <setting key="standby_pc_on_tv_standby" type="enum" value="13011" label="36029" order="8" lvalues="36028|13005|13011|13009|36043|36045" />
++ <setting key="standby_pc_on_tv_standby" type="enum" value="13011" label="36029" order="8" lvalues="36028|13005|13011" />
+ <setting key="standby_tv_on_pc_standby" type="bool" value="1" label="36026" order="9" />
+ <setting key="use_tv_menu_language" type="bool" value="1" label="36018" order="10" />
+ <setting key="pause_playback_on_deactivate" type="bool" value="1" label="36033" configurable="0" />
+diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+index 1b7c38e..a71dc4b 100644
+--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+@@ -55,10 +55,6 @@ using namespace CEC;
+ #define LOCALISED_ID_TV_AVR 36039
+ #define LOCALISED_ID_STOP 36044
+ #define LOCALISED_ID_PAUSE 36045
+-#define LOCALISED_ID_POWEROFF 13005
+-#define LOCALISED_ID_SUSPEND 13011
+-#define LOCALISED_ID_QUIT 13009
+-#define LOCALISED_ID_IGNORE 36028
+
+ #define LOCALISED_ID_NONE 231
+
+@@ -623,35 +619,6 @@ void CPeripheralCecAdapter::SetMenuLanguage(const char *strLanguage)
+ CLog::Log(LOGWARNING, "%s - TV menu language set to unknown value '%s'", __FUNCTION__, strLanguage);
+ }
+
+-void CPeripheralCecAdapter::OnTvStandby(void)
+-{
+- int iActionOnTvStandby = GetSettingInt("standby_pc_on_tv_standby");
+- switch (iActionOnTvStandby)
+- {
+- case LOCALISED_ID_POWEROFF:
+- m_bStarted = false;
+- g_application.ExecuteXBMCAction("Shutdown");
+- break;
+- case LOCALISED_ID_SUSPEND:
+- m_bStarted = false;
+- g_application.ExecuteXBMCAction("Suspend");
+- break;
+- case LOCALISED_ID_QUIT:
+- m_bStarted = false;
+- g_application.ExecuteXBMCAction("Quit");
+- break;
+- case LOCALISED_ID_PAUSE:
+- g_application.OnAction(CAction(ACTION_PAUSE));
+- break;
+- case LOCALISED_ID_STOP:
+- g_application.StopPlaying();
+- break;
+- default:
+- CLog::Log(LOGERROR, "%s - Unexpected [standby_pc_on_tv_standby] setting value", __FUNCTION__);
+- break;
+- }
+-}
+-
+ void CPeripheralCecAdapter::CecCommand(void *cbParam, const cec_command* command)
+ {
+ CPeripheralCecAdapter *adapter = static_cast<CPeripheralCecAdapter *>(cbParam);
+@@ -663,10 +630,16 @@ void CPeripheralCecAdapter::CecCommand(void *cbParam, const cec_command* command
+ switch (command->opcode)
+ {
+ case CEC_OPCODE_STANDBY:
++ /* a device was put in standby mode */
+ if (command->initiator == CECDEVICE_TV &&
++ (adapter->m_configuration.bPowerOffOnStandby == 1 || adapter->m_bShutdownOnStandby) &&
+ (!adapter->m_standbySent.IsValid() || CDateTime::GetCurrentDateTime() - adapter->m_standbySent > CDateTimeSpan(0, 0, 0, SCREENSAVER_TIMEOUT)))
+ {
+- adapter->OnTvStandby();
++ adapter->m_bStarted = false;
++ if (adapter->m_configuration.bPowerOffOnStandby == 1)
++ g_application.ExecuteXBMCAction("Suspend");
++ else if (adapter->m_bShutdownOnStandby)
++ g_application.ExecuteXBMCAction("Shutdown");
+ }
+ break;
+ case CEC_OPCODE_SET_MENU_LANGUAGE:
+@@ -1387,8 +1360,8 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void)
+
+ // read the mutually exclusive boolean settings
+ int iStandbyAction(GetSettingInt("standby_pc_on_tv_standby"));
+- m_configuration.bPowerOffOnStandby = iStandbyAction == LOCALISED_ID_SUSPEND ? 1 : 0;
+- m_bShutdownOnStandby = iStandbyAction == LOCALISED_ID_POWEROFF;
++ m_configuration.bPowerOffOnStandby = iStandbyAction == 13011 ? 1 : 0;
++ m_bShutdownOnStandby = iStandbyAction == 13005;
+
+ #if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD)
+ // double tap prevention timeout in ms. libCEC uses 50ms units for this in 2.2.0, so divide by 50
+@@ -1400,7 +1373,7 @@ void CPeripheralCecAdapter::SetConfigurationFromSettings(void)
+
+ if (GetSettingBool("pause_playback_on_deactivate"))
+ {
+- SetSetting("pause_or_stop_playback_on_deactivate", LOCALISED_ID_PAUSE);
++ SetSetting("pause_or_stop_playback_on_deactivate", 36045);
+ SetSetting("pause_playback_on_deactivate", false);
+ }
+ }
+diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.h b/xbmc/peripherals/devices/PeripheralCecAdapter.h
+index 9274eab..30b22c9 100644
+--- a/xbmc/peripherals/devices/PeripheralCecAdapter.h
++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.h
+@@ -144,7 +144,6 @@ namespace PERIPHERALS
+
+ void SetAudioSystemConnected(bool bSetTo);
+ void SetMenuLanguage(const char *strLanguage);
+- void OnTvStandby(void);
+
+ // callbacks from libCEC
+ static void CecLogMessage(void *cbParam, const CEC::cec_log_message* message);
+--
+2.1.4
+
diff --git a/debian/patches/0009-Revert-cec-bump-to-libCEC-4.0.0.patch b/debian/patches/0009-Revert-cec-bump-to-libCEC-4.0.0.patch
new file mode 100644
index 0000000..fad6d02
--- /dev/null
+++ b/debian/patches/0009-Revert-cec-bump-to-libCEC-4.0.0.patch
@@ -0,0 +1,495 @@
+From bee521c0e7f9553fde3e43f557b7b25ef2f65f84 Mon Sep 17 00:00:00 2001
+From: Balint Reczey <balint at balintreczey.hu>
+Date: Sat, 17 Dec 2016 23:01:43 +0100
+Subject: [PATCH 9/9] Revert "[cec] bump to libCEC 4.0.0"
+
+This reverts commit cc3ae0339faf2b669bee20cb360c526410910f42.
+
+Conflicts:
+ addons/resource.language.en_gb/resources/strings.po
+ project/BuildDependencies/scripts/0_package.list
+---
+ configure.ac | 4 +-
+ project/BuildDependencies/scripts/0_package.list | 2 +-
+ project/cmake/modules/FindCEC.cmake | 2 +-
+ system/peripherals.xml | 1 +
+ tools/depends/target/Makefile | 5 +-
+ tools/depends/target/libcec/Makefile | 4 +-
+ tools/depends/target/p8-platform/Makefile | 34 ----
+ xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 192 ++++++++++++----------
+ xbmc/peripherals/devices/PeripheralCecAdapter.h | 17 +-
+ 9 files changed, 123 insertions(+), 138 deletions(-)
+ delete mode 100644 tools/depends/target/p8-platform/Makefile
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1453,9 +1453,9 @@
+ # libcec is dyloaded, so we need to check for its headers and link any depends.
+ if test "x$use_libcec" != "xno"; then
+ if test "x$use_libcec" != "xauto"; then
+- PKG_CHECK_MODULES([CEC],[libcec >= 4.0.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)])
++ PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_ERROR($libcec_disabled)])
+ else
+- PKG_CHECK_MODULES([CEC],[libcec >= 4.0.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
++ PKG_CHECK_MODULES([CEC],[libcec >= 3.0.0],,[use_libcec="no";AC_MSG_RESULT($libcec_disabled)])
+ fi
+
+ if test "x$use_libcec" != "xno"; then
+--- a/project/cmake/modules/FindCEC.cmake
++++ b/project/cmake/modules/FindCEC.cmake
+@@ -15,7 +15,7 @@
+ # CEC::CEC - The libCEC library
+
+ if(PKG_CONFIG_FOUND)
+- pkg_check_modules(PC_CEC libcec>=4.0.0 QUIET)
++ pkg_check_modules(PC_CEC libcec>=3.0.0 QUIET)
+ endif()
+
+ find_path(CEC_INCLUDE_DIR libcec/cec.h libCEC/CEC.h
+--- a/system/peripherals.xml
++++ b/system/peripherals.xml
+@@ -24,6 +24,7 @@
+ <setting key="connected_device" type="enum" label="36019" value="36037" lvalues="36037|36038" order="12" />
+ <setting key="cec_hdmi_port" type="int" value="1" min="1" max="15" label="36015" order="13" />
+ <setting key="physical_address" type="string" label="36021" value="0" order="14" />
++ <setting key="port" type="string" value="" label="36022" order="15" />
+
+ <setting key="tv_vendor" type="int" value="0" configurable="0" />
+ <setting key="device_name" type="string" value="Kodi" configurable="0" />
+--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+@@ -43,7 +43,7 @@
+ using namespace ANNOUNCEMENT;
+ using namespace CEC;
+
+-#define CEC_LIB_SUPPORTED_VERSION LIBCEC_VERSION_TO_UINT(4, 0, 0)
++#define CEC_LIB_SUPPORTED_VERSION LIBCEC_VERSION_TO_UINT(3, 0, 0)
+
+ /* time in seconds to ignore standby commands from devices after the screensaver has been activated */
+ #define SCREENSAVER_TIMEOUT 20
+@@ -119,30 +119,25 @@
+ m_dll->CECDestroy(m_cecAdapter);
+ m_cecAdapter = NULL;
+ delete m_dll;
+- m_dll = NULL;
+- m_bStarted = false;
+- m_bHasButton = false;
+- m_bIsReady = false;
+- m_bHasConnectedAudioSystem = false;
+- m_strMenuLanguage = "???";
+- m_lastKeypress = 0;
+- m_lastChange = VOLUME_CHANGE_NONE;
+- m_iExitCode = EXITCODE_QUIT;
+- m_bIsMuted = false; //! @todo fetch the correct initial value when system audiostatus is implemented in libCEC
+- m_bGoingToStandby = false;
+- m_bIsRunning = false;
+- m_bDeviceRemoved = false;
+- m_bActiveSourcePending = false;
+- m_bStandbyPending = false;
++ m_dll = NULL;
++ m_bStarted = false;
++ m_bHasButton = false;
++ m_bIsReady = false;
++ m_bHasConnectedAudioSystem = false;
++ m_strMenuLanguage = "???";
++ m_lastKeypress = 0;
++ m_lastChange = VOLUME_CHANGE_NONE;
++ m_iExitCode = EXITCODE_QUIT;
++ m_bIsMuted = false; //! @todo fetch the correct initial value when system audiostatus is implemented in libCEC
++ m_bGoingToStandby = false;
++ m_bIsRunning = false;
++ m_bDeviceRemoved = false;
++ m_bActiveSourcePending = false;
++ m_bStandbyPending = false;
+ m_bActiveSourceBeforeStandby = false;
+- m_bOnPlayReceived = false;
+- m_bPlaybackPaused = false;
+- m_queryThread = NULL;
+- m_bPowerOnScreensaver = false;
+- m_bUseTVMenuLanguage = false;
+- m_bSendInactiveSource = false;
+- m_bPowerOffScreensaver = false;
+- m_bShutdownOnStandby = false;
++ m_bOnPlayReceived = false;
++ m_bPlaybackPaused = false;
++ m_queryThread = NULL;
+
+ m_currentButton.iButton = 0;
+ m_currentButton.iDuration = 0;
+@@ -171,8 +166,8 @@
+ if (bIgnoreDeactivate)
+ CLog::Log(LOGDEBUG, "%s - ignoring OnScreensaverDeactivated for power action", __FUNCTION__);
+ }
+- if (m_bPowerOnScreensaver && !bIgnoreDeactivate &&
+- m_configuration.bActivateSource)
++ if (m_configuration.bPowerOnScreensaver == 1 && !bIgnoreDeactivate &&
++ m_configuration.bActivateSource == 1)
+ {
+ ActivateSource();
+ }
+@@ -180,7 +175,7 @@
+ else if (flag == GUI && !strcmp(sender, "xbmc") && !strcmp(message, "OnScreensaverActivated") && m_bIsReady)
+ {
+ // Don't put devices to standby if application is currently playing
+- if (!g_application.m_pPlayer->IsPlaying() && m_bPowerOffScreensaver)
++ if (!g_application.m_pPlayer->IsPlaying() && m_configuration.bPowerOffScreensaver == 1)
+ {
+ // only power off when we're the active source
+ if (m_cecAdapter->IsLibCECActiveSource())
+@@ -246,14 +241,14 @@
+
+ SetConfigurationFromSettings();
+ m_callbacks.Clear();
+- m_callbacks.logMessage = &CecLogMessage;
+- m_callbacks.keyPress = &CecKeyPress;
+- m_callbacks.commandReceived = &CecCommand;
+- m_callbacks.configurationChanged = &CecConfiguration;
+- m_callbacks.alert = &CecAlert;
+- m_callbacks.sourceActivated = &CecSourceActivated;
+- m_configuration.callbackParam = this;
+- m_configuration.callbacks = &m_callbacks;
++ m_callbacks.CBCecLogMessage = &CecLogMessage;
++ m_callbacks.CBCecKeyPress = &CecKeyPress;
++ m_callbacks.CBCecCommand = &CecCommand;
++ m_callbacks.CBCecConfigurationChanged = &CecConfiguration;
++ m_callbacks.CBCecAlert = &CecAlert;
++ m_callbacks.CBCecSourceActivated = &CecSourceActivated;
++ m_configuration.callbackParam = this;
++ m_configuration.callbacks = &m_callbacks;
+
+ m_dll = new DllLibCEC;
+ if (m_dll->Load() && m_dll->IsLoaded())
+@@ -419,7 +414,7 @@
+ m_standbySent = CDateTime::GetCurrentDateTime();
+ m_cecAdapter->StandbyDevices();
+ }
+- else if (m_bSendInactiveSource)
++ else if (m_configuration.bSendInactiveSource == 1)
+ {
+ CLog::Log(LOGDEBUG, "%s - sending inactive source commands", __FUNCTION__);
+ m_cecAdapter->SetInactiveView();
+@@ -619,43 +614,43 @@
+ CLog::Log(LOGWARNING, "%s - TV menu language set to unknown value '%s'", __FUNCTION__, strLanguage);
+ }
+
+-void CPeripheralCecAdapter::CecCommand(void *cbParam, const cec_command* command)
++int CPeripheralCecAdapter::CecCommand(void *cbParam, const cec_command command)
+ {
+- CPeripheralCecAdapter *adapter = static_cast<CPeripheralCecAdapter *>(cbParam);
++ CPeripheralCecAdapter *adapter = (CPeripheralCecAdapter *)cbParam;
+ if (!adapter)
+- return;
++ return 0;
+
+ if (adapter->m_bIsReady)
+ {
+- switch (command->opcode)
++ switch (command.opcode)
+ {
+ case CEC_OPCODE_STANDBY:
+ /* a device was put in standby mode */
+- if (command->initiator == CECDEVICE_TV &&
+- (adapter->m_configuration.bPowerOffOnStandby == 1 || adapter->m_bShutdownOnStandby) &&
++ if (command.initiator == CECDEVICE_TV &&
++ (adapter->m_configuration.bPowerOffOnStandby == 1 || adapter->m_configuration.bShutdownOnStandby == 1) &&
+ (!adapter->m_standbySent.IsValid() || CDateTime::GetCurrentDateTime() - adapter->m_standbySent > CDateTimeSpan(0, 0, 0, SCREENSAVER_TIMEOUT)))
+ {
+ adapter->m_bStarted = false;
+ if (adapter->m_configuration.bPowerOffOnStandby == 1)
+ g_application.ExecuteXBMCAction("Suspend");
+- else if (adapter->m_bShutdownOnStandby)
++ else if (adapter->m_configuration.bShutdownOnStandby == 1)
+ g_application.ExecuteXBMCAction("Shutdown");
+ }
+ break;
+ case CEC_OPCODE_SET_MENU_LANGUAGE:
+- if (adapter->m_bUseTVMenuLanguage == 1 && command->initiator == CECDEVICE_TV && command->parameters.size == 3)
++ if (adapter->m_configuration.bUseTVMenuLanguage == 1 && command.initiator == CECDEVICE_TV && command.parameters.size == 3)
+ {
+ char strNewLanguage[4];
+ for (int iPtr = 0; iPtr < 3; iPtr++)
+- strNewLanguage[iPtr] = command->parameters[iPtr];
++ strNewLanguage[iPtr] = command.parameters[iPtr];
+ strNewLanguage[3] = 0;
+ adapter->SetMenuLanguage(strNewLanguage);
+ }
+ break;
+ case CEC_OPCODE_DECK_CONTROL:
+- if (command->initiator == CECDEVICE_TV &&
+- command->parameters.size == 1 &&
+- command->parameters[0] == CEC_DECK_CONTROL_MODE_STOP)
++ if (command.initiator == CECDEVICE_TV &&
++ command.parameters.size == 1 &&
++ command.parameters[0] == CEC_DECK_CONTROL_MODE_STOP)
+ {
+ cec_keypress key;
+ key.duration = 500;
+@@ -664,17 +659,17 @@
+ }
+ break;
+ case CEC_OPCODE_PLAY:
+- if (command->initiator == CECDEVICE_TV &&
+- command->parameters.size == 1)
++ if (command.initiator == CECDEVICE_TV &&
++ command.parameters.size == 1)
+ {
+- if (command->parameters[0] == CEC_PLAY_MODE_PLAY_FORWARD)
++ if (command.parameters[0] == CEC_PLAY_MODE_PLAY_FORWARD)
+ {
+ cec_keypress key;
+ key.duration = 500;
+ key.keycode = CEC_USER_CONTROL_CODE_PLAY;
+ adapter->PushCecKeypress(key);
+ }
+- else if (command->parameters[0] == CEC_PLAY_MODE_PLAY_STILL)
++ else if (command.parameters[0] == CEC_PLAY_MODE_PLAY_STILL)
+ {
+ cec_keypress key;
+ key.duration = 500;
+@@ -687,23 +682,25 @@
+ break;
+ }
+ }
++ return 1;
+ }
+
+-void CPeripheralCecAdapter::CecConfiguration(void *cbParam, const libcec_configuration* config)
++int CPeripheralCecAdapter::CecConfiguration(void *cbParam, const libcec_configuration config)
+ {
+- CPeripheralCecAdapter *adapter = static_cast<CPeripheralCecAdapter *>(cbParam);
++ CPeripheralCecAdapter *adapter = (CPeripheralCecAdapter *)cbParam;
+ if (!adapter)
+- return;
++ return 0;
+
+ CSingleLock lock(adapter->m_critSection);
+- adapter->SetConfigurationFromLibCEC(*config);
++ adapter->SetConfigurationFromLibCEC(config);
++ return 1;
+ }
+
+-void CPeripheralCecAdapter::CecAlert(void *cbParam, const libcec_alert alert, const libcec_parameter data)
++int CPeripheralCecAdapter::CecAlert(void *cbParam, const libcec_alert alert, const libcec_parameter data)
+ {
+- CPeripheralCecAdapter *adapter = static_cast<CPeripheralCecAdapter *>(cbParam);
++ CPeripheralCecAdapter *adapter = (CPeripheralCecAdapter *)cbParam;
+ if (!adapter)
+- return;
++ return 0;
+
+ bool bReopenConnection(false);
+ int iAlertString(0);
+@@ -746,13 +743,18 @@
+ // calls this callback function synchronously and must not be destroyed meanwhile.
+ adapter->ReopenConnection(true);
+ }
++
++ return 1;
+ }
+
+-void CPeripheralCecAdapter::CecKeyPress(void *cbParam, const cec_keypress* key)
++int CPeripheralCecAdapter::CecKeyPress(void *cbParam, const cec_keypress key)
+ {
+- CPeripheralCecAdapter *adapter = static_cast<CPeripheralCecAdapter *>(cbParam);
+- if (!!adapter)
+- adapter->PushCecKeypress(*key);
++ CPeripheralCecAdapter *adapter = (CPeripheralCecAdapter *)cbParam;
++ if (!adapter)
++ return 0;
++
++ adapter->PushCecKeypress(key);
++ return 1;
+ }
+
+ void CPeripheralCecAdapter::GetNextKey(void)
+@@ -1152,7 +1154,7 @@
+
+ void CPeripheralCecAdapter::CecSourceActivated(void *cbParam, const CEC::cec_logical_address address, const uint8_t activated)
+ {
+- CPeripheralCecAdapter *adapter = static_cast<CPeripheralCecAdapter *>(cbParam);
++ CPeripheralCecAdapter *adapter = (CPeripheralCecAdapter *)cbParam;
+ if (!adapter)
+ return;
+
+@@ -1194,14 +1196,14 @@
+ }
+ }
+
+-void CPeripheralCecAdapter::CecLogMessage(void *cbParam, const cec_log_message* message)
++int CPeripheralCecAdapter::CecLogMessage(void *cbParam, const cec_log_message message)
+ {
+- CPeripheralCecAdapter *adapter = static_cast<CPeripheralCecAdapter *>(cbParam);
++ CPeripheralCecAdapter *adapter = (CPeripheralCecAdapter *)cbParam;
+ if (!adapter)
+- return;
++ return 0;
+
+ int iLevel = -1;
+- switch (message->level)
++ switch (message.level)
+ {
+ case CEC_LOG_ERROR:
+ iLevel = LOGERROR;
+@@ -1221,7 +1223,9 @@
+ }
+
+ if (iLevel >= CEC_LOG_NOTICE || (iLevel >= 0 && CLog::IsLogLevelLogged(LOGDEBUG) && g_advancedSettings.CanLogComponent(LOGCEC)))
+- CLog::Log(iLevel, "%s - %s", __FUNCTION__, message->message);
++ CLog::Log(iLevel, "%s - %s", __FUNCTION__, message.message);
++
++ return 1;
+ }
+
+ void CPeripheralCecAdapter::SetConfigurationFromLibCEC(const CEC::libcec_configuration &config)
+@@ -1266,18 +1270,35 @@
+ bChanged |= WriteLogicalAddresses(config.powerOffDevices, "standby_devices", "standby_devices_advanced");
+
+ // set the boolean settings
++ m_configuration.bUseTVMenuLanguage = config.bUseTVMenuLanguage;
++ bChanged |= SetSetting("use_tv_menu_language", m_configuration.bUseTVMenuLanguage == 1);
++
+ m_configuration.bActivateSource = config.bActivateSource;
+ bChanged |= SetSetting("activate_source", m_configuration.bActivateSource == 1);
+
++ m_configuration.bPowerOffScreensaver = config.bPowerOffScreensaver;
++ bChanged |= SetSetting("cec_standby_screensaver", m_configuration.bPowerOffScreensaver == 1);
++
++ m_configuration.bPowerOnScreensaver = config.bPowerOnScreensaver;
++ bChanged |= SetSetting("cec_wake_screensaver", m_configuration.bPowerOnScreensaver == 1);
++
+ m_configuration.bPowerOffOnStandby = config.bPowerOffOnStandby;
+
++ m_configuration.bSendInactiveSource = config.bSendInactiveSource;
++ bChanged |= SetSetting("send_inactive_source", m_configuration.bSendInactiveSource == 1);
++
+ m_configuration.iFirmwareVersion = config.iFirmwareVersion;
++ m_configuration.bShutdownOnStandby = config.bShutdownOnStandby;
+
+ memcpy(m_configuration.strDeviceLanguage, config.strDeviceLanguage, 3);
+ m_configuration.iFirmwareBuildDate = config.iFirmwareBuildDate;
+
+ SetVersionInfo(m_configuration);
+
++ bChanged |= SetSetting("standby_pc_on_tv_standby",
++ m_configuration.bPowerOffOnStandby == 1 ? 13011 :
++ m_configuration.bShutdownOnStandby == 1 ? 13005 : 36028);
++
+ if (bChanged)
+ CLog::Log(LOGDEBUG, "SetConfigurationFromLibCEC - settings updated by libCEC");
+ }
+@@ -1285,7 +1306,7 @@
+ void CPeripheralCecAdapter::SetConfigurationFromSettings(void)
+ {
+ // client version matches the version of libCEC that we originally used the API from
+- m_configuration.clientVersion = LIBCEC_VERSION_TO_UINT(4, 0, 0);
++ m_configuration.clientVersion = LIBCEC_VERSION_TO_UINT(3, 0, 0);
+
+ // device name 'XBMC'
+ snprintf(m_configuration.strDeviceName, 13, "%s", GetSettingString("device_name").c_str());
+@@ -1352,16 +1373,16 @@
+ ReadLogicalAddresses(GetSettingInt("standby_devices"), m_configuration.powerOffDevices);
+
+ // read the boolean settings
+- m_bUseTVMenuLanguage = GetSettingBool("use_tv_menu_language") ? 1 : 0;
++ m_configuration.bUseTVMenuLanguage = GetSettingBool("use_tv_menu_language") ? 1 : 0;
+ m_configuration.bActivateSource = GetSettingBool("activate_source") ? 1 : 0;
+- m_bPowerOffScreensaver = GetSettingBool("cec_standby_screensaver") ? 1 : 0;
+- m_bPowerOnScreensaver = GetSettingBool("cec_wake_screensaver") ? 1 : 0;
+- m_bSendInactiveSource = GetSettingBool("send_inactive_source") ? 1 : 0;
++ m_configuration.bPowerOffScreensaver = GetSettingBool("cec_standby_screensaver") ? 1 : 0;
++ m_configuration.bPowerOnScreensaver = GetSettingBool("cec_wake_screensaver") ? 1 : 0;
++ m_configuration.bSendInactiveSource = GetSettingBool("send_inactive_source") ? 1 : 0;
+
+ // read the mutually exclusive boolean settings
+ int iStandbyAction(GetSettingInt("standby_pc_on_tv_standby"));
+ m_configuration.bPowerOffOnStandby = iStandbyAction == 13011 ? 1 : 0;
+- m_bShutdownOnStandby = iStandbyAction == 13005;
++ m_configuration.bShutdownOnStandby = iStandbyAction == 13005 ? 1 : 0;
+
+ #if defined(CEC_DOUBLE_TAP_TIMEOUT_MS_OLD)
+ // double tap prevention timeout in ms. libCEC uses 50ms units for this in 2.2.0, so divide by 50
+@@ -1508,11 +1529,14 @@
+ void CPeripheralCecAdapterUpdateThread::UpdateMenuLanguage(void)
+ {
+ // request the menu language of the TV
+- if (m_adapter->m_bUseTVMenuLanguage == 1)
++ if (m_configuration.bUseTVMenuLanguage == 1)
+ {
+ CLog::Log(LOGDEBUG, "%s - requesting the menu language of the TV", __FUNCTION__);
+- std::string language(m_adapter->m_cecAdapter->GetDeviceMenuLanguage(CECDEVICE_TV));
+- m_adapter->SetMenuLanguage(language.c_str());
++ cec_menu_language language;
++ if (m_adapter->m_cecAdapter->GetDeviceMenuLanguage(CECDEVICE_TV, &language))
++ m_adapter->SetMenuLanguage(language.language);
++ else
++ CLog::Log(LOGDEBUG, "%s - unknown menu language", __FUNCTION__);
+ }
+ else
+ {
+@@ -1529,9 +1553,9 @@
+ if (m_adapter->m_cecAdapter->IsActiveDeviceType(CEC_DEVICE_TYPE_AUDIO_SYSTEM))
+ {
+ // request the OSD name of the amp
+- std::string ampName(m_adapter->m_cecAdapter->GetDeviceOSDName(CECDEVICE_AUDIOSYSTEM));
+- CLog::Log(LOGDEBUG, "%s - CEC capable amplifier found (%s). volume will be controlled on the amp", __FUNCTION__, ampName.c_str());
+- strAmpName += StringUtils::Format("%s", ampName.c_str());
++ cec_osd_name ampName = m_adapter->m_cecAdapter->GetDeviceOSDName(CECDEVICE_AUDIOSYSTEM);
++ CLog::Log(LOGDEBUG, "%s - CEC capable amplifier found (%s). volume will be controlled on the amp", __FUNCTION__, ampName.name);
++ strAmpName += StringUtils::Format("%s", ampName.name);
+
+ // set amp present
+ m_adapter->SetAudioSystemConnected(true);
+@@ -1568,8 +1592,8 @@
+
+ // request the OSD name of the TV
+ std::string strNotification;
+- std::string tvName(m_adapter->m_cecAdapter->GetDeviceOSDName(CECDEVICE_TV));
+- strNotification = StringUtils::Format("%s: %s", g_localizeStrings.Get(36016).c_str(), tvName.c_str());
++ cec_osd_name tvName = m_adapter->m_cecAdapter->GetDeviceOSDName(CECDEVICE_TV);
++ strNotification = StringUtils::Format("%s: %s", g_localizeStrings.Get(36016).c_str(), tvName.name);
+
+ std::string strAmpName = UpdateAudioSystemStatus();
+ if (!strAmpName.empty())
+@@ -1742,7 +1766,7 @@
+ m_standbySent = CDateTime::GetCurrentDateTime();
+ m_cecAdapter->StandbyDevices(CECDEVICE_BROADCAST);
+ }
+- else if (m_bSendInactiveSource == 1)
++ else if (m_configuration.bSendInactiveSource == 1)
+ {
+ CLog::Log(LOGDEBUG, "%s - sending inactive source commands", __FUNCTION__);
+ m_cecAdapter->SetInactiveView();
+--- a/xbmc/peripherals/devices/PeripheralCecAdapter.h
++++ b/xbmc/peripherals/devices/PeripheralCecAdapter.h
+@@ -146,12 +146,12 @@
+ void SetMenuLanguage(const char *strLanguage);
+
+ // callbacks from libCEC
+- static void CecLogMessage(void *cbParam, const CEC::cec_log_message* message);
+- static void CecCommand(void *cbParam, const CEC::cec_command* command);
+- static void CecConfiguration(void *cbParam, const CEC::libcec_configuration* config);
+- static void CecAlert(void *cbParam, const CEC::libcec_alert alert, const CEC::libcec_parameter data);
++ static int CecLogMessage(void *cbParam, const CEC::cec_log_message message);
++ static int CecCommand(void *cbParam, const CEC::cec_command command);
++ static int CecConfiguration(void *cbParam, const CEC::libcec_configuration config);
++ static int CecAlert(void *cbParam, const CEC::libcec_alert alert, const CEC::libcec_parameter data);
+ static void CecSourceActivated(void *param, const CEC::cec_logical_address address, const uint8_t activated);
+- static void CecKeyPress(void *cbParam, const CEC::cec_keypress* key);
++ static int CecKeyPress(void *cbParam, const CEC::cec_keypress key);
+
+ DllLibCEC* m_dll;
+ CEC::ICECAdapter* m_cecAdapter;
+@@ -181,12 +181,7 @@
+ bool m_bActiveSourceBeforeStandby;
+ bool m_bOnPlayReceived;
+ bool m_bPlaybackPaused;
+- std::string m_strComPort;
+- bool m_bPowerOnScreensaver;
+- bool m_bUseTVMenuLanguage;
+- bool m_bSendInactiveSource;
+- bool m_bPowerOffScreensaver;
+- bool m_bShutdownOnStandby;
++ std::string m_strComPort;
+ };
+
+ class CPeripheralCecAdapterUpdateThread : public CThread
diff --git a/debian/patches/series b/debian/patches/series
index 2042f74..337da1d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,6 +2,11 @@
0002-StringUtils-Fix-format-string.patch
0003-Revert-droid-fix-builds-with-AML-disabled.patch
0004-Allocate-and-free-AVFrames-with-the-proper-FFmpeg-AP.patch
+0005-Revert-cmake-Properly-find-correct-libcec-version.patch
+0006-Revert-cec-added-setting-to-make-libCEC-wake-up-the-.patch
+0007-Revert-cec-add-CEC-IMX-adapter-as-known-type-and-set.patch
+0008-Revert-cec-Added-advanced-settings-for-action-when-T.patch
+0009-Revert-cec-bump-to-libCEC-4.0.0.patch
01_reproducible_build.patch
02_allow_all_arches.patch
03-privacy.patch
--
kodi packaging
More information about the pkg-multimedia-commits
mailing list