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 #ifdef CCXX_NAMESPACES
00051 namespace ost {
00052 #endif
00053
00077 class __EXPORT RTPDataQueue :
00078 public IncomingDataQueue,
00079 public OutgoingDataQueue
00080 {
00081 public:
00101 typedef enum {
00102 tosBestEffort,
00103 tosEnhanced
00104 } Tos;
00105
00118 inline void
00119 setTypeOfService(Tos tos)
00120 { typeOfService = tos; }
00121
00126 inline void enableStack()
00127 { dataServiceActive = true; }
00128
00132 inline void disableStack()
00133 { dataServiceActive = false; }
00134
00140 inline bool
00141 isActive() const
00142 { return dataServiceActive; }
00143
00203 uint32
00204 getCurrentTimestamp() const;
00205
00213 void
00214 setSessionBandwidth(uint32 bw)
00215 { sessionBw = bw; }
00216
00217 uint32
00218 getDefaultSessionBandwidth() const
00219 { return defaultSessionBw; }
00220
00221 uint32
00222 getSessionBandwidth() const
00223 { return sessionBw; }
00224
00228 inline void
00229 setTimeclock()
00230 { timeclock.setTimer(); }
00231
00237 inline timeout_t
00238 getTimeclock() const
00239 { return timeclock.getElapsed(); }
00240
00241 protected:
00242
00250 RTPDataQueue(uint32 size = defaultMembersHashSize);
00251
00267 RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
00268
00273 inline virtual
00274 ~RTPDataQueue()
00275 { endQueue(); }
00276
00280 inline virtual void
00281 timerTick()
00282 { return; }
00283
00284 void renewLocalSSRC()
00285 {IncomingDataQueue::renewLocalSSRC();}
00286
00287 private:
00288 RTPDataQueue(const RTPDataQueue &o);
00289
00290 RTPDataQueue&
00291 operator=(const RTPDataQueue &o);
00292
00298 void
00299 initQueue();
00300
00301 protected:
00305 void
00306 endQueue();
00307
00315 virtual bool
00316 isPendingData(microtimeout_t timeout) = 0;
00317
00318 private:
00319
00320 volatile bool dataServiceActive;
00321 Tos typeOfService;
00322 TimerPort timeclock;
00323
00324 static const uint32 defaultSessionBw;
00325 uint32 sessionBw;
00326
00327
00328 };
00329
00331
00332 #ifdef CCXX_NAMESPACES
00333 }
00334 #endif
00335
00336 #endif //CCXX_RTP_IOQUEUE_H_
00337