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
48
49 NAMESPACE_COMMONCPP
50
77 {
78 public:
101 } Tos;
102
115 inline void
117 { typeOfService = tos; }
118
124 { dataServiceActive = true; }
125
130 { dataServiceActive = false; }
131
137 inline bool
139 { return dataServiceActive; }
140
200 uint32
201 getCurrentTimestamp() const;
202
210 void
212 { sessionBw = bw; }
213
214 uint32
216 { return defaultSessionBw; }
217
218 uint32
220 { return sessionBw; }
221
225 inline void
227 { timeclock.setTimer(); }
228
234 inline timeout_t
236 { return timeclock.getElapsed(); }
237
238 protected:
239
248
264 RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
265
270 inline virtual
272 { endQueue(); }
273
277 inline virtual void
279 { return; }
280
283
284 private:
286
289
295 void
296 initQueue();
297
298 protected:
302 void
303 endQueue();
304
312 virtual bool
314
315 private:
316 // true if connection "active"
320 /* RTP session bandwidth control */
323
324
325 };
326 // ioqueue
328
329 END_NAMESPACE
330
331 #endif //CCXX_RTP_IOQUEUE_H_
332
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
MembershipBookkeeping & operator=(const MembershipBookkeeping &o)
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.
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