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
49
50 #ifdef CCXX_NAMESPACES
51 namespace ost {
52 #endif
53
80 {
81 public:
104 } Tos;
105
118 inline void
120 { typeOfService = tos; }
121
127 { dataServiceActive = true; }
128
133 { dataServiceActive = false; }
134
140 inline bool
142 { return dataServiceActive; }
143
203 uint32
204 getCurrentTimestamp() const;
205
213 void
215 { sessionBw = bw; }
216
217 uint32
219 { return defaultSessionBw; }
220
221 uint32
223 { return sessionBw; }
224
228 inline void
230 { timeclock.setTimer(); }
231
239 { return timeclock.getElapsed(); }
240
241 protected:
242
251
267 RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
268
273 inline virtual
275 { endQueue(); }
276
280 inline virtual void
282 { return; }
283
286
287 private:
289
292
298 void
299 initQueue();
300
301 protected:
305 void
306 endQueue();
307
315 virtual bool
317
318 private:
319 // true if connection "active"
323 /* RTP session bandwidth control */
326
327
328 };
329 // ioqueue
331
332 #ifdef CCXX_NAMESPACES
333 }
334 #endif
335
336 #endif //CCXX_RTP_IOQUEUE_H_
337
void setTimeclock()
Set the packet timeclock for synchronizing timestamps.
Best-effort network service.
void disableStack()
Disable packet queue processing in the stack.
uint32 microtimeout_t
Time interval expressed in microseconds.
uint32 getSessionBandwidth() const
Queue for incoming RTP data packets in an RTP session.
static const uint32 defaultSessionBw
bool isActive() const
Get active connection state flag.
void setSessionBandwidth(uint32 bw)
Specify the bandwidth of the current session.
Generic RTP input queues.
Generic RTP output queues.
void setTypeOfService(Tos tos)
Specify the kind of service the application expects to use.
virtual ~RTPDataQueue()
The queue destructor flushes the queue and stops all services.
void enableStack()
Enable packet queue processing in the stack.
virtual void timerTick()
A plugin point for timer tick driven events.
Timer ports are used to provide synchronized timing events when managed under a "service thread" such...
timeout_t getTimeclock() const
Get the packet timeclock for synchronizing timestamps.
A generic outgoing RTP data queue supporting multiple destinations.
uint32 getDefaultSessionBandwidth() const
A packet queue handler for building different kinds of RTP protocol systems.
volatile bool dataServiceActive