bool CCECProcessor::Transmit(const cec_command &data)
{
+ if (m_logicalAddresses[(uint8_t)data.destination])
+ {
+ CLibCEC::AddLog(CEC_LOG_WARNING, "not sending data to myself!");
+ return false;
+ }
+
cec_adapter_message_state retVal(ADAPTER_MESSAGE_STATE_UNKNOWN);
{
CLockObject lock(m_mutex);
void CUSBCECAdapterCommunication::Close(void)
{
- SetAckMask(0);
{
CLockObject lock(m_mutex);
m_bHasData = true;
m_rcvCondition.Broadcast();
}
+ SetAckMask(0);
StopThread();
}
switch (newStatus)
{
case CEC_DEVICE_STATUS_UNKNOWN:
+ if (m_deviceStatus != newStatus)
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "device status of %s changed into 'unknown'", ToString(m_iLogicalAddress));
m_iStreamPath = 0;
m_powerStatus = CEC_POWER_STATUS_UNKNOWN;
m_vendor = CEC_VENDOR_UNKNOWN;
m_deviceStatus = newStatus;
break;
case CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC:
+ if (m_deviceStatus != newStatus)
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "device status of %s changed into 'handled by libCEC'", ToString(m_iLogicalAddress));
m_iStreamPath = 0;
m_powerStatus = CEC_POWER_STATUS_IN_TRANSITION_STANDBY_TO_ON;
m_vendor = CEC_VENDOR_UNKNOWN;
m_deviceStatus = newStatus;
break;
case CEC_DEVICE_STATUS_PRESENT:
+ if (m_deviceStatus != newStatus)
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "device status of %s changed into 'present'", ToString(m_iLogicalAddress));
+ m_deviceStatus = newStatus;
+ break;
case CEC_DEVICE_STATUS_NOT_PRESENT:
+ if (m_deviceStatus != newStatus)
+ CLibCEC::AddLog(CEC_LOG_DEBUG, "device status of %s changed into 'not present'", ToString(m_iLogicalAddress));
m_deviceStatus = newStatus;
break;
}
bool CCECCommandHandler::ActivateSource(void)
{
- if (m_busDevice->GetLogicalAddress() == CECDEVICE_TV)
- {
- CCECBusDevice *primary = m_processor->GetPrimaryDevice();
- primary->SetPowerStatus(CEC_POWER_STATUS_ON);
- primary->SetMenuState(CEC_MENU_STATE_ACTIVATED);
-
- if (m_busDevice->GetStatus(false) == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC)
- {
- m_busDevice->TransmitMenuState(CECDEVICE_TV);
-
- if ((m_busDevice->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
- m_busDevice->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
- SendDeckStatusUpdateOnActiveSource())
- ((CCECPlaybackDevice *)m_busDevice)->TransmitDeckStatus(CECDEVICE_TV);
- m_bHandlerInited = true;
- }
+ if (m_busDevice->IsActiveSource() &&
+ m_busDevice->GetStatus(false) == CEC_DEVICE_STATUS_HANDLED_BY_LIBCEC)
+ {
+ m_busDevice->SetPowerStatus(CEC_POWER_STATUS_ON);
+ m_busDevice->SetMenuState(CEC_MENU_STATE_ACTIVATED);
+
+ m_busDevice->TransmitImageViewOn();
+ m_busDevice->TransmitActiveSource();
+ m_busDevice->TransmitMenuState(CECDEVICE_TV);
+ if ((m_busDevice->GetType() == CEC_DEVICE_TYPE_PLAYBACK_DEVICE ||
+ m_busDevice->GetType() == CEC_DEVICE_TYPE_RECORDING_DEVICE) &&
+ SendDeckStatusUpdateOnActiveSource())
+ ((CCECPlaybackDevice *)m_busDevice)->TransmitDeckStatus(CECDEVICE_TV);
+ m_bHandlerInited = true;
}
return true;
}