m_controller->AddLog(CEC_LOG_ERROR, "could not create a processor thread");
return false;
}
- return true;
+
+ lock.Leave();
+ if (SetAckMask(m_logicalAddresses.AckMask()) &&
+ SetHDMIPort(m_iHDMIPort, true))
+ {
+ ScanCECBus();
+ return true;
+ }
}
else
m_controller->AddLog(CEC_LOG_ERROR, "could not create a processor thread");
cec_command command;
CCECAdapterMessage msg;
+ if (m_logicalAddresses.IsEmpty() && !FindLogicalAddresses())
{
- if (m_logicalAddresses.IsEmpty() && !FindLogicalAddresses())
- {
- CLockObject lock(&m_mutex);
- m_controller->AddLog(CEC_LOG_ERROR, "could not detect our logical addresses");
- m_startCondition.Signal();
- return NULL;
- }
-
- SetAckMask(m_logicalAddresses.AckMask());
-
- ScanCECBus();
-
- {
- CLockObject lock(&m_mutex);
- m_bStarted = true;
- lock.Leave();
-
- SetHDMIPort(m_iHDMIPort);
-
- lock.Lock();
- m_controller->AddLog(CEC_LOG_DEBUG, "processor thread started");
- m_startCondition.Signal();
- }
+ CLockObject lock(&m_mutex);
+ m_controller->AddLog(CEC_LOG_ERROR, "could not detect our logical addresses");
+ m_startCondition.Signal();
+ return NULL;
+ }
+ else
+ {
+ CLockObject lock(&m_mutex);
+ m_bStarted = true;
+ m_controller->AddLog(CEC_LOG_DEBUG, "processor thread started");
+ m_startCondition.Signal();
}
while (!IsStopped())
m_controller->CheckKeypressTimeout();
- for (unsigned int iDevicePtr = 0; iDevicePtr < 16; iDevicePtr++)
+ for (uint8_t iDevicePtr = 0; iDevicePtr < 16; iDevicePtr++)
{
if (!m_logicalAddresses[iDevicePtr])
m_busDevices[iDevicePtr]->PollVendorId();
return bReturn;
}
-bool CCECProcessor::SetHDMIPort(uint8_t iPort)
+bool CCECProcessor::SetHDMIPort(uint8_t iPort, bool bForce /* = false */)
{
bool bReturn(false);
AddLog(CEC_LOG_DEBUG, strLog);
m_iHDMIPort = iPort;
- if (!m_bStarted)
+ if (!m_bStarted && !bForce)
return true;
uint16_t iPhysicalAddress(0);
if (device && device->GetStatus() == CEC_DEVICE_STATUS_PRESENT)
{
device->GetPhysicalAddress();
- device->GetVendorId();
device->GetCecVersion();
- device->GetPowerStatus();
+ device->GetVendorId();
}
}
}
bool CCECProcessor::CheckPhysicalAddress(uint16_t iPhysicalAddress)
{
- for (unsigned int iPtr = 0; iPtr < 16; iPtr++)
+ for (unsigned int iPtr = 0; iPtr < 15; iPtr++)
{
if (m_busDevices[iPtr]->GetPhysicalAddress(false) == iPhysicalAddress)
return true;
return bReturn;
}
-bool CCECProcessor::SetInactiveView(void)
+bool CCECProcessor::TransmitInactiveSource(void)
{
if (!IsRunning())
return false;
if (!m_logicalAddresses.IsEmpty() && m_busDevices[m_logicalAddresses.primary])
- return m_busDevices[m_logicalAddresses.primary]->TransmitInactiveView();
+ return m_busDevices[m_logicalAddresses.primary]->TransmitInactiveSource();
return false;
}
return m_busDevices[iAddress]->GetCecVersion();
}
+cec_osd_name CCECProcessor::GetDeviceOSDName(cec_logical_address iAddress)
+{
+ CStdString strOSDName = m_busDevices[iAddress]->GetOSDName();
+ cec_osd_name retVal;
+
+ snprintf(retVal.name, sizeof(retVal.name), "%s", strOSDName.c_str());
+ retVal.device = iAddress;
+
+ return retVal;
+}
+
bool CCECProcessor::GetDeviceMenuLanguage(cec_logical_address iAddress, cec_menu_language *language)
{
if (m_busDevices[iAddress])
cec_logical_addresses CCECProcessor::GetActiveDevices(void)
{
cec_logical_addresses addresses;
+ addresses.Clear();
for (unsigned int iPtr = 0; iPtr < 15; iPtr++)
{
if (m_busDevices[iPtr]->GetStatus() == CEC_DEVICE_STATUS_PRESENT)