X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fimplementations%2FVLCommandHandler.cpp;h=d8d7f6c205ac52148a1ca8eada8b279130d1c4c4;hb=9ee5e8fd5b9ac7f49cd95dbed64abb1cc64558eb;hp=c347649c9c0b9989ca7be74fc82b3fee8713f804;hpb=f3849e50b4c25cfc35bb3aa6ee7aae0cb1f340a0;p=deb_libcec.git 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); +}