00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00044 #ifndef CCXX_RTP_IOQUEUE_H_
00045 #define CCXX_RTP_IOQUEUE_H_
00046
00047 #include <ccrtp/iqueue.h>
00048 #include <ccrtp/oqueue.h>
00049
00050 NAMESPACE_COMMONCPP
00051
00075 class __EXPORT RTPDataQueue :
00076 public IncomingDataQueue,
00077 public OutgoingDataQueue
00078 {
00079 public:
00099 typedef enum {
00100 tosBestEffort,
00101 tosEnhanced
00102 } Tos;
00103
00116 inline void
00117 setTypeOfService(Tos tos)
00118 { typeOfService = tos; }
00119
00124 inline void enableStack()
00125 { dataServiceActive = true; }
00126
00130 inline void disableStack()
00131 { dataServiceActive = false; }
00132
00138 inline bool
00139 isActive() const
00140 { return dataServiceActive; }
00141
00201 uint32
00202 getCurrentTimestamp() const;
00203
00211 void
00212 setSessionBandwidth(uint32 bw)
00213 { sessionBw = bw; }
00214
00215 uint32
00216 getDefaultSessionBandwidth() const
00217 { return defaultSessionBw; }
00218
00219 uint32
00220 getSessionBandwidth() const
00221 { return sessionBw; }
00222
00226 inline void
00227 setTimeclock()
00228 { timeclock.setTimer(); }
00229
00235 inline timeout_t
00236 getTimeclock() const
00237 { return timeclock.getElapsed(); }
00238
00239 protected:
00240
00248 RTPDataQueue(uint32 size = defaultMembersHashSize);
00249
00265 RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
00266
00271 inline virtual
00272 ~RTPDataQueue()
00273 { endQueue(); }
00274
00278 inline virtual void
00279 timerTick()
00280 { return; }
00281
00282 void renewLocalSSRC()
00283 {IncomingDataQueue::renewLocalSSRC();}
00284
00285 private:
00286 RTPDataQueue(const RTPDataQueue &o);
00287
00288 RTPDataQueue&
00289 operator=(const RTPDataQueue &o);
00290
00296 void
00297 initQueue();
00298
00299 protected:
00303 void
00304 endQueue();
00305
00313 virtual bool
00314 isPendingData(microtimeout_t timeout) = 0;
00315
00316 private:
00317
00318 volatile bool dataServiceActive;
00319 Tos typeOfService;
00320 TimerPort timeclock;
00321
00322 static const uint32 defaultSessionBw;
00323 uint32 sessionBw;
00324
00325
00326 };
00327
00329
00330 END_NAMESPACE
00331
00332 #endif //CCXX_RTP_IOQUEUE_H_
00333