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

Bayonne2 / Common C++ 2 Framework
queuebase.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_QUEUEBASE_H_
45 #define CCXX_RTP_QUEUEBASE_H_
46 
47 #include <cc++/pointer.h>
48 #include <ccrtp/rtppkt.h>
49 #include <ccrtp/sources.h>
50 
51 #ifdef CCXX_NAMESPACES
52 namespace ost {
53 #endif
54 
71  class __EXPORT AppDataUnit
72 {
73 public:
74  AppDataUnit(const IncomingRTPPkt& packet, const SyncSource& src);
75 
76   inline ~AppDataUnit()
77  { }
78 
82  AppDataUnit(const AppDataUnit& src);
83 
90  AppDataUnit&
91  operator=(const AppDataUnit& source);
92 
96  inline PayloadType
97   getType() const
98 { return datablock->getPayloadType(); }
99 
107  inline const uint8* const
108   getData() const
109 { return datablock->getPayload(); }
110 
114  size_t
115   getSize() const
116 { return datablock->getPayloadSize(); }
117 
121  inline const SyncSource&
122   getSource() const
123 { return *source; }
124 
130  inline bool
131   isMarked() const
132 { return datablock->isMarked(); }
133 
137  inline uint16
138   getSeqNum() const
139 { return datablock->getSeqNum(); }
140 
144  inline uint8
145   getContributorsCount() const
146 { return (uint8)datablock->getCSRCsCount(); }
147 
153  inline const uint32*
154   getContributorsID() const
155 { return datablock->getCSRCs(); }
156 
157 private:
158   Pointer<const IncomingRTPPkt> datablock;
159   const SyncSource* source;
160 };
161 
169  class __EXPORT RTPQueueBase
170 {
171 public:
179  inline bool
180   setPayloadFormat(const PayloadFormat& pf)
181  {
182  currentPayloadType = pf.getPayloadType();
183  currentRTPClockRate = pf.getRTPClockRate();
184  return true;
185  }
186 
187   inline uint32 getLocalSSRC() const
188 { return localSSRC; }
189 
198   inline uint32 getCurrentRTPClockRate() const
199 { return currentRTPClockRate; }
200 
201   inline PayloadType getCurrentPayloadType() const
202 { return currentPayloadType; }
203 
204   inline timeval getInitialTime() const
205 { return initialTime; }
206 
207 protected:
212  RTPQueueBase(uint32 *ssrc = NULL);
213 
214   inline void setLocalSSRC(uint32 ssrc)
215  { localSSRC = ssrc; localSSRCNetwork = htonl(ssrc); }
216 
217   inline uint32 getLocalSSRCNetwork() const
218 { return localSSRCNetwork; }
219 
220  virtual
221   ~RTPQueueBase()
222  { }
223 
230  inline virtual size_t
231   dispatchBYE(const std::string&)
232  { return 0; }
233 
234  inline virtual void
235   renewLocalSSRC()
236  { }
237 
238 private:
239  // local SSRC 32-bit identifier
240   uint32 localSSRC;
241  // SSRC in network byte order
242   uint32 localSSRCNetwork;
243  // RTP clock rate for the current payload type.
244   uint32 currentRTPClockRate;
245  // Current payload type set for outgoing packets and expected
246  // from incoming packets.
247   PayloadType currentPayloadType;
248  // when the queue is created
249   timeval initialTime;
250 };
251 
257  class __EXPORT OutgoingDataQueueBase:
258  public virtual RTPQueueBase
259 {
260 public:
261  inline size_t
262   getDefaultMaxSendSegmentSize()
263  { return defaultMaxSendSegmentSize;}
264 
271  inline void
272   setMaxSendSegmentSize(size_t size)
273  { maxSendSegmentSize = size; }
274 
275  inline size_t
276   getMaxSendSegmentSize()
277  { return maxSendSegmentSize; }
278 
279 protected:
280  OutgoingDataQueueBase();
281 
282  inline virtual
283   ~OutgoingDataQueueBase()
284  { }
285 
286 private:
287   static const size_t defaultMaxSendSegmentSize;
288  // maximum packet size before fragmenting sends.
289   size_t maxSendSegmentSize;
290 };
291 
297  class __EXPORT IncomingDataQueueBase:
298  public virtual RTPQueueBase
299 {
300 public:
301   inline size_t getDefaultMaxRecvPacketSize() const
302 { return defaultMaxRecvPacketSize; }
303 
304  inline size_t
305   getMaxRecvPacketSize() const
306 { return maxRecvPacketSize; }
307 
318  inline void
319   setMaxRecvPacketSize(size_t maxsize)
320  { maxRecvPacketSize = maxsize; }
321 
322 protected:
323   IncomingDataQueueBase()
324  { setMaxRecvPacketSize(getDefaultMaxRecvPacketSize()); }
325 
326  inline virtual
327   ~IncomingDataQueueBase()
328  { }
329 
330 private:
331   static const size_t defaultMaxRecvPacketSize;
332  // filter value for received packets length.
333   size_t maxRecvPacketSize;
334 };
335  // queuebase
337 
338 #ifdef CCXX_NAMESPACES
339 }
340 #endif
341 
342 #endif //CCXX_RTP_QUEUEBASE_H_
343 
OutgoingDataQueueBase::~OutgoingDataQueueBase
virtual ~OutgoingDataQueueBase()
Definition: queuebase.h:283
RTPQueueBase::localSSRC
uint32 localSSRC
Definition: queuebase.h:240
AppDataUnit::isMarked
bool isMarked() const
Is this data unit marked?.
Definition: queuebase.h:131
RTPQueueBase::dispatchBYE
virtual size_t dispatchBYE(const std::string &)
A plugin point for posting of BYE messages.
Definition: queuebase.h:231
AppDataUnit::getType
PayloadType getType() const
Definition: queuebase.h:97
SyncSource
Synchronization source in an RTP session.
Definition: sources.h:195
AppDataUnit
Interface (envelope) to data received over RTP packets.
Definition: queuebase.h:71
AppDataUnit::getSeqNum
uint16 getSeqNum() const
Get data unit sequence number.
Definition: queuebase.h:138
IncomingRTPPkt
RTP packets received from other participants.
Definition: rtppkt.h:707
PayloadFormat
Base payload format class.
Definition: formats.h:132
RTPQueueBase::setPayloadFormat
bool setPayloadFormat(const PayloadFormat &pf)
Set the payload format in use, for timing and payload type identification purposes.
Definition: queuebase.h:180
OutgoingDataQueueBase::getDefaultMaxSendSegmentSize
size_t getDefaultMaxSendSegmentSize()
Definition: queuebase.h:262
IncomingDataQueueBase::maxRecvPacketSize
size_t maxRecvPacketSize
Definition: queuebase.h:333
IncomingDataQueueBase::~IncomingDataQueueBase
virtual ~IncomingDataQueueBase()
Definition: queuebase.h:327
RTPQueueBase::renewLocalSSRC
virtual void renewLocalSSRC()
Definition: queuebase.h:235
sources.h
Sources of synchronization and participants related clases.
IncomingDataQueueBase::getMaxRecvPacketSize
size_t getMaxRecvPacketSize() const
Definition: queuebase.h:305
RTPQueueBase::getCurrentPayloadType
PayloadType getCurrentPayloadType() const
Definition: queuebase.h:201
RTPQueueBase::localSSRCNetwork
uint32 localSSRCNetwork
Definition: queuebase.h:242
RTPQueueBase::getInitialTime
timeval getInitialTime() const
Definition: queuebase.h:204
AppDataUnit::datablock
Pointer< const IncomingRTPPkt > datablock
Definition: queuebase.h:158
PayloadFormat::getPayloadType
PayloadType getPayloadType() const
Get payload type numeric identifier carried in RTP packets.
Definition: formats.h:140
RTPQueueBase::setLocalSSRC
void setLocalSSRC(uint32 ssrc)
Definition: queuebase.h:214
OutgoingDataQueueBase::setMaxSendSegmentSize
void setMaxSendSegmentSize(size_t size)
Set maximum payload segment size before fragmenting sends.
Definition: queuebase.h:272
RTPQueueBase
A virtual base class for RTP queue hierarchies.
Definition: queuebase.h:169
OutgoingDataQueueBase::getMaxSendSegmentSize
size_t getMaxSendSegmentSize()
Definition: queuebase.h:276
RTPQueueBase::getLocalSSRCNetwork
uint32 getLocalSSRCNetwork() const
Definition: queuebase.h:217
__EXPORT
#define __EXPORT
Definition: audio2.h:51
AppDataUnit::source
const SyncSource * source
Definition: queuebase.h:159
PayloadFormat::getRTPClockRate
uint32 getRTPClockRate() const
Get RTP clock rate for this payload format.
Definition: formats.h:151
RTPQueueBase::~RTPQueueBase
virtual ~RTPQueueBase()
Definition: queuebase.h:221
RTPQueueBase::currentPayloadType
PayloadType currentPayloadType
Definition: queuebase.h:247
RTPQueueBase::getLocalSSRC
uint32 getLocalSSRC() const
Definition: queuebase.h:187
OutgoingDataQueueBase::maxSendSegmentSize
size_t maxSendSegmentSize
Definition: queuebase.h:289
IncomingDataQueueBase::getDefaultMaxRecvPacketSize
size_t getDefaultMaxRecvPacketSize() const
Definition: queuebase.h:301
RTPQueueBase::initialTime
timeval initialTime
Definition: queuebase.h:249
AppDataUnit::getSource
const SyncSource & getSource() const
Definition: queuebase.h:122
AppDataUnit::getSize
size_t getSize() const
Definition: queuebase.h:115
IncomingDataQueueBase::setMaxRecvPacketSize
void setMaxRecvPacketSize(size_t maxsize)
Definition: queuebase.h:319
AppDataUnit::getContributorsCount
uint8 getContributorsCount() const
Get the number of contributing sources in the CSRC list.
Definition: queuebase.h:145
AppDataUnit::getContributorsID
const uint32 * getContributorsID() const
Get the array of 32-bit CSRC identifiers.
Definition: queuebase.h:154
AppDataUnit::~AppDataUnit
~AppDataUnit()
Definition: queuebase.h:76
AppDataUnit::getData
const uint8 *const getData() const
Get data as it is received in RTP packets (i.e.
Definition: queuebase.h:108
RTPQueueBase::getCurrentRTPClockRate
uint32 getCurrentRTPClockRate() const
Get the clock rate in RTP clock units (for instance, 8000 units per second for PCMU, or 90000 units per second for MP2T).
Definition: queuebase.h:198
IncomingDataQueueBase::defaultMaxRecvPacketSize
static const size_t defaultMaxRecvPacketSize
Definition: queuebase.h:331
pointer.h
Template for creating reference count managed smart pointers.
RTPQueueBase::currentRTPClockRate
uint32 currentRTPClockRate
Definition: queuebase.h:244
rtppkt.h
RTP packets handling.
OutgoingDataQueueBase::defaultMaxSendSegmentSize
static const size_t defaultMaxSendSegmentSize
Definition: queuebase.h:287
PayloadType
uint8 PayloadType
RTP payload type numeric identifier.
Definition: formats.h:65

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 によって変換されたページ (->オリジナル) /