+ strLog.Format("logical address '%s' already taken", strLabel);
+ AddLog(CEC_LOG_DEBUG, strLog);
+ return false;
+}
+
+bool CCECProcessor::FindLogicalAddressRecordingDevice(unsigned int iIndex)
+{
+ AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'recording device'");
+ return TryLogicalAddress(CECDEVICE_RECORDINGDEVICE1, iIndex) ||
+ TryLogicalAddress(CECDEVICE_RECORDINGDEVICE2, iIndex) ||
+ TryLogicalAddress(CECDEVICE_RECORDINGDEVICE3, iIndex);
+}
+
+bool CCECProcessor::FindLogicalAddressTuner(unsigned int iIndex)
+{
+ AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'tuner'");
+ return TryLogicalAddress(CECDEVICE_TUNER1, iIndex) ||
+ TryLogicalAddress(CECDEVICE_TUNER2, iIndex) ||
+ TryLogicalAddress(CECDEVICE_TUNER3, iIndex) ||
+ TryLogicalAddress(CECDEVICE_TUNER4, iIndex);
+}
+
+bool CCECProcessor::FindLogicalAddressPlaybackDevice(unsigned int iIndex)
+{
+ AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'playback device'");
+ return TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE1, iIndex) ||
+ TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE2, iIndex) ||
+ TryLogicalAddress(CECDEVICE_PLAYBACKDEVICE3, iIndex);
+}
+
+bool CCECProcessor::FindLogicalAddressAudioSystem(unsigned int iIndex)
+{
+ AddLog(CEC_LOG_DEBUG, "detecting logical address for type 'audio'");
+ return TryLogicalAddress(CECDEVICE_AUDIOSYSTEM, iIndex);
+}
+
+bool CCECProcessor::FindLogicalAddresses(void)
+{
+ bool bReturn(true);
+ m_logicalAddresses.clear();
+ CStdString strLog;
+
+ for (unsigned int iPtr = 0; iPtr < 5; iPtr++)
+ {
+ if (m_types.types[iPtr] == CEC_DEVICE_TYPE_RESERVED)
+ continue;
+
+ strLog.Format("%s - device %d: type %d", __FUNCTION__, iPtr, m_types.types[iPtr]);
+ AddLog(CEC_LOG_DEBUG, strLog);
+
+ if (m_types.types[iPtr] == CEC_DEVICE_TYPE_RECORDING_DEVICE)
+ bReturn &= FindLogicalAddressRecordingDevice(iPtr);
+ if (m_types.types[iPtr] == CEC_DEVICE_TYPE_TUNER)
+ bReturn &= FindLogicalAddressTuner(iPtr);
+ if (m_types.types[iPtr] == CEC_DEVICE_TYPE_PLAYBACK_DEVICE)
+ bReturn &= FindLogicalAddressPlaybackDevice(iPtr);
+ if (m_types.types[iPtr] == CEC_DEVICE_TYPE_AUDIO_SYSTEM)
+ bReturn &= FindLogicalAddressAudioSystem(iPtr);
+ }
+
+ return bReturn;
+}
+
+void *CCECProcessor::Process(void)
+{
+ bool bParseFrame(false);