X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FSLCommandHandler.cpp;h=b9103ec5f59da75a037aee61f68a68c9986bde46;hb=5daed059e1d5bca3ddfa0787679ef4e7b349e382;hp=e8cdf43f8e4d10128e0fc76ef6dc992b8a9755d7;hpb=bbc71623d650a4f17057da7d218a824c0c95b3d3;p=deb_libcec.git diff --git a/src/lib/implementations/SLCommandHandler.cpp b/src/lib/implementations/SLCommandHandler.cpp index e8cdf43..b9103ec 100644 --- a/src/lib/implementations/SLCommandHandler.cpp +++ b/src/lib/implementations/SLCommandHandler.cpp @@ -68,9 +68,8 @@ CSLCommandHandler::CSLCommandHandler(CCECBusDevice *busDevice) : primary->ReplaceHandler(false); } - /* LG TVs don't always reply to CEC version requests, so just set it to 1.3a */ - if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV) - m_busDevice->SetCecVersion(CEC_VERSION_1_3A); + /* LG devices don't always reply to CEC version requests, so just set it to 1.3a */ + m_busDevice->SetCecVersion(CEC_VERSION_1_3A); /* LG devices always return "korean" as language */ cec_menu_language lang; @@ -128,7 +127,7 @@ bool CSLCommandHandler::HandleActiveSource(const cec_command &command) { uint16_t iAddress = ((uint16_t)command.parameters[0] << 8) | ((uint16_t)command.parameters[1]); CCECBusDevice *primary = m_processor->GetPrimaryDevice(); - bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress(false) && primary->IsActiveSource()); + bool bSendPowerOffState(iAddress != primary->GetPhysicalAddress() && primary->IsActiveSource()); m_processor->SetActiveSource(iAddress); if (bSendPowerOffState) @@ -158,18 +157,6 @@ bool CSLCommandHandler::HandleDeviceVendorId(const cec_command &command) return true; } -bool CSLCommandHandler::HandleGivePhysicalAddress(const cec_command &command) -{ - if (m_processor->IsRunning() && m_busDevice->MyLogicalAddressContains(command.destination)) - { - CCECBusDevice *device = GetDevice(command.destination); - if (device) - return device->TransmitPhysicalAddress(); // only the physical address, don't send image view on - } - - return false; -} - bool CSLCommandHandler::HandleVendorCommand(const cec_command &command) { if (!m_busDevice->MyLogicalAddressContains(command.destination)) @@ -216,7 +203,7 @@ void CSLCommandHandler::TransmitVendorCommand0205(const cec_logical_address iSou response.PushBack(SL_COMMAND_UNKNOWN_02); response.PushBack(SL_COMMAND_TYPE_HDDRECORDER); - Transmit(response, false); + Transmit(response); } void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command) @@ -229,7 +216,17 @@ void CSLCommandHandler::HandleVendorCommandPowerOn(const cec_command &command) { SetSLInitialised(); device->SetActiveSource(); - ActivateSource(); + device->SetPowerStatus(CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON); + device->TransmitPowerState(command.initiator); + + CEvent::Sleep(2000); + device->SetPowerStatus(CEC_POWER_STATUS_ON); + device->TransmitPowerState(command.initiator); + device->TransmitPhysicalAddress(); + { + CLockObject lock(m_SLMutex); + m_bActiveSourceSent = false; + } } } void CSLCommandHandler::HandleVendorCommandPowerOnStatus(const cec_command &command) @@ -257,7 +254,7 @@ void CSLCommandHandler::TransmitVendorCommandSetDeviceMode(const cec_logical_add cec_command::Format(response, iSource, iDestination, CEC_OPCODE_VENDOR_COMMAND); response.PushBack(SL_COMMAND_SET_DEVICE_MODE); response.PushBack((uint8_t)type); - Transmit(response, false); + Transmit(response); } bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command) @@ -273,7 +270,8 @@ bool CSLCommandHandler::HandleGiveDeckStatus(const cec_command &command) if (command.parameters[0] == CEC_STATUS_REQUEST_ON) { bool bReturn = ((CCECPlaybackDevice *) device)->TransmitDeckStatus(command.initiator); - ActivateSource(); + if (!ActiveSourceSent()) + ActivateSource(); return bReturn; } else if (command.parameters[0] == CEC_STATUS_REQUEST_ONCE) @@ -401,6 +399,10 @@ bool CSLCommandHandler::PowerOn(const cec_logical_address iInitiator, const cec_ { /* LG devices only allow themselves to be woken up by the TV with a vendor command */ cec_command command; + + if (!m_bSLEnabled) + TransmitVendorID(CECDEVICE_TV, CEC_VENDOR_LG); + cec_command::Format(command, CECDEVICE_TV, iDestination, CEC_OPCODE_VENDOR_COMMAND); command.PushBack(SL_COMMAND_POWER_ON); command.PushBack(0);