Merge branch 'master' into release
authorLars Op den Kamp <lars@opdenkamp.eu>
Sat, 9 Mar 2013 14:51:31 +0000 (15:51 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Sat, 9 Mar 2013 14:51:31 +0000 (15:51 +0100)
21 files changed:
ChangeLog
debian/changelog
include/cecloader.h
include/cectypes.h
project/libCEC.nsi
project/libcec.rc
project/testclient.rc
src/CecSharpTester/Properties/AssemblyInfo.cs
src/LibCecSharp/AssemblyInfo.cpp
src/LibCecSharp/CecSharpTypes.h
src/LibCecSharp/LibCecSharp.cpp
src/LibCecTray/Properties/AssemblyInfo.cs
src/LibCecTray/Properties/Resources.Designer.cs
src/LibCecTray/Properties/Resources.resx
src/LibCecTray/controller/CECController.cs
src/LibCecTray/settings/CECSettingNumeric.cs
src/lib/CECProcessor.cpp
src/lib/CECTypeUtils.h
src/lib/adapter/RPi/RPiCECAdapterCommunication.cpp
src/lib/devices/CECBusDevice.cpp
src/lib/implementations/SLCommandHandler.cpp

index 79f81e6ca0b906712b87d39086b7d1fb5cba1739..ab93e67103474a54af6068a0c39bfca0a31119a4 100644 (file)
--- 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 <packaging@pulse-eight.com>  Fri, 8 Mar 2013 17:21:00 +0100
+ libcec (2.1.0-1) unstable; urgency=low
 
   * changed / added:
     * added vendor id for Denon
index 79f81e6ca0b906712b87d39086b7d1fb5cba1739..ab93e67103474a54af6068a0c39bfca0a31119a4 100644 (file)
@@ -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 <packaging@pulse-eight.com>  Fri, 8 Mar 2013 17:21:00 +0100
+ libcec (2.1.0-1) unstable; urgency=low
 
   * changed / added:
     * added vendor id for Denon
index 190f3f87bef2d920b9a602f29fd60b06e92d1dda..6c7c97a04d417167eeceed71d18d3e0f1c5c3374 100644 (file)
@@ -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
index 0b62529fda39b8abf986e76e0b6d44eda2f42cd1..e8670f8e7df2fa1c900e8f378f929b68533076a2 100644 (file)
@@ -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
index 3a34ab4ee35a15a48256fa0eb04fb8f11781948f..a7516d669721ef9ff478421db375a59afad05425 100644 (file)
@@ -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
index 3b766b503d42d16e5a53191062990107b65b9f6a..0f65c996e1e71a34e343e11233905d17a9ca1645 100644 (file)
Binary files a/project/libcec.rc and b/project/libcec.rc differ
index 161e867088f8e8109cff9b74662049a9dba3832a..20d3b9090f22fbf33a9b10ac4c9f43c79ffc89fb 100644 (file)
Binary files a/project/testclient.rc and b/project/testclient.rc differ
index f76423a2dd14664a8c6f8f398ed873d5a489b475..c955c60ed057882b8316b2338e511f2cdd10388b 100644 (file)
@@ -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")]
index 441eca8592a42dccd326e2fb045730d1962e27d9..8bf6de300f7313060d13e9e9b3b8e1fea5563fa0 100644 (file)
@@ -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)];
index c7636a1551bf2cc0696a66c0c942b482673c7319..ac2b93b91f95cbb945c3633a991a1151415cbbaf 100644 (file)
@@ -1191,7 +1191,11 @@ namespace CecSharp
     /// <summary>
     /// v2.1.0
     /// </summary>
-    Version2_1_0   = 0x2100
+    Version2_1_0   = 0x2100,
+    /// <summary>
+    /// v2.1.1
+    /// </summary>
+    Version2_1_1   = 0x2101
   };
 
   /// <summary>
@@ -1294,7 +1298,11 @@ namespace CecSharp
     /// <summary>
     /// v2.1.0
     /// </summary>
-    Version2_1_0   = 0x2100
+    Version2_1_0   = 0x2100,
+    /// <summary>
+    /// v2.1.1
+    /// </summary>
+    Version2_1_1   = 0x2101
   };
 
   /// <summary>
@@ -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;
index ecb9bea9223f0f74abefa161f3f7f08818df7078..0bae3eaca39e9d820f49b605968b6e39d78fa580 100644 (file)
@@ -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);
     }
 
     /// <summary>
index 10d7be7cfd5677c316b209868c7afe4051a64f90..31f6311a2c723dcb17c05ca4794970615dd56a4c 100644 (file)
@@ -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")]
index 0285bd39a57a66261f755804a74171e4ae367b23..1f62e34a18705a61edf4478322c00491d717feb0 100644 (file)
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     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 {
         }
         
         /// <summary>
-        ///   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.
         /// </summary>
         internal static string app_name {
             get {
index 14f481e8d75ede866490a9901b4b73ee6f2ca8dc..8cf1fae8f719dfc00c9420e8a056edebd90bc006 100644 (file)
     <value>Could not detect to any CEC adapter. Please check your configuration. Do you want to try again?</value>
   </data>
   <data name="app_name" xml:space="preserve">
-    <value>Pulse-Eight USB-CEC Adapter - libCECTray BETA3</value>
+    <value>Pulse-Eight USB-CEC Adapter - libCECTray</value>
   </data>
   <data name="device_type_changed" xml:space="preserve">
     <value>You have changed the device type. Persist the configuration, and restart the application to use the new setting.</value>
index c1a6ed32e29c26411121a2686d0e8709d680488a..94fac2e4349e0bc4c76ecb83aab13f2ac6f8232e 100644 (file)
@@ -203,6 +203,11 @@ namespace LibCECTray.controller
     /// </summary>
     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;
     }
 
     /// <summary>
@@ -519,6 +525,7 @@ namespace LibCECTray.controller
     private readonly CECTray _gui;
     public Actions CECActions;
     private bool _deviceChangeWarningDisplayed;
+    private bool _initialised;
 
     #endregion
   }
index 44f856a0681c9142a1fbeab362779fd235f55099..903891536b55fdddd972d56131c5412d89ab4c58 100644 (file)
@@ -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
index 84a46d635e01823a7fb7bcff25adcb666fcdf36b..bfed4c3f53a43965fe5ee854240d00bbd7bd0c69 100644 (file)
@@ -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);
+      }
     }
   }
 
index 065d6849f605f0e8d5587abf1ce52b5058762e2a..4b406f12edf271a641f01f1d9d7855688191932d 100644 (file)
@@ -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";
       }
index a68c0ec64227ec6aa6f318bc20ecb33e6baf50e0..76c61b3bb5a2fb922cf206cc7cbafd011d5c9c62 100644 (file)
@@ -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:
index 9d172d88a7ccec657bd09af093d2e92d03c0e821..e249a0b3c45dda279bc73182ce48dce7b26b396c 100644 (file)
@@ -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 */)
index e3062bf704cbc4564a59df2c58589fa983cb192a..ec12b0226f7279191c1d92c6c7472ce1e166dc35 100644 (file)
@@ -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)