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
42 #ifndef CCXX_RTP_POOL_H
43 #define CCXX_RTP_POOL_H
44
45 #include <list>
47
48 NAMESPACE_COMMONCPP
49 using std::list;
50
52
54 {
55 public:
57 { return s.getSchedulingTimeout(); }
58
60 { return s.getRTCPCheckInterval(); }
61
62 size_t
64 { return s.takeInDataPacket(); }
65
66 size_t
68 { return s.dispatchDataPacket(); }
69
70 void
72 { s.controlReceptionService(); }
73
74 void
76 { s.controlTransmissionService(); }
77
79 { return s.getDataRecvSocket(); }
80
82 { return s.getControlRecvSocket(); }
83 };
84
93 private:
96
97 public:
102 };
103
104
106 : elem(e), cleared(false) {
107 }
108
113 }
114
117 }
118
121 }
122
129 {
130 protected:
132 public:
134
136 {
138 }
139 };
140
155 {
156 public:
158
160 { }
161
162 bool
164
165 bool
167
168 size_t
169 getPoolLength() const;
170
171 virtual void startRunning() = 0;
172
174 { return poolActive; }
175
176 protected:
178 { poolActive = true; }
179
181 { return poolTimeout; }
182
184 { poolTimeout.tv_sec = sec; poolTimeout.tv_usec = usec; }
185
187 { poolTimeout = to; }
188
191
193
194 #ifndef _MSWINDOWS_
197 #endif
198
199 private:
202 };
203
204
207 public Thread
208 {
209 public:
215 Thread(pri)
216 { }
217
219 { }
220
223
224 protected:
229 void run();
230 };
231
232 END_NAMESPACE
233
234 #endif //CCXX_RTP_POOL_H
235
std::list< SessionListElement * >::iterator PoolIterator
std::list< SessionListElement * > sessionList
size_t dispatchDataPacket(RTPSessionBase &s)
void controlTransmissionService(RTPSessionBase &s)
void setPoolTimeout(struct timeval to)
uint32 microtimeout_t
Time interval expressed in microseconds.
Generic RTP protocol stack for exchange of realtime data.
SOCKET getControlRecvSocket(RTPSessionBase &s) const
SOCKET getDataRecvSocket(RTPSessionBase &s) const
size_t takeInDataPacket(RTPSessionBase &s)
std equality for SessionListElement objects.
SessionListElement(RTPSessionBase *e)
SingleRTPSessionPool(int pri=0)
virtual ~RTPSessionPool()
timeval getRTCPCheckInterval(RTPSessionBase &s)
Class for tracking session status.
bool operator()(SessionListElement *e)
microtimeout_t getSchedulingTimeout(RTPSessionBase &s)
void controlReceptionService(RTPSessionBase &s)
PredEquals(RTPSessionBase *e)
This class is a base class for classes that define a group of RTP sessions that will be served by one...
TRTPSessionBase RTPSessionBase
Generic and audio/video profile specific RTP interface of ccRTP.
void setPoolTimeout(int sec, int usec)