don't get caught in a loop in CVLCommandHandler when the source switch was not allowe...
[deb_libcec.git] / src / lib / implementations / VLCommandHandler.h
index 699ef40330be4618302679635a333614281dc63b..ae6b9f60d63a291b3d34c5449ed87ffd91e10c67 100644 (file)
@@ -38,24 +38,35 @@ namespace CEC
   class CVLCommandHandler : public CCECCommandHandler
   {
   public:
-    CVLCommandHandler(CCECBusDevice *busDevice);
+    CVLCommandHandler(CCECBusDevice *busDevice,
+                      int32_t iTransmitTimeout = CEC_DEFAULT_TRANSMIT_TIMEOUT,
+                      int32_t iTransmitWait = CEC_DEFAULT_TRANSMIT_WAIT,
+                      int8_t iTransmitRetries = CEC_DEFAULT_TRANSMIT_RETRIES,
+                      int64_t iActiveSourcePending = 0);
     virtual ~CVLCommandHandler(void) {};
 
     bool InitHandler(void);
 
     int HandleDeviceVendorCommandWithId(const cec_command &command);
     int HandleStandby(const cec_command &command);
-    bool TransmitActiveSource(const cec_logical_address iInitiator, uint16_t iPhysicalAddress);
-    bool TransmitPendingActiveSourceCommands(void);
+    int HandleSystemAudioModeRequest(const cec_command &command);
 
     int HandleVendorCommand(const cec_command &command);
     bool PowerUpEventReceived(void);
     bool SupportsDeviceType(const cec_device_type type) const { return type != CEC_DEVICE_TYPE_RECORDING_DEVICE; };
     cec_device_type GetReplacementDeviceType(const cec_device_type type) const { return type == CEC_DEVICE_TYPE_RECORDING_DEVICE ? CEC_DEVICE_TYPE_PLAYBACK_DEVICE : type; }
+    bool TransmitRequestPowerStatus(const cec_logical_address iInitiator, const cec_logical_address iDestination, bool bWaitForResponse = true);
+
+    bool SourceSwitchAllowed(void);
+
+  protected:
+    void VendorPreActivateSourceHook(void);
+    void SendVendorCommandCapabilities(const cec_logical_address initiator, const cec_logical_address destination);
+    int HandleReportPowerStatus(const cec_command &command);
 
-  private:
     PLATFORM::CMutex m_mutex;
-    bool             m_bActiveSourcePending;
-    bool             m_bPowerUpEventReceived;
+    uint64_t         m_iPowerUpEventReceived;
+    bool             m_bCapabilitiesSent;
+    bool             m_bPowerStatusRequested;
   };
 };