fixed: mark the TV as 'in transition standby -> on' after sending 'image view on...
authorLars Op den Kamp <lars@opdenkamp.eu>
Tue, 13 Nov 2012 13:14:09 +0000 (14:14 +0100)
committerLars Op den Kamp <lars@opdenkamp.eu>
Tue, 13 Nov 2012 13:14:12 +0000 (14:14 +0100)
src/lib/devices/CECBusDevice.cpp
src/lib/devices/CECBusDevice.h

index 4234ec72254d0ee436e352588f3c6c5c1f797488..bfb546f8badd6303ffeb2ceae5fa9085e10755ce 100644 (file)
@@ -613,6 +613,17 @@ void CCECBusDevice::SetPowerStatus(const cec_power_status powerStatus)
   }
 }
 
+void CCECBusDevice::ImageViewOnSent(void)
+{
+  CLockObject lock(m_mutex);
+  if (m_powerStatus != CEC_POWER_STATUS_ON && m_powerStatus != CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON)
+  {
+    m_iLastPowerStateUpdate = GetTimeMs();
+    LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): power status changed from '%s' to '%s'", GetLogicalAddressName(), m_iLogicalAddress, ToString(m_powerStatus), ToString(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON));
+    m_powerStatus = CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON;
+  }
+}
+
 bool CCECBusDevice::RequestPowerStatus(const cec_logical_address initiator, bool bWaitForResponse /* = true */)
 {
   bool bReturn(false);
@@ -1052,6 +1063,14 @@ bool CCECBusDevice::TransmitImageViewOn(void)
   MarkBusy();
   bImageViewOnSent = m_handler->TransmitImageViewOn(m_iLogicalAddress, CECDEVICE_TV);
   MarkReady();
+
+  if (bImageViewOnSent)
+  {
+    CCECBusDevice* tv = m_processor->GetDevice(CECDEVICE_TV);
+    if (tv)
+      tv->ImageViewOnSent();
+  }
+
   return bImageViewOnSent;
 }
 
index 1abf488a8aa36aff0f2f35df901891d041bb7b0f..e0c2f9c34a023f202c12cb03fdec2c74dafa42f1 100644 (file)
@@ -192,6 +192,7 @@ namespace CEC
     virtual cec_power_status      GetCurrentPowerStatus(void);
     virtual cec_power_status      GetPowerStatus(const cec_logical_address initiator, bool bUpdate = false);
     virtual void                  SetPowerStatus(const cec_power_status powerStatus);
+    virtual void                  ImageViewOnSent(void);
     virtual bool                  RequestPowerStatus(const cec_logical_address initiator, bool bWaitForResponse = true);
     virtual bool                  TransmitPowerState(const cec_logical_address destination, bool bIsReply);