/*
* 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.
return true;
m_bHandlerInited = true;
+ if (m_busDevice->GetLogicalAddress() != CECDEVICE_TV)
+ return true;
+
CCECBusDevice *primary = m_processor->GetPrimaryDevice();
if (primary && primary->GetLogicalAddress() != CECDEVICE_UNREGISTERED)
{
if (command.parameters.size == 2)
{
uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]);
- CCECBusDevice *primary = m_processor->GetPrimaryDevice();
- bool bSendPowerOffState(iAddress != primary->GetCurrentPhysicalAddress() && primary->IsActiveSource());
-
CCECBusDevice *device = m_processor->GetDeviceByPhysicalAddress(iAddress);
if (device)
device->MarkAsActiveSource();
- if (bSendPowerOffState)
+
{
- {
- CLockObject lock(m_SLMutex);
- m_bActiveSourceSent = false;
- }
- primary->TransmitPowerState(CECDEVICE_TV, false);
+ CLockObject lock(m_SLMutex);
+ m_bActiveSourceSent = false;
}
return COMMAND_HANDLED;
if (!device || command.parameters.size == 0)
return CEC_ABORT_REASON_INVALID_OPERAND;
- device->SetDeckStatus(!device->IsActiveSource() ? CEC_DECK_INFO_OTHER_STATUS : CEC_DECK_INFO_OTHER_STATUS_LG);
+ device->SetDeckStatus(CEC_DECK_INFO_OTHER_STATUS_LG);
if (command.parameters[0] == CEC_STATUS_REQUEST_ON)
{
device->TransmitDeckStatus(command.initiator, true);
cec_command command;
if (!m_bSLEnabled)
- TransmitVendorID(CECDEVICE_TV, CEC_VENDOR_LG, false);
+ TransmitVendorID(CECDEVICE_TV, iDestination, CEC_VENDOR_LG, false);
cec_command::Format(command, CECDEVICE_TV, iDestination, CEC_OPCODE_VENDOR_COMMAND);
command.PushBack(SL_COMMAND_POWER_ON);
return CCECCommandHandler::PowerOn(iInitiator, iDestination);
}
+
+void CSLCommandHandler::VendorPreActivateSourceHook(void)
+{
+ CCECPlaybackDevice *device = m_busDevice->AsPlaybackDevice();
+ if (device)
+ device->SetDeckStatus(!device->IsActiveSource() ? CEC_DECK_INFO_OTHER_STATUS : CEC_DECK_INFO_OTHER_STATUS_LG);
+}