From: Lars Op den Kamp Date: Wed, 11 Apr 2012 14:39:53 +0000 (+0200) Subject: cec: removed m_outBuffer in CUSBCECAdapterCommunication. bugzid: 654 X-Git-Tag: upstream/2.2.0~1^2~31^2~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=eb0c8917a6a4305e5d603266c7660fd5f6186821;p=deb_libcec.git cec: removed m_outBuffer in CUSBCECAdapterCommunication. bugzid: 654 --- diff --git a/src/lib/adapter/USBCECAdapterCommunication.cpp b/src/lib/adapter/USBCECAdapterCommunication.cpp index 8269d13..fb6f267 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.cpp +++ b/src/lib/adapter/USBCECAdapterCommunication.cpp @@ -238,16 +238,8 @@ void *CUSBCECAdapterCommunication::Process(void) pingTimeout.Init(CEC_ADAPTER_PING_TIMEOUT); PingAdapter(); } - - if (!IsStopped()) - WriteNextCommand(); } - /* notify all threads that are waiting on messages to be sent */ - CCECAdapterMessage *msg(NULL); - while (m_outBuffer.Pop(msg)) - msg->event.Broadcast(); - /* set the ackmask to 0 before closing the connection */ SetAckMaskInternal(0, true); @@ -304,7 +296,7 @@ cec_adapter_message_state CUSBCECAdapterCommunication::Write(const cec_command & bool CUSBCECAdapterCommunication::Write(CCECAdapterMessage *data) { data->state = ADAPTER_MESSAGE_STATE_WAITING_TO_BE_SENT; - m_outBuffer.Push(data); + SendMessageToAdapter(data); data->event.Wait(5000); if ((data->expectControllerAck && data->state != ADAPTER_MESSAGE_STATE_SENT_ACKED) || @@ -962,13 +954,6 @@ void CUSBCECAdapterCommunication::SendMessageToAdapter(CCECAdapterMessage *msg) msg->event.Signal(); } -void CUSBCECAdapterCommunication::WriteNextCommand(void) -{ - CCECAdapterMessage *msg(NULL); - if (m_outBuffer.Pop(msg)) - SendMessageToAdapter(msg); -} - CStdString CUSBCECAdapterCommunication::GetPortName(void) { CStdString strName; diff --git a/src/lib/adapter/USBCECAdapterCommunication.h b/src/lib/adapter/USBCECAdapterCommunication.h index 227a7e2..7305704 100644 --- a/src/lib/adapter/USBCECAdapterCommunication.h +++ b/src/lib/adapter/USBCECAdapterCommunication.h @@ -106,7 +106,6 @@ namespace CEC bool Read(CCECAdapterMessage &msg, uint32_t iTimeout = 1000); bool ParseMessage(const CCECAdapterMessage &msg); void SendMessageToAdapter(CCECAdapterMessage *msg); - void WriteNextCommand(void); void AddData(uint8_t *data, size_t iLen); bool ReadFromDevice(uint32_t iTimeout, size_t iSize = 256); bool WaitForAck(CCECAdapterMessage &message); @@ -114,7 +113,6 @@ namespace CEC PLATFORM::ISocket * m_port; CCECProcessor * m_processor; PLATFORM::SyncedBuffer m_inBuffer; - PLATFORM::SyncedBuffer m_outBuffer; PLATFORM::CMutex m_mutex; PLATFORM::CCondition m_rcvCondition; volatile bool m_bHasData;