From: Lars Op den Kamp Date: Sat, 9 Mar 2013 14:51:31 +0000 (+0100) Subject: Merge branch 'master' into release X-Git-Tag: upstream/2.2.0~1^2~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=605d913ae656ef9707a7f9cbca41f78d180d79dc;hp=5984da46635e73076ebfc7df0b39811d9978f1c3;p=deb_libcec.git Merge branch 'master' into release --- diff --git a/ChangeLog b/ChangeLog index 79f81e6..ab93e67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,30 @@ -libcec (2.1.0-1) unstable; urgency=low +libcec (2.1.1-1) unstable; urgency=low + + * changed / added: + * send an alert when the TV does not respond to polls + * fixed: + * LG didn't switch sources after the TV powered up + * always poll a device when the status is unknown, and don't try to + determine whether it needs to be polled by checking the status of other + devices + * don't mark a device as inactive when receiving a routing change message, + only when another device was made acive. fixes the issue that rc + passthrough doesn't work when a tv sends a quick routing change to + another port before requesting the active source when coming out of + standby + * LibCecSharp: fixed 14 char long OSD name (wasn't \0 terminated) + * LibCecSharp: fixed return value of GetActiveDevices(). issue #131 + * cec-tray: fixed index out of range exception in CECSettingNumeric.cs. + bugzid: 2082 + * cec-tray: ensure that the tray app only initialises once. bugzid: 2082 + * rpi: don't set the physical address to 1.0.0.0 when receiving + VC_HDMI_UNPLUGGED. it may wake up device when they were just sent to + standby. issue #142 + * osx: use the correct dylib name in cecloader.h, used by cec-client + + -- Pulse-Eight Packaging Fri, 8 Mar 2013 17:21:00 +0100 + + libcec (2.1.0-1) unstable; urgency=low * changed / added: * added vendor id for Denon diff --git a/debian/changelog b/debian/changelog index 79f81e6..ab93e67 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,30 @@ -libcec (2.1.0-1) unstable; urgency=low +libcec (2.1.1-1) unstable; urgency=low + + * changed / added: + * send an alert when the TV does not respond to polls + * fixed: + * LG didn't switch sources after the TV powered up + * always poll a device when the status is unknown, and don't try to + determine whether it needs to be polled by checking the status of other + devices + * don't mark a device as inactive when receiving a routing change message, + only when another device was made acive. fixes the issue that rc + passthrough doesn't work when a tv sends a quick routing change to + another port before requesting the active source when coming out of + standby + * LibCecSharp: fixed 14 char long OSD name (wasn't \0 terminated) + * LibCecSharp: fixed return value of GetActiveDevices(). issue #131 + * cec-tray: fixed index out of range exception in CECSettingNumeric.cs. + bugzid: 2082 + * cec-tray: ensure that the tray app only initialises once. bugzid: 2082 + * rpi: don't set the physical address to 1.0.0.0 when receiving + VC_HDMI_UNPLUGGED. it may wake up device when they were just sent to + standby. issue #142 + * osx: use the correct dylib name in cecloader.h, used by cec-client + + -- Pulse-Eight Packaging Fri, 8 Mar 2013 17:21:00 +0100 + + libcec (2.1.0-1) unstable; urgency=low * changed / added: * added vendor id for Denon diff --git a/include/cecloader.h b/include/cecloader.h index 190f3f8..6c7c97a 100644 --- a/include/cecloader.h +++ b/include/cecloader.h @@ -130,7 +130,7 @@ CEC::ICECAdapter *LibCecInitialise(CEC::libcec_configuration *configuration, con if (!g_libCEC) { #if defined(__APPLE__) - g_libCEC = dlopen(strLib ? strLib : "libcec.dylib", RTLD_LAZY); + g_libCEC = dlopen(strLib ? strLib : "libcec." CEC_LIB_VERSION_MAJOR_STR ".dylib", RTLD_LAZY); #else g_libCEC = dlopen(strLib ? strLib : "libcec.so." CEC_LIB_VERSION_MAJOR_STR, RTLD_LAZY); #endif diff --git a/include/cectypes.h b/include/cectypes.h index 0b62529..e8670f8 100644 --- a/include/cectypes.h +++ b/include/cectypes.h @@ -1281,7 +1281,8 @@ typedef enum libcec_alert CEC_ALERT_CONNECTION_LOST, CEC_ALERT_PERMISSION_ERROR, CEC_ALERT_PORT_BUSY, - CEC_ALERT_PHYSICAL_ADDRESS_ERROR + CEC_ALERT_PHYSICAL_ADDRESS_ERROR, + CEC_ALERT_TV_POLL_FAILED } libcec_alert; typedef enum libcec_parameter_type @@ -1405,7 +1406,8 @@ typedef enum cec_client_version CEC_CLIENT_VERSION_2_0_4 = 0x2004, CEC_CLIENT_VERSION_2_0_5 = 0x2005, CEC_CLIENT_VERSION_2_1_0 = 0x2100, - CEC_CLIENT_VERSION_CURRENT = 0x2100 + CEC_CLIENT_VERSION_2_1_1 = 0x2101, + CEC_CLIENT_VERSION_CURRENT = 0x2101 } cec_client_version; typedef enum cec_server_version @@ -1434,7 +1436,8 @@ typedef enum cec_server_version CEC_SERVER_VERSION_2_0_4 = 0x2004, CEC_SERVER_VERSION_2_0_5 = 0x2005, CEC_SERVER_VERSION_2_1_0 = 0x2100, - CEC_SERVER_VERSION_CURRENT = 0x2100 + CEC_SERVER_VERSION_2_1_1 = 0x2101, + CEC_SERVER_VERSION_CURRENT = 0x2101 } cec_server_version; struct libcec_configuration diff --git a/project/libCEC.nsi b/project/libCEC.nsi index 3a34ab4..a7516d6 100644 --- a/project/libCEC.nsi +++ b/project/libCEC.nsi @@ -7,7 +7,7 @@ !include "LogicLib.nsh" !include "x64.nsh" -Name "Pulse-Eight libCEC version 2.1.0" +Name "Pulse-Eight libCEC version 2.1.1" OutFile "..\build\libCEC-installer.exe" XPStyle on diff --git a/project/libcec.rc b/project/libcec.rc index 3b766b5..0f65c99 100644 Binary files a/project/libcec.rc and b/project/libcec.rc differ diff --git a/project/testclient.rc b/project/testclient.rc index 161e867..20d3b90 100644 Binary files a/project/testclient.rc and b/project/testclient.rc differ diff --git a/src/CecSharpTester/Properties/AssemblyInfo.cs b/src/CecSharpTester/Properties/AssemblyInfo.cs index f76423a..c955c60 100644 --- a/src/CecSharpTester/Properties/AssemblyInfo.cs +++ b/src/CecSharpTester/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff --git a/src/LibCecSharp/AssemblyInfo.cpp b/src/LibCecSharp/AssemblyInfo.cpp index 441eca8..8bf6de3 100644 --- a/src/LibCecSharp/AssemblyInfo.cpp +++ b/src/LibCecSharp/AssemblyInfo.cpp @@ -13,7 +13,7 @@ using namespace System::Security::Permissions; [assembly:AssemblyTrademarkAttribute("")]; [assembly:AssemblyCultureAttribute("")]; -[assembly:AssemblyVersionAttribute("2.1.0.0")]; +[assembly:AssemblyVersionAttribute("2.1.1.0")]; [assembly:ComVisible(false)]; [assembly:CLSCompliantAttribute(true)]; diff --git a/src/LibCecSharp/CecSharpTypes.h b/src/LibCecSharp/CecSharpTypes.h index c7636a1..ac2b93b 100644 --- a/src/LibCecSharp/CecSharpTypes.h +++ b/src/LibCecSharp/CecSharpTypes.h @@ -1191,7 +1191,11 @@ namespace CecSharp /// /// v2.1.0 /// - Version2_1_0 = 0x2100 + Version2_1_0 = 0x2100, + /// + /// v2.1.1 + /// + Version2_1_1 = 0x2101 }; /// @@ -1294,7 +1298,11 @@ namespace CecSharp /// /// v2.1.0 /// - Version2_1_0 = 0x2100 + Version2_1_0 = 0x2100, + /// + /// v2.1.1 + /// + Version2_1_1 = 0x2101 }; /// @@ -1685,8 +1693,8 @@ namespace CecSharp PhysicalAddress = CEC_DEFAULT_PHYSICAL_ADDRESS; BaseDevice = (CecLogicalAddress)CEC_DEFAULT_BASE_DEVICE; HDMIPort = CEC_DEFAULT_HDMI_PORT; - ClientVersion = CecClientVersion::Version2_1_0; - ServerVersion = CecServerVersion::Version2_1_0; + ClientVersion = CecClientVersion::Version2_1_1; + ServerVersion = CecServerVersion::Version2_1_1; TvVendor = CecVendorId::Unknown; GetSettingsFromROM = false; diff --git a/src/LibCecSharp/LibCecSharp.cpp b/src/LibCecSharp/LibCecSharp.cpp index ecb9bea..0bae3ea 100644 --- a/src/LibCecSharp/LibCecSharp.cpp +++ b/src/LibCecSharp/LibCecSharp.cpp @@ -377,7 +377,7 @@ namespace CecSharp for (uint8_t iPtr = 0; iPtr < 16; iPtr++) if (activeDevices[iPtr]) - retVal->Addresses[iDevices++] = (CecLogicalAddress)iPtr; + retVal->Set((CecLogicalAddress)iPtr); return retVal; } @@ -474,7 +474,11 @@ namespace CecSharp String ^ GetDeviceOSDName(CecLogicalAddress logicalAddress) { cec_osd_name osd = m_libCec->GetDeviceOSDName((cec_logical_address) logicalAddress); - return gcnew String(osd.name); + // we need to terminate with \0, and we only got 14 chars in osd.name + char strOsdName[15]; + memset(strOsdName, 0, sizeof(strOsdName)); + memcpy(strOsdName, osd.name, sizeof(osd.name)); + return gcnew String(strOsdName); } /// diff --git a/src/LibCecTray/Properties/AssemblyInfo.cs b/src/LibCecTray/Properties/AssemblyInfo.cs index 10d7be7..31f6311 100644 --- a/src/LibCecTray/Properties/AssemblyInfo.cs +++ b/src/LibCecTray/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff --git a/src/LibCecTray/Properties/Resources.Designer.cs b/src/LibCecTray/Properties/Resources.Designer.cs index 0285bd3..1f62e34 100644 --- a/src/LibCecTray/Properties/Resources.Designer.cs +++ b/src/LibCecTray/Properties/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5448 +// Runtime Version:2.0.50727.5466 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -304,7 +304,7 @@ namespace LibCECTray.Properties { } /// - /// Looks up a localized string similar to Pulse-Eight USB-CEC Adapter - libCECTray BETA3. + /// Looks up a localized string similar to Pulse-Eight USB-CEC Adapter - libCECTray. /// internal static string app_name { get { diff --git a/src/LibCecTray/Properties/Resources.resx b/src/LibCecTray/Properties/Resources.resx index 14f481e..8cf1fae 100644 --- a/src/LibCecTray/Properties/Resources.resx +++ b/src/LibCecTray/Properties/Resources.resx @@ -121,7 +121,7 @@ Could not detect to any CEC adapter. Please check your configuration. Do you want to try again? - Pulse-Eight USB-CEC Adapter - libCECTray BETA3 + Pulse-Eight USB-CEC Adapter - libCECTray You have changed the device type. Persist the configuration, and restart the application to use the new setting. diff --git a/src/LibCecTray/controller/CECController.cs b/src/LibCecTray/controller/CECController.cs index c1a6ed3..94fac2e 100644 --- a/src/LibCecTray/controller/CECController.cs +++ b/src/LibCecTray/controller/CECController.cs @@ -203,6 +203,11 @@ namespace LibCECTray.controller /// public void Initialise() { + // only load once + if (_initialised) + return; + _initialised = true; + CECActions.ConnectToDevice(Config); Applications.Initialise(this); } @@ -215,6 +220,7 @@ namespace LibCECTray.controller Lib.DisableCallbacks(); Lib.StandbyDevices(CecLogicalAddress.Broadcast); Lib.Close(); + _initialised = false; } /// @@ -519,6 +525,7 @@ namespace LibCECTray.controller private readonly CECTray _gui; public Actions CECActions; private bool _deviceChangeWarningDisplayed; + private bool _initialised; #endregion } diff --git a/src/LibCecTray/settings/CECSettingNumeric.cs b/src/LibCecTray/settings/CECSettingNumeric.cs index 44f856a..9038915 100644 --- a/src/LibCecTray/settings/CECSettingNumeric.cs +++ b/src/LibCecTray/settings/CECSettingNumeric.cs @@ -158,10 +158,13 @@ namespace LibCECTray.settings ResetItems(BaseItems.Count == 0); - control.SelectedValueChanged += delegate - { - Value = BaseItems[control.SelectedIndex]; - }; + if (BaseItems.Count > 0 && control.SelectedIndex < BaseItems.Count) + { + control.SelectedValueChanged += delegate + { + Value = BaseItems[control.SelectedIndex]; + }; + } } public override Control ValueControl diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 84a46d6..bfed4c3 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -53,6 +53,7 @@ using namespace PLATFORM; #define CEC_PROCESSOR_SIGNAL_WAIT_TIME 1000 #define ACTIVE_SOURCE_CHECK_INTERVAL 500 +#define TV_PRESENT_CHECK_INTERVAL 30000 #define ToString(x) CCECTypeUtils::ToString(x) @@ -216,6 +217,7 @@ void *CCECProcessor::Process(void) cec_command command; command.Clear(); CTimeout activeSourceCheck(ACTIVE_SOURCE_CHECK_INTERVAL); + CTimeout tvPresentCheck(TV_PRESENT_CHECK_INTERVAL); // as long as we're not being stopped and the connection is open while (!IsStopped() && m_communication->IsOpen()) @@ -239,6 +241,19 @@ void *CCECProcessor::Process(void) TransmitPendingActiveSourceCommands(); activeSourceCheck.Init(ACTIVE_SOURCE_CHECK_INTERVAL); } + + // check whether the TV is present and responding + if (tvPresentCheck.TimeLeft() == 0) + { + if (!m_busDevices->At(CECDEVICE_TV)->IsPresent()) + { + libcec_parameter param; + param.paramType = CEC_PARAMETER_TYPE_STRING; + param.paramData = (void*)"TV does not respond to CEC polls"; + GetPrimaryClient()->Alert(CEC_ALERT_TV_POLL_FAILED, param); + } + tvPresentCheck.Init(TV_PRESENT_CHECK_INTERVAL); + } } } diff --git a/src/lib/CECTypeUtils.h b/src/lib/CECTypeUtils.h index 065d684..4b406f1 100644 --- a/src/lib/CECTypeUtils.h +++ b/src/lib/CECTypeUtils.h @@ -571,6 +571,8 @@ namespace CEC return "2.0.5"; case CEC_CLIENT_VERSION_2_1_0: return "2.1.0"; + case CEC_CLIENT_VERSION_2_1_1: + return "2.1.1"; default: return "Unknown"; } @@ -628,6 +630,8 @@ namespace CEC return "2.0.5"; case CEC_SERVER_VERSION_2_1_0: return "2.1.0"; + case CEC_SERVER_VERSION_2_1_1: + return "2.1.1"; default: return "Unknown"; } diff --git a/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp b/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp index a68c0ec..76c61b3 100644 --- a/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp +++ b/src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp @@ -118,17 +118,13 @@ void CRPiCECAdapterCommunication::OnTVServiceCallback(uint32_t reason, uint32_t { switch(reason) { - case VC_HDMI_UNPLUGGED: - { - m_callback->HandlePhysicalAddressChanged(0x1000); - break; - } case VC_HDMI_ATTACHED: { uint16_t iNewAddress = GetPhysicalAddress(); m_callback->HandlePhysicalAddressChanged(iNewAddress); break; } + case VC_HDMI_UNPLUGGED: case VC_HDMI_DVI: case VC_HDMI_HDMI: case VC_HDMI_HDCP_UNAUTH: diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 9d172d8..e249a0b 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -781,7 +781,7 @@ cec_bus_device_status CCECBusDevice::GetStatus(bool bForcePoll /* = false */, bo if (bNeedsPoll) { bool bPollAcked(false); - if (bNeedsPoll && NeedsPoll()) + if (bNeedsPoll) bPollAcked = m_processor->PollDevice(m_iLogicalAddress); status = bPollAcked ? CEC_DEVICE_STATUS_PRESENT : CEC_DEVICE_STATUS_NOT_PRESENT; @@ -1143,17 +1143,6 @@ void CCECBusDevice::SetActiveRoute(uint16_t iRoute) else newRoute->MarkAsActiveSource(); } - else - { - // get the current active source and it's physical address - CCECBusDevice *device = m_processor->GetDevices()->GetActiveSource(); - uint16_t iPhysicalAddress(device ? device->GetCurrentPhysicalAddress() : CEC_INVALID_PHYSICAL_ADDRESS); - - // check whether the route below the device changed - if (CLibCEC::IsValidPhysicalAddress(iPhysicalAddress) && - !CCECTypeUtils::PhysicalAddressIsIncluded(iPhysicalAddress, iRoute)) - device->MarkAsInactiveSource(); - } } void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */) diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index e3062bf..ec12b02 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -194,6 +194,10 @@ void CSLCommandHandler::HandleVendorCommand01(const cec_command &command) { m_processor->GetPrimaryDevice()->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON); TransmitVendorCommand0205(command.destination, command.initiator); + + CCECBusDevice* dev = m_processor->GetDevice(command.destination); + if (dev && dev->IsHandledByLibCEC() && dev->IsActiveSource()) + dev->TransmitActiveSource(false); } void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSource, const cec_logical_address iDestination) @@ -204,6 +208,7 @@ void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSou response.PushBack(SL_COMMAND_TYPE_HDDRECORDER); Transmit(response, false, true); + SetSLInitialised(); } void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command)