From 9ee5e8fd5b9ac7f49cd95dbed64abb1cc64558eb Mon Sep 17 00:00:00 2001 From: Lars Op den Kamp Date: Mon, 25 Jun 2012 16:48:18 +0200 Subject: [PATCH] cec: mark the tv as powered up for panasonic once it sends the audiomode request --- src/lib/implementations/VLCommandHandler.cpp | 30 ++++++++++++++++++++ src/lib/implementations/VLCommandHandler.h | 1 + 2 files changed, 31 insertions(+) diff --git a/src/lib/implementations/VLCommandHandler.cpp b/src/lib/implementations/VLCommandHandler.cpp index c347649..d8d7f6c 100644 --- a/src/lib/implementations/VLCommandHandler.cpp +++ b/src/lib/implementations/VLCommandHandler.cpp @@ -41,6 +41,7 @@ #define VL_POWER_CHANGE 0x20 #define VL_POWERED_UP 0x00 #define VL_POWERED_DOWN 0x01 +#define VL_UNKNOWN1 0x06 using namespace CEC; using namespace PLATFORM; @@ -90,6 +91,18 @@ int CVLCommandHandler::HandleDeviceVendorCommandWithId(const cec_command &comman return CEC_ABORT_REASON_INVALID_OPERAND; if (command.initiator == CECDEVICE_TV && + command.parameters.At(3) == VL_UNKNOWN1) + { + // set the power up event time + { + CLockObject lock(m_mutex); + if (m_iPowerUpEventReceived == 0) + m_iPowerUpEventReceived = GetTimeMs(); + } + // mark the TV as powered on + m_processor->GetTV()->SetPowerStatus(CEC_POWER_STATUS_ON); + } + else if (command.initiator == CECDEVICE_TV && command.destination == CECDEVICE_BROADCAST && command.parameters.At(3) == VL_POWER_CHANGE) { @@ -195,3 +208,20 @@ bool CVLCommandHandler::SourceSwitchAllowed(void) { return PowerUpEventReceived(); } + +int CVLCommandHandler::HandleSystemAudioModeRequest(const cec_command &command) +{ + if (command.initiator == CECDEVICE_TV) + { + // set the power up event time + { + CLockObject lock(m_mutex); + if (m_iPowerUpEventReceived == 0) + m_iPowerUpEventReceived = GetTimeMs(); + } + // mark the TV as powered on + m_processor->GetTV()->SetPowerStatus(CEC_POWER_STATUS_ON); + } + + return CCECCommandHandler::HandleSystemAudioModeRequest(command); +} diff --git a/src/lib/implementations/VLCommandHandler.h b/src/lib/implementations/VLCommandHandler.h index 433a394..6f417e8 100644 --- a/src/lib/implementations/VLCommandHandler.h +++ b/src/lib/implementations/VLCommandHandler.h @@ -45,6 +45,7 @@ namespace CEC int HandleDeviceVendorCommandWithId(const cec_command &command); int HandleStandby(const cec_command &command); + int HandleSystemAudioModeRequest(const cec_command &command); int HandleVendorCommand(const cec_command &command); bool PowerUpEventReceived(void); -- 2.34.1