Changeset 904 for trunk/libffado/src/libieee1394/IsoHandlerManager.h
- Timestamp:
- 03/05/08 14:24:49 (16 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/libieee1394/IsoHandlerManager.h
r864 r904 37 37 38 38 class Ieee1394Service; 39 40 39 class IsoHandler; 40 41 41 namespace Streaming { 42 42 class StreamProcessor; … … 49 49 typedef std::vector<IsoHandler *>::iterator IsoHandlerVectorIterator; 50 50 51 class IsoHandlerManager; 52 53 // threads that will handle the packet framing 54 // one thread per direction, as a compromise for one per 55 // channel and one for all 56 class IsoTask : public Util::RunnableInterface 57 { 58 public: 59 enum eTaskType { 60 eTT_Receive, 61 eTT_Transmit, 62 }; 63 IsoTask(IsoHandlerManager& manager, enum IsoTask::eTaskType t); 64 virtual ~IsoTask() {}; 65 66 public: 67 bool Init(); 68 bool Execute(); 69 70 /** 71 * requests the thread to sync it's stream map with the manager 72 */ 73 bool requestShadowMapUpdate(); 74 75 void setVerboseLevel(int i); 76 protected: 77 IsoHandlerManager& m_manager; 78 enum eTaskType m_type; 79 80 // the event request structure 81 SInt32 request_update; 82 83 // static allocation due to RT constraints 84 // this is the map used by the actual thread 85 // it is a shadow of the m_StreamProcessors vector 86 struct pollfd m_poll_fds_shadow[ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT]; 87 IsoHandler *m_IsoHandler_map_shadow[ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT]; 88 unsigned int m_poll_nfds_shadow; 89 90 // updates the streams map 91 void updateShadowMapHelper(); 92 93 // debug stuff 94 DECLARE_DEBUG_MODULE; 95 }; 96 51 97 /*! 52 98 \brief The ISO Handler management class … … 60 106 61 107 */ 62 class IsoHandlerManager : public Util::RunnableInterface 108 109 class IsoHandlerManager 63 110 { 64 111 friend class Streaming::StreamProcessorManager; 65 public: 66 bool Init(); 67 bool Execute(); 68 void updateShadowVars(); 69 private: 70 // shadow variables 71 struct pollfd m_poll_fds_shadow[ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT]; 72 IsoHandler *m_IsoHandler_map_shadow[ISOHANDLERMANAGER_MAX_ISO_HANDLERS_PER_PORT]; 73 unsigned int m_poll_nfds_shadow; 112 friend class IsoTask; 74 113 75 114 public: … … 151 190 bool m_realtime; 152 191 int m_priority; 153 Util::Thread * m_Thread; 192 // handler threads 193 Util::Thread * m_ReceiveThread; 194 Util::Thread * m_TransmitThread; 195 196 // actual tasks 197 IsoTask * m_ReceiveTask; 198 IsoTask * m_TransmitTask; 199 200 bool updateShadowMapFor(IsoHandler *h); 154 201 155 202 // debug stuff