X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2FCECProcessor.cpp;h=84a46d635e01823a7fb7bcff25adcb666fcdf36b;hb=34232c9249859abed3ae97c4d4289dd6ec87a2f6;hp=399e065daa81f9872e4d95d3efb54e2773c49d05;hpb=d3caa81bbff5c84e49cdc9c4c1de5d0b583eb45d;p=deb_libcec.git diff --git a/src/lib/CECProcessor.cpp b/src/lib/CECProcessor.cpp index 399e065..84a46d6 100644 --- a/src/lib/CECProcessor.cpp +++ b/src/lib/CECProcessor.cpp @@ -1,7 +1,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -351,7 +351,7 @@ cec_logical_address CCECProcessor::GetActiveSource(bool bRequestActiveSource /* if (activeSource) return activeSource->GetLogicalAddress(); - if (bRequestActiveSource && m_busDevices->GetActiveSourceAddress() == CEC_INVALID_PHYSICAL_ADDRESS) + if (bRequestActiveSource) { // request the active source from the bus CCECBusDevice *primary = GetPrimaryDevice(); @@ -623,6 +623,8 @@ bool CCECProcessor::GetDeviceInformation(const char *strPort, libcec_configurati config->iFirmwareBuildDate = m_communication->GetFirmwareBuildDate(); config->adapterType = m_communication->GetAdapterType(); + Close(); + return true; } @@ -839,6 +841,9 @@ bool CCECProcessor::RegisterClient(CCECClient *client) GetTV()->MarkHandlerReady(); } + // report our OSD name to the TV, since some TVs don't request it + client->GetPrimaryDevice()->TransmitOSDName(CECDEVICE_TV, false); + // request the power status of the TV tv->RequestPowerStatus(sourceAddress, true); @@ -983,6 +988,14 @@ void CCECProcessor::HandleLogicalAddressLost(cec_logical_address oldAddress) } } +void CCECProcessor::HandlePhysicalAddressChanged(uint16_t iNewAddress) +{ + m_libcec->AddLog(CEC_LOG_NOTICE, "physical address changed to %04x", iNewAddress); + CCECClient* client = GetPrimaryClient(); + if (client) + client->SetPhysicalAddress(iNewAddress); +} + uint16_t CCECProcessor::GetAdapterVendorId(void) const { return m_communication ? m_communication->GetAdapterVendorId() : 0;