changed some log levels from NOTICE to DEBUG, so the non-debugging output is less...
[deb_libcec.git] / src / lib / CECClient.cpp
index fea8ed73a114bd93ad09db978f019c24fcd08dec..3ae420ef4d09277eb0504a668165bbb9e3feb723 100644 (file)
@@ -457,7 +457,7 @@ bool CCECClient::SetLogicalAddress(const cec_logical_address iLogicalAddress)
 
   if (GetPrimaryLogicalAdddress() != iLogicalAddress)
   {
-    LIB_CEC->AddLog(CEC_LOG_NOTICE, "<< setting primary logical address to %1x", iLogicalAddress);
+    LIB_CEC->AddLog(CEC_LOG_NOTICE, "setting primary logical address to %1x", iLogicalAddress);
     {
       CLockObject lock(m_mutex);
       m_configuration.logicalAddresses.primary = iLogicalAddress;
@@ -938,14 +938,14 @@ void CCECClient::AddCommand(const cec_command &command)
 
   if (command.destination == CECDEVICE_BROADCAST || GetLogicalAddresses().IsSet(command.destination))
   {
-    LIB_CEC->AddLog(CEC_LOG_NOTICE, ">> %s (%X) -> %s (%X): %s (%2X)", ToString(command.initiator), command.initiator, ToString(command.destination), command.destination, ToString(command.opcode), command.opcode);
+    LIB_CEC->AddLog(CEC_LOG_DEBUG, ">> %s (%X) -> %s (%X): %s (%2X)", ToString(command.initiator), command.initiator, ToString(command.destination), command.destination, ToString(command.opcode), command.opcode);
     CallbackAddCommand(command);
   }
 }
 
 int CCECClient::MenuStateChanged(const cec_menu_state newState)
 {
-  LIB_CEC->AddLog(CEC_LOG_NOTICE, ">> %s: %s", ToString(CEC_OPCODE_MENU_REQUEST), ToString(newState));
+  LIB_CEC->AddLog(CEC_LOG_DEBUG, ">> %s: %s", ToString(CEC_OPCODE_MENU_REQUEST), ToString(newState));
   return CallbackMenuStateChanged(newState);
 }
 
@@ -1065,21 +1065,6 @@ bool CCECClient::PingAdapter(void)
   return m_processor ? m_processor->PingAdapter() : false;
 }
 
-bool CCECClient::GetNextLogMessage(cec_log_message *message)
-{
-  return (m_logBuffer.Pop(*message));
-}
-
-bool CCECClient::GetNextKeypress(cec_keypress *key)
-{
-  return m_keyBuffer.Pop(*key);
-}
-
-bool CCECClient::GetNextCommand(cec_command *command)
-{
-  return m_commandBuffer.Pop(*command);
-}
-
 std::string CCECClient::GetConnectionInfo(void)
 {
   CStdString strLog;
@@ -1430,41 +1415,23 @@ void CCECClient::SourceDeactivated(const cec_logical_address logicalAddress)
 
 void CCECClient::CallbackAddCommand(const cec_command &command)
 {
-  {
-    CLockObject lock(m_cbMutex);
-    if (m_configuration.callbacks && m_configuration.callbacks->CBCecCommand)
-    {
-      m_configuration.callbacks->CBCecCommand(m_configuration.callbackParam, command);
-      return;
-    }
-  }
-  m_commandBuffer.Push(command);
+  CLockObject lock(m_cbMutex);
+  if (m_configuration.callbacks && m_configuration.callbacks->CBCecCommand)
+    m_configuration.callbacks->CBCecCommand(m_configuration.callbackParam, command);
 }
 
 void CCECClient::CallbackAddKey(const cec_keypress &key)
 {
-  {
-    CLockObject lock(m_cbMutex);
-    if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress)
-    {
-      m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key);
-      return;
-    }
-  }
-  m_keyBuffer.Push(key);
+  CLockObject lock(m_cbMutex);
+  if (m_configuration.callbacks && m_configuration.callbacks->CBCecKeyPress)
+    m_configuration.callbacks->CBCecKeyPress(m_configuration.callbackParam, key);
 }
 
 void CCECClient::CallbackAddLog(const cec_log_message &message)
 {
-  {
-    CLockObject lock(m_cbMutex);
-    if (m_configuration.callbacks && m_configuration.callbacks->CBCecLogMessage)
-    {
-      m_configuration.callbacks->CBCecLogMessage(m_configuration.callbackParam, message);
-      return;
-    }
-  }
-  m_logBuffer.Push(message);
+  CLockObject lock(m_cbMutex);
+  if (m_configuration.callbacks && m_configuration.callbacks->CBCecLogMessage)
+    m_configuration.callbacks->CBCecLogMessage(m_configuration.callbackParam, message);
 }
 
 void CCECClient::CallbackConfigurationChanged(const libcec_configuration &config)