X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fdevices%2FCECBusDevice.cpp;h=de75db5760b7e3bff8f3c365cc08ecdc07c8b7cf;hb=0c271bd0fc05728d0dd90065a064737a979f50d3;hp=0bd6dabea7d36b012cce498b4899899b2bee6f3d;hpb=14f5626891e260b5294a9d4cb73988ed11a41443;p=deb_libcec.git diff --git a/src/lib/devices/CECBusDevice.cpp b/src/lib/devices/CECBusDevice.cpp index 0bd6dab..de75db5 100644 --- a/src/lib/devices/CECBusDevice.cpp +++ b/src/lib/devices/CECBusDevice.cpp @@ -39,6 +39,7 @@ #include "lib/implementations/CECCommandHandler.h" #include "lib/implementations/SLCommandHandler.h" #include "lib/implementations/VLCommandHandler.h" +#include "lib/implementations/PHCommandHandler.h" #include "lib/LibCEC.h" #include "lib/CECTypeUtils.h" #include "lib/platform/util/timeutils.h" @@ -132,6 +133,9 @@ bool CCECBusDevice::ReplaceHandler(bool bActivateSource /* = true */) case CEC_VENDOR_PANASONIC: m_handler = new CVLCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending); break; + case CEC_VENDOR_PHILIPS: + m_handler = new CPHCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending); + break; default: m_handler = new CCECCommandHandler(this, iTransmitTimeout, iTransmitWait, iTransmitRetries, iActiveSourcePending); break; @@ -533,9 +537,6 @@ bool CCECBusDevice::SetPhysicalAddress(uint16_t iNewAddress) { 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; } @@ -642,6 +643,8 @@ bool CCECBusDevice::RequestPowerStatus(const cec_logical_address initiator, bool { MarkBusy(); bReturn = m_handler->TransmitRequestPowerStatus(initiator, m_iLogicalAddress, bWaitForResponse); + if (!bReturn) + SetPowerStatus(CEC_POWER_STATUS_UNKNOWN); MarkReady(); } return bReturn; @@ -1121,6 +1124,8 @@ bool CCECBusDevice::TransmitPendingActiveSourceCommands(void) void CCECBusDevice::SetActiveRoute(uint16_t iRoute) { + SetPowerStatus(CEC_POWER_STATUS_ON); + CCECDeviceMap* map = m_processor->GetDevices(); if (!map) return; @@ -1134,13 +1139,18 @@ void CCECBusDevice::SetActiveRoute(uint16_t iRoute) for (CECDEVICEVEC::iterator it = devices.begin(); it != devices.end(); it++) { - if (!CCECTypeUtils::PhysicalAddressIsIncluded(iRoute, (*it)->GetCurrentPhysicalAddress())) + if ((*it)->GetCurrentPhysicalAddress() == iRoute && (*it)->IsHandledByLibCEC()) + (*it)->ActivateSource(); + else if (!CCECTypeUtils::PhysicalAddressIsIncluded(iRoute, (*it)->GetCurrentPhysicalAddress())) (*it)->MarkAsInactiveSource(); } } void CCECBusDevice::SetStreamPath(uint16_t iNewAddress, uint16_t iOldAddress /* = CEC_INVALID_PHYSICAL_ADDRESS */) { + if (iNewAddress != CEC_INVALID_PHYSICAL_ADDRESS) + SetPowerStatus(CEC_POWER_STATUS_ON); + CLockObject lock(m_mutex); if (iNewAddress != m_iStreamPath) {