ccRTP 2.1.2: ioqueue.h Source File

ccRTP 2.1.2
ioqueue.h
Go to the documentation of this file.
1 // Copyright (C) 2001-2015 Federico Montesino Pouzols <fedemp@altern.org>.
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with GNU ccRTP. If not, see <http://www.gnu.org/licenses/>.
15 //
16 // As a special exception, you may use this file as part of a free software
17 // library without restriction. Specifically, if other files instantiate
18 // templates or use macros or inline functions from this file, or you compile
19 // this file and link it with other files to produce an executable, this
20 // file does not by itself cause the resulting executable to be covered by
21 // the GNU General Public License. This exception does not however
22 // invalidate any other reasons why the executable file might be covered by
23 // the GNU General Public License.
24 //
25 // This exception applies only to the code released under the name GNU
26 // ccRTP. If you copy code from other releases into a copy of GNU
27 // ccRTP, as the General Public License permits, the exception does
28 // not apply to the code that you add in this way. To avoid misleading
29 // anyone as to the status of such modified files, you must delete
30 // this exception notice from them.
31 //
32 // If you write modifications of your own for GNU ccRTP, it is your choice
33 // whether to permit this exception to apply to your modifications.
34 // If you do not wish that, delete this exception notice.
35 //
36 
43 #ifndef CCXX_RTP_IOQUEUE_H_
44 #define CCXX_RTP_IOQUEUE_H_
45 
46 #include <ccrtp/iqueue.h>
47 #include <ccrtp/oqueue.h>
48 
49 NAMESPACE_COMMONCPP
50 
74  class __EXPORT RTPDataQueue :
75  public IncomingDataQueue,
76  public OutgoingDataQueue
77 {
78 public:
98   typedef enum {
99   tosBestEffort,
100   tosEnhanced
101  } Tos;
102 
115  inline void
116   setTypeOfService(Tos tos)
117  { typeOfService = tos; }
118 
123   inline void enableStack()
124  { dataServiceActive = true; }
125 
129   inline void disableStack()
130  { dataServiceActive = false; }
131 
137  inline bool
138   isActive() const
139 { return dataServiceActive; }
140 
200  uint32
201  getCurrentTimestamp() const;
202 
210  void
211   setSessionBandwidth(uint32 bw)
212  { sessionBw = bw; }
213 
214  uint32
215   getDefaultSessionBandwidth() const
216 { return defaultSessionBw; }
217 
218  uint32
219   getSessionBandwidth() const
220 { return sessionBw; }
221 
225  inline void
226   setTimeclock()
227  { timeclock.setTimer(); }
228 
234  inline timeout_t
235   getTimeclock() const
236 { return timeclock.getElapsed(); }
237 
238 protected:
239 
247  RTPDataQueue(uint32 size = defaultMembersHashSize);
248 
264  RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
265 
270  inline virtual
271   ~RTPDataQueue()
272  { endQueue(); }
273 
277  inline virtual void
278   timerTick()
279  { return; }
280 
281   void renewLocalSSRC()
282  {IncomingDataQueue::renewLocalSSRC();}
283 
284 private:
285  RTPDataQueue(const RTPDataQueue &o);
286 
287  RTPDataQueue&
288  operator=(const RTPDataQueue &o);
289 
295  void
296  initQueue();
297 
298 protected:
302  void
303  endQueue();
304 
312  virtual bool
313  isPendingData(microtimeout_t timeout) = 0;
314 
315 private:
316  // true if connection "active"
317   volatile bool dataServiceActive;
318   Tos typeOfService;
319   TimerPort timeclock;
320  /* RTP session bandwidth control */
321   static const uint32 defaultSessionBw;
322   uint32 sessionBw;
323 
324 
325 };
326  // ioqueue
328 
329 END_NAMESPACE
330 
331 #endif //CCXX_RTP_IOQUEUE_H_
332 
RTPDataQueue::setTimeclock
void setTimeclock()
Set the packet timeclock for synchronizing timestamps.
Definition: ioqueue.h:226
RTPDataQueue::tosBestEffort
Best-effort network service.
Definition: ioqueue.h:99
RTPDataQueue::disableStack
void disableStack()
Disable packet queue processing in the stack.
Definition: ioqueue.h:129
RTPDataQueue::renewLocalSSRC
void renewLocalSSRC()
Definition: ioqueue.h:281
IncomingDataQueue::renewLocalSSRC
void renewLocalSSRC()
Definition: incqueue.cpp:128
RTPDataQueue::typeOfService
Tos typeOfService
Definition: ioqueue.h:318
microtimeout_t
uint32 microtimeout_t
Time interval expressed in microseconds.
Definition: base.h:67
RTPDataQueue::getSessionBandwidth
uint32 getSessionBandwidth() const
Definition: ioqueue.h:219
IncomingDataQueue
Queue for incoming RTP data packets in an RTP session.
Definition: iqueue.h:883
RTPDataQueue::defaultSessionBw
static const uint32 defaultSessionBw
Definition: ioqueue.h:321
MembershipBookkeeping::operator=
MembershipBookkeeping & operator=(const MembershipBookkeeping &o)
RTPDataQueue::sessionBw
uint32 sessionBw
Definition: ioqueue.h:322
RTPDataQueue::isActive
bool isActive() const
Get active connection state flag.
Definition: ioqueue.h:138
RTPDataQueue::setSessionBandwidth
void setSessionBandwidth(uint32 bw)
Specify the bandwidth of the current session.
Definition: ioqueue.h:211
iqueue.h
Generic RTP input queues.
oqueue.h
Generic RTP output queues.
RTPDataQueue::setTypeOfService
void setTypeOfService(Tos tos)
Specify the kind of service the application expects to use.
Definition: ioqueue.h:116
RTPDataQueue::~RTPDataQueue
virtual ~RTPDataQueue()
The queue destructor flushes the queue and stops all services.
Definition: ioqueue.h:271
__EXPORT
#define __EXPORT
Definition: ZrtpCallback.h:40
RTPDataQueue::enableStack
void enableStack()
Enable packet queue processing in the stack.
Definition: ioqueue.h:123
RTPDataQueue::timeclock
TimerPort timeclock
Definition: ioqueue.h:319
RTPDataQueue::timerTick
virtual void timerTick()
A plugin point for timer tick driven events.
Definition: ioqueue.h:278
RTPDataQueue::getTimeclock
timeout_t getTimeclock() const
Get the packet timeclock for synchronizing timestamps.
Definition: ioqueue.h:235
OutgoingDataQueue
A generic outgoing RTP data queue supporting multiple destinations.
Definition: oqueue.h:219
RTPDataQueue::Tos
Tos
rtp.h cc++/rtp.h
Definition: ioqueue.h:98
RTPDataQueue::getDefaultSessionBandwidth
uint32 getDefaultSessionBandwidth() const
Definition: ioqueue.h:215
RTPDataQueue
A packet queue handler for building different kinds of RTP protocol systems.
Definition: ioqueue.h:74
RTPDataQueue::dataServiceActive
volatile bool dataServiceActive
Definition: ioqueue.h:317

Generated on Dec 15, 2017 for ccrtp-2.1.2 (*.h and *.cpp) and libzrtpcpp-2.3.4 (*.h), by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /