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
00043 #ifndef CCXX_RTP_IOQUEUE_H_
00044 #define CCXX_RTP_IOQUEUE_H_
00045
00046 #include <ccrtp/iqueue.h>
00047 #include <ccrtp/oqueue.h>
00048
00049 NAMESPACE_COMMONCPP
00050
00074 class __EXPORT RTPDataQueue :
00075 public IncomingDataQueue,
00076 public OutgoingDataQueue
00077 {
00078 public:
00098 typedef enum {
00099 tosBestEffort,
00100 tosEnhanced
00101 } Tos;
00102
00115 inline void
00116 setTypeOfService(Tos tos)
00117 { typeOfService = tos; }
00118
00123 inline void enableStack()
00124 { dataServiceActive = true; }
00125
00129 inline void disableStack()
00130 { dataServiceActive = false; }
00131
00137 inline bool
00138 isActive() const
00139 { return dataServiceActive; }
00140
00200 uint32
00201 getCurrentTimestamp() const;
00202
00210 void
00211 setSessionBandwidth(uint32 bw)
00212 { sessionBw = bw; }
00213
00214 uint32
00215 getDefaultSessionBandwidth() const
00216 { return defaultSessionBw; }
00217
00218 uint32
00219 getSessionBandwidth() const
00220 { return sessionBw; }
00221
00225 inline void
00226 setTimeclock()
00227 { timeclock.setTimer(); }
00228
00234 inline timeout_t
00235 getTimeclock() const
00236 { return timeclock.getElapsed(); }
00237
00238 protected:
00239
00247 RTPDataQueue(uint32 size = defaultMembersHashSize);
00248
00264 RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
00265
00270 inline virtual
00271 ~RTPDataQueue()
00272 { endQueue(); }
00273
00277 inline virtual void
00278 timerTick()
00279 { return; }
00280
00281 void renewLocalSSRC()
00282 {IncomingDataQueue::renewLocalSSRC();}
00283
00284 private:
00285 RTPDataQueue(const RTPDataQueue &o);
00286
00287 RTPDataQueue&
00288 operator=(const RTPDataQueue &o);
00289
00295 void
00296 initQueue();
00297
00298 protected:
00302 void
00303 endQueue();
00304
00312 virtual bool
00313 isPendingData(microtimeout_t timeout) = 0;
00314
00315 private:
00316
00317 volatile bool dataServiceActive;
00318 Tos typeOfService;
00319 TimerPort timeclock;
00320
00321 static const uint32 defaultSessionBw;
00322 uint32 sessionBw;
00323
00324
00325 };
00326
00328
00329 END_NAMESPACE
00330
00331 #endif //CCXX_RTP_IOQUEUE_H_
00332