{
LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): physical address changed from %04x to %04x", GetLogicalAddressName(), m_iLogicalAddress, m_iPhysicalAddress, iNewAddress);
m_iPhysicalAddress = iNewAddress;
+
+ if (m_processor->GetDevices()->GetActiveSourceAddress() == iNewAddress)
+ MarkAsActiveSource();
}
return true;
}
}
}
+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);
if (m_deviceStatus != newStatus)
{
LIB_CEC->AddLog(CEC_LOG_DEBUG, "%s (%X): device status changed into 'not present'", GetLogicalAddressName(), m_iLogicalAddress);
- ResetDeviceStatus();
+ ResetDeviceStatus(true);
m_deviceStatus = newStatus;
}
break;
}
}
-void CCECBusDevice::ResetDeviceStatus(void)
+void CCECBusDevice::ResetDeviceStatus(bool bClientUnregistered /* = false */)
{
CLockObject lock(m_mutex);
SetPowerStatus (CEC_POWER_STATUS_UNKNOWN);
SetCecVersion (CEC_VERSION_UNKNOWN);
SetStreamPath (CEC_INVALID_PHYSICAL_ADDRESS);
SetOSDName (ToString(m_iLogicalAddress));
- MarkAsInactiveSource();
+ MarkAsInactiveSource(bClientUnregistered);
m_iLastActive = 0;
m_bVendorIdRequested = false;
if (bWasActivated)
{
+ if (IsHandledByLibCEC())
+ m_processor->SetActiveSource(true, false);
CCECClient *client = GetClient();
if (client)
client->SourceActivated(m_iLogicalAddress);
}
}
-void CCECBusDevice::MarkAsInactiveSource(void)
+void CCECBusDevice::MarkAsInactiveSource(bool bClientUnregistered /* = false */)
{
bool bWasDeactivated(false);
{
if (bWasDeactivated)
{
+ if (IsHandledByLibCEC())
+ m_processor->SetActiveSource(false, bClientUnregistered);
CCECClient *client = GetClient();
if (client)
client->SourceDeactivated(m_iLogicalAddress);
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;
}