From b3954aefd5290babbc2aa97b8f62b6112ff494f0 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 15 Jan 2015 09:28:37 +0100 Subject: Modified the CAM API so that it is possible to implement CAMs that can be freely assigned to any devices --- ci.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ci.h') diff --git a/ci.h b/ci.h index 4d558537..8fea34f1 100644 --- a/ci.h +++ b/ci.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: ci.h 3.8 2014/03/26 11:42:17 kls Exp $ + * $Id: ci.h 3.9 2015/01/15 09:18:09 kls Exp $ */ #ifndef __CI_H @@ -79,11 +79,14 @@ enum eModuleStatus { msNone, msReset, msPresent, msReady }; class cCiAdapter : public cThread { friend class cCamSlot; private: - cDevice *assignedDevice; cCamSlot *camSlots[MAX_CAM_SLOTS_PER_ADAPTER]; void AddCamSlot(cCamSlot *CamSlot); ///< Adds the given CamSlot to this CI adapter. protected: + cCamSlot *ItCamSlot(int &Iter); + ///< Iterates over all added CAM slots of this adapter. Iter has to be + ///< initialized to 0 and is required to store the iteration state. + ///< Returns NULL if no further CAM slot is found. virtual void Action(void); ///< Handles the attached CAM slots in a separate thread. ///< The derived class must call the Start() function to @@ -128,6 +131,7 @@ private: cMutex mutex; cCondVar processed; cCiAdapter *ciAdapter; + cDevice *assignedDevice; cCaPidReceiver *caPidReceiver; int slotIndex; int slotNumber; @@ -164,7 +168,7 @@ public: ///< device it was previously assigned to. The value of Query ///< is ignored in that case, and this function always returns ///< 'true'. - cDevice *Device(void); + cDevice *Device(void) { return assignedDevice; } ///< Returns the device this CAM slot is currently assigned to. bool WantsTsData(void) const { return caPidReceiver != NULL; } ///< Returns true if this CAM slot wants to receive the TS data through -- cgit v1.2.3