cec: wait for multiple responses, not just for one. don't try to read and write at...
[deb_libcec.git] / src / lib / adapter / USBCECAdapterCommunication.h
index 22c7db9738ee459bcd0b239f7f06165091c03eef..d1f033fbfac90cc9f698a494776447543893e9f8 100644 (file)
@@ -46,6 +46,23 @@ namespace CEC
 {
   class CCECProcessor;
 
+  class CUSBCECAdapterProcessor: public PLATFORM::CThread
+  {
+  public:
+    CUSBCECAdapterProcessor(IAdapterCommunicationCallback *cb) :
+      m_callback(cb) {};
+    virtual ~CUSBCECAdapterProcessor(void)
+    {
+      StopThread();
+    }
+
+    void *Process(void);
+    void AddCommand(cec_command command);
+  private:
+    IAdapterCommunicationCallback *     m_callback;
+    PLATFORM::SyncedBuffer<cec_command> m_inBuffer;
+  };
+
   class CUSBCECAdapterCommunication : public IAdapterCommunication, private PLATFORM::CThread
   {
   public:
@@ -99,5 +116,6 @@ namespace CEC
     bool                                         m_bNextIsEscaped;
     bool                                         m_bGotStart;
     IAdapterCommunicationCallback *              m_callback;
+    CUSBCECAdapterProcessor *                    m_messageProcessor;
   };
 };