From: Lars Op den Kamp Date: Tue, 13 Nov 2012 13:14:09 +0000 (+0100) Subject: fixed: mark the TV as 'in transition standby -> on' after sending 'image view on... X-Git-Tag: upstream/2.2.0~1^2~12^2~27 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=75273cc6ad40f8829711adfc35c96253003dad76;p=deb_libcec.git fixed: mark the TV as 'in transition standby -> on' after sending 'image view on', so we don't spam the TV with 'image view on' command while waiting for it to finish powering up. bugzid: 1603. bugzid: 1609. bugzid: 1592 --- diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 4234ec7..bfb546f 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -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; } diff --git a/src/lib/devices/CECBusDevice.h b/src/lib/devices/CECBusDevice.h index 1abf488..e0c2f9c 100644 --- a/src/lib/devices/CECBusDevice.h +++ b/src/lib/devices/CECBusDevice.h @@ -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);