Bayonne2 / Common C++ 2 Framework: ioqueue.h Source File

Bayonne2 / Common C++ 2 Framework
ioqueue.h
Go to the documentation of this file.
1 // Copyright (C) 2001,2002,2004 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 General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 //
17 // As a special exception, you may use this file as part of a free software
18 // library without restriction. Specifically, if other files instantiate
19 // templates or use macros or inline functions from this file, or you compile
20 // this file and link it with other files to produce an executable, this
21 // file does not by itself cause the resulting executable to be covered by
22 // the GNU General Public License. This exception does not however
23 // invalidate any other reasons why the executable file might be covered by
24 // the GNU General Public License.
25 //
26 // This exception applies only to the code released under the name GNU
27 // ccRTP. If you copy code from other releases into a copy of GNU
28 // ccRTP, as the General Public License permits, the exception does
29 // not apply to the code that you add in this way. To avoid misleading
30 // anyone as to the status of such modified files, you must delete
31 // this exception notice from them.
32 //
33 // If you write modifications of your own for GNU ccRTP, it is your choice
34 // whether to permit this exception to apply to your modifications.
35 // If you do not wish that, delete this exception notice.
36 //
37 
44 #ifndef CCXX_RTP_IOQUEUE_H_
45 #define CCXX_RTP_IOQUEUE_H_
46 
47 #include <ccrtp/iqueue.h>
48 #include <ccrtp/oqueue.h>
49 
50 #ifdef CCXX_NAMESPACES
51 namespace ost {
52 #endif
53 
77  class __EXPORT RTPDataQueue :
78  public IncomingDataQueue,
79  public OutgoingDataQueue
80 {
81 public:
101   typedef enum {
102   tosBestEffort,
103   tosEnhanced
104  } Tos;
105 
118  inline void
119   setTypeOfService(Tos tos)
120  { typeOfService = tos; }
121 
126   inline void enableStack()
127  { dataServiceActive = true; }
128 
132   inline void disableStack()
133  { dataServiceActive = false; }
134 
140  inline bool
141   isActive() const
142 { return dataServiceActive; }
143 
203  uint32
204  getCurrentTimestamp() const;
205 
213  void
214   setSessionBandwidth(uint32 bw)
215  { sessionBw = bw; }
216 
217  uint32
218   getDefaultSessionBandwidth() const
219 { return defaultSessionBw; }
220 
221  uint32
222   getSessionBandwidth() const
223 { return sessionBw; }
224 
228  inline void
229   setTimeclock()
230  { timeclock.setTimer(); }
231 
237  inline timeout_t
238   getTimeclock() const
239 { return timeclock.getElapsed(); }
240 
241 protected:
242 
250  RTPDataQueue(uint32 size = defaultMembersHashSize);
251 
267  RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
268 
273  inline virtual
274   ~RTPDataQueue()
275  { endQueue(); }
276 
280  inline virtual void
281   timerTick()
282  { return; }
283 
284   void renewLocalSSRC()
285  {IncomingDataQueue::renewLocalSSRC();}
286 
287 private:
288  RTPDataQueue(const RTPDataQueue &o);
289 
290  RTPDataQueue&
291  operator=(const RTPDataQueue &o);
292 
298  void
299  initQueue();
300 
301 protected:
305  void
306  endQueue();
307 
315  virtual bool
316  isPendingData(microtimeout_t timeout) = 0;
317 
318 private:
319  // true if connection "active"
320   volatile bool dataServiceActive;
321   Tos typeOfService;
322   TimerPort timeclock;
323  /* RTP session bandwidth control */
324   static const uint32 defaultSessionBw;
325   uint32 sessionBw;
326 
327 
328 };
329  // ioqueue
331 
332 #ifdef CCXX_NAMESPACES
333 }
334 #endif
335 
336 #endif //CCXX_RTP_IOQUEUE_H_
337 
RTPDataQueue::setTimeclock
void setTimeclock()
Set the packet timeclock for synchronizing timestamps.
Definition: ioqueue.h:229
RTPDataQueue::tosBestEffort
Best-effort network service.
Definition: ioqueue.h:102
RTPDataQueue::disableStack
void disableStack()
Disable packet queue processing in the stack.
Definition: ioqueue.h:132
RTPDataQueue::renewLocalSSRC
void renewLocalSSRC()
Definition: ioqueue.h:284
IncomingDataQueue::renewLocalSSRC
void renewLocalSSRC()
RTPDataQueue::typeOfService
Tos typeOfService
Definition: ioqueue.h:321
microtimeout_t
uint32 microtimeout_t
Time interval expressed in microseconds.
Definition: base.h:69
RTPDataQueue::getSessionBandwidth
uint32 getSessionBandwidth() const
Definition: ioqueue.h:222
IncomingDataQueue
Queue for incoming RTP data packets in an RTP session.
Definition: iqueue.h:883
RTPDataQueue::defaultSessionBw
static const uint32 defaultSessionBw
Definition: ioqueue.h:324
RTPDataQueue::sessionBw
uint32 sessionBw
Definition: ioqueue.h:325
timeout_t
unsigned long timeout_t
Definition: thread.h:74
RTPDataQueue::isActive
bool isActive() const
Get active connection state flag.
Definition: ioqueue.h:141
RTPDataQueue::setSessionBandwidth
void setSessionBandwidth(uint32 bw)
Specify the bandwidth of the current session.
Definition: ioqueue.h:214
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:119
RTPDataQueue::~RTPDataQueue
virtual ~RTPDataQueue()
The queue destructor flushes the queue and stops all services.
Definition: ioqueue.h:274
RTPDataQueue::enableStack
void enableStack()
Enable packet queue processing in the stack.
Definition: ioqueue.h:126
RTPDataQueue::timeclock
TimerPort timeclock
Definition: ioqueue.h:322
RTPDataQueue::timerTick
virtual void timerTick()
A plugin point for timer tick driven events.
Definition: ioqueue.h:281
__EXPORT
#define __EXPORT
Definition: audio2.h:51
TimerPort
Timer ports are used to provide synchronized timing events when managed under a "service thread" such...
Definition: thread.h:1759
RTPDataQueue::getTimeclock
timeout_t getTimeclock() const
Get the packet timeclock for synchronizing timestamps.
Definition: ioqueue.h:238
OutgoingDataQueue
A generic outgoing RTP data queue supporting multiple destinations.
Definition: oqueue.h:222
RTPDataQueue::Tos
Tos
rtp.h cc++/rtp.h
Definition: ioqueue.h:101
RTPDataQueue::getDefaultSessionBandwidth
uint32 getDefaultSessionBandwidth() const
Definition: ioqueue.h:218
RTPDataQueue
A packet queue handler for building different kinds of RTP protocol systems.
Definition: ioqueue.h:77
RTPDataQueue::dataServiceActive
volatile bool dataServiceActive
Definition: ioqueue.h:320

Generated on Dec 21, 2017 for commoncpp2-1.8.1, ccrtp-1.7.2, libzrtpcpp-2.3.4, ccscript3-1.1.7, ccaudio2-1.0.0 and bayonne2-2.3.2 (after installation in /usr/local/) by   doxygen 1.8.6

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