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
00134 inline bool
00135 isActive() const
00136 { return dataServiceActive; }
00137
00197 uint32
00198 getCurrentTimestamp() const;
00199
00207 void
00208 setSessionBandwidth(uint32 bw)
00209 { sessionBw = bw; }
00210
00211 uint32
00212 getDefaultSessionBandwidth() const
00213 { return defaultSessionBw; }
00214
00215 uint32
00216 getSessionBandwidth() const
00217 { return sessionBw; }
00218
00222 inline void
00223 setTimeclock()
00224 { timeclock.setTimer(); }
00225
00231 inline timeout_t
00232 getTimeclock() const
00233 { return timeclock.getElapsed(); }
00234
00235 protected:
00236
00244 RTPDataQueue(uint32 size = defaultMembersHashSize);
00245
00261 RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
00262
00267 inline virtual
00268 ~RTPDataQueue()
00269 { endQueue(); }
00270
00274 inline virtual void
00275 timerTick()
00276 { return; }
00277
00278 void renewLocalSSRC()
00279 {IncomingDataQueue::renewLocalSSRC();};
00280
00281 private:
00282 RTPDataQueue(const RTPDataQueue &o);
00283
00284 RTPDataQueue&
00285 operator=(const RTPDataQueue &o);
00286
00292 void
00293 initQueue();
00294
00295 protected:
00299 void
00300 endQueue();
00301
00309 virtual bool
00310 isPendingData(microtimeout_t timeout) = 0;
00311
00312 private:
00313
00314 volatile bool dataServiceActive;
00315 Tos typeOfService;
00316 TimerPort timeclock;
00317
00318 static const uint32 defaultSessionBw;
00319 uint32 sessionBw;
00320
00321
00322 };
00323
00325
00326 #ifdef CCXX_NAMESPACES
00327 }
00328 #endif
00329
00330 #endif //CCXX_RTP_IOQUEUE_H_
00331