SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Public Member Functions | Public Attributes | Private Attributes | List of all members
qrtplib::RTCPCompoundPacketBuilder::SDES Class Reference

Public Member Functions

 SDES ()
 
 ~SDES ()
 
void Clear ()
 
int AddSSRC (uint32_t ssrc)
 
int AddItem (uint8_t *buf, std::size_t len)
 
std::size_t NeededBytes ()
 
std::size_t NeededBytesWithExtraItem (uint8_t itemdatalength)
 
std::size_t NeededBytesWithExtraSource ()
 

Public Attributes

std::list< SDESSource * > sdessources
 

Private Attributes

std::list< SDESSource * >::const_iterator sdesit
 

Detailed Description

Definition at line 278 of file rtcpcompoundpacketbuilder.h.

Constructor & Destructor Documentation

◆ SDES()

qrtplib::RTCPCompoundPacketBuilder::SDES::SDES ( )
inline

Definition at line 281 of file rtcpcompoundpacketbuilder.h.

282  {
283  sdesit = sdessources.end();
284  }
std::list< SDESSource * >::const_iterator sdesit

◆ ~SDES()

qrtplib::RTCPCompoundPacketBuilder::SDES::~SDES ( )
inline

Definition at line 285 of file rtcpcompoundpacketbuilder.h.

Member Function Documentation

◆ AddItem()

int qrtplib::RTCPCompoundPacketBuilder::SDES::AddItem ( uint8_t buf,
std::size_t  len 
)
inline

Definition at line 308 of file rtcpcompoundpacketbuilder.h.

References ERR_RTP_RTCPCOMPPACKBUILDER_NOCURRENTSOURCE.

Referenced by qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), and qrtplib::RTCPCompoundPacketBuilder::AddSDESPrivateItem().

309  {
310  if (sdessources.empty())
312  (*sdesit)->AddItem(buf, len);
313  return 0;
314  }
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOCURRENTSOURCE
Definition: rtperrors.h:92
+ Here is the caller graph for this function:

◆ AddSSRC()

int qrtplib::RTCPCompoundPacketBuilder::SDES::AddSSRC ( uint32_t  ssrc)
inline

Definition at line 299 of file rtcpcompoundpacketbuilder.h.

Referenced by qrtplib::RTCPCompoundPacketBuilder::AddSDESSource().

300  {
301  SDESSource *s = new SDESSource(ssrc);
302  sdessources.push_back(s);
303  sdesit = sdessources.end();
304  sdesit--;
305  return 0;
306  }
std::list< SDESSource * >::const_iterator sdesit
+ Here is the caller graph for this function:

◆ Clear()

void qrtplib::RTCPCompoundPacketBuilder::SDES::Clear ( )
inline

Definition at line 290 of file rtcpcompoundpacketbuilder.h.

Referenced by qrtplib::RTCPCompoundPacketBuilder::ClearBuildBuffers().

291  {
292  std::list<SDESSource *>::const_iterator it;
293 
294  for (it = sdessources.begin(); it != sdessources.end(); it++)
295  delete *it;
296  sdessources.clear();
297  }
+ Here is the caller graph for this function:

◆ NeededBytes()

std::size_t qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytes ( )
inline

Definition at line 316 of file rtcpcompoundpacketbuilder.h.

Referenced by qrtplib::RTCPCompoundPacketBuilder::AddAPPPacket(), qrtplib::RTCPCompoundPacketBuilder::AddBYEPacket(), qrtplib::RTCPCompoundPacketBuilder::AddReportBlock(), qrtplib::RTCPCompoundPacketBuilder::EndBuild(), qrtplib::RTCPCompoundPacketBuilder::StartReceiverReport(), and qrtplib::RTCPCompoundPacketBuilder::StartSenderReport().

317  {
318  std::list<SDESSource *>::const_iterator it;
319  std::size_t x = 0;
320  std::size_t n, d, r;
321 
322  if (sdessources.empty())
323  return 0;
324 
325  for (it = sdessources.begin(); it != sdessources.end(); it++)
326  x += (*it)->NeededBytes();
327  n = sdessources.size();
328  d = n / 31;
329  r = n % 31;
330  if (r != 0)
331  d++;
332  x += d * sizeof(RTCPCommonHeader);
333  return x;
334  }
+ Here is the caller graph for this function:

◆ NeededBytesWithExtraItem()

std::size_t qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytesWithExtraItem ( uint8_t  itemdatalength)
inline

Definition at line 336 of file rtcpcompoundpacketbuilder.h.

Referenced by qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), and qrtplib::RTCPCompoundPacketBuilder::AddSDESPrivateItem().

337  {
338  std::list<SDESSource *>::const_iterator it;
339  std::size_t x = 0;
340  std::size_t n, d, r;
341 
342  if (sdessources.empty())
343  return 0;
344 
345  for (it = sdessources.begin(); it != sdesit; it++)
346  x += (*it)->NeededBytes();
347  x += (*sdesit)->NeededBytesWithExtraItem(itemdatalength);
348  n = sdessources.size();
349  d = n / 31;
350  r = n % 31;
351  if (r != 0)
352  d++;
353  x += d * sizeof(RTCPCommonHeader);
354  return x;
355  }
std::list< SDESSource * >::const_iterator sdesit
+ Here is the caller graph for this function:

◆ NeededBytesWithExtraSource()

std::size_t qrtplib::RTCPCompoundPacketBuilder::SDES::NeededBytesWithExtraSource ( )
inline

Definition at line 357 of file rtcpcompoundpacketbuilder.h.

Referenced by qrtplib::RTCPCompoundPacketBuilder::AddSDESSource().

358  {
359  std::list<SDESSource *>::const_iterator it;
360  std::size_t x = 0;
361  std::size_t n, d, r;
362 
363  if (sdessources.empty())
364  return 0;
365 
366  for (it = sdessources.begin(); it != sdessources.end(); it++)
367  x += (*it)->NeededBytes();
368 
369  // for the extra source we'll need at least 8 bytes (ssrc and four 0 bytes)
370  x += sizeof(uint32_t) * 2;
371 
372  n = sdessources.size() + 1; // also, the number of sources will increase
373  d = n / 31;
374  r = n % 31;
375  if (r != 0)
376  d++;
377  x += d * sizeof(RTCPCommonHeader);
378  return x;
379  }
unsigned int uint32_t
Definition: rtptypes_win.h:46
+ Here is the caller graph for this function:

Member Data Documentation

◆ sdesit

std::list<SDESSource *>::const_iterator qrtplib::RTCPCompoundPacketBuilder::SDES::sdesit
private

Definition at line 383 of file rtcpcompoundpacketbuilder.h.

◆ sdessources

std::list<SDESSource *> qrtplib::RTCPCompoundPacketBuilder::SDES::sdessources

The documentation for this class was generated from the following file: