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.
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
qrtplib::RTCPPacketBuilder Class Reference

#include <rtcppacketbuilder.h>

+ Collaboration diagram for qrtplib::RTCPPacketBuilder:

Classes

class  RTCPSDESInfoInternal
 

Public Member Functions

 RTCPPacketBuilder (RTPSources &sources, RTPPacketBuilder &rtppackbuilder)
 
 ~RTCPPacketBuilder ()
 
int Init (std::size_t maxpacksize, double timestampunit, const void *cname, std::size_t cnamelen)
 
void Destroy ()
 
int SetTimestampUnit (double tsunit)
 
int SetMaximumPacketSize (std::size_t maxpacksize)
 
int SetPreTransmissionDelay (const RTPTime &delay)
 
int BuildNextPacket (RTCPCompoundPacket **pack)
 
int BuildBYEPacket (RTCPCompoundPacket **pack, const void *reason, std::size_t reasonlength, bool useSRifpossible=true)
 
void SetNameInterval (int count)
 
void SetEMailInterval (int count)
 
void SetLocationInterval (int count)
 
void SetPhoneInterval (int count)
 
void SetToolInterval (int count)
 
void SetNoteInterval (int count)
 
int SetLocalName (const void *s, std::size_t len)
 
int SetLocalEMail (const void *s, std::size_t len)
 
int SetLocalLocation (const void *s, std::size_t len)
 
int SetLocalPhone (const void *s, std::size_t len)
 
int SetLocalTool (const void *s, std::size_t len)
 
int SetLocalNote (const void *s, std::size_t len)
 
uint8_tGetLocalCNAME (std::size_t *len) const
 

Private Member Functions

void ClearAllSourceFlags ()
 
int FillInReportBlocks (RTCPCompoundPacketBuilder *pack, const RTPTime &curtime, int maxcount, bool *full, int *added, int *skipped, bool *atendoflist)
 
int FillInSDES (RTCPCompoundPacketBuilder *pack, bool *full, bool *processedall, int *added)
 
void ClearAllSDESFlags ()
 

Private Attributes

RTPSourcessources
 
RTPPacketBuilderrtppacketbuilder
 
bool init
 
std::size_t maxpacketsize
 
double timestampunit
 
bool firstpacket
 
RTPTime prevbuildtime
 
RTPTime transmissiondelay
 
RTCPSDESInfoInternal ownsdesinfo
 
int interval_name
 
int interval_email
 
int interval_location
 
int interval_phone
 
int interval_tool
 
int interval_note
 
bool doname
 
bool doemail
 
bool doloc
 
bool dophone
 
bool dotool
 
bool donote
 
bool processingsdes
 
int sdesbuildcount
 

Detailed Description

This class can be used to build RTCP compound packets, on a higher level than the RTCPCompoundPacketBuilder. The class RTCPPacketBuilder can be used to build RTCP compound packets. This class is more high-level than the RTCPCompoundPacketBuilder class: it uses the information of an RTPPacketBuilder instance and of an RTPSources instance to automatically generate the next compound packet which should be sent. It also provides functions to determine when SDES items other than the CNAME item should be sent.

Definition at line 64 of file rtcppacketbuilder.h.

Constructor & Destructor Documentation

◆ RTCPPacketBuilder()

qrtplib::RTCPPacketBuilder::RTCPPacketBuilder ( RTPSources sources,
RTPPacketBuilder rtppackbuilder 
)

Creates an RTCPPacketBuilder instance. Creates an instance which will use the source table sources and the RTP packet builder rtppackbuilder to determine the information for the next RTCP compound packet. Optionally, the memory manager mgr can be installed.

Definition at line 43 of file rtcppacketbuilder.cpp.

References qrtplib::RTPTimeInitializerObject::Dummy(), init, and qrtplib::timeinit.

+ Here is the call graph for this function:

◆ ~RTCPPacketBuilder()

qrtplib::RTCPPacketBuilder::~RTCPPacketBuilder ( )

Definition at line 50 of file rtcppacketbuilder.cpp.

References Destroy().

51 {
52  Destroy();
53 }
+ Here is the call graph for this function:

Member Function Documentation

◆ BuildBYEPacket()

int qrtplib::RTCPPacketBuilder::BuildBYEPacket ( RTCPCompoundPacket **  pack,
const void *  reason,
std::size_t  reasonlength,
bool  useSRifpossible = true 
)

Builds a BYE packet with reason for leaving specified by reason and length reasonlength. Builds a BYE packet with reason for leaving specified by reason and length reasonlength. If useSRifpossible is set to true, the RTCP compound packet will start with a sender report if allowed. Otherwise, a receiver report is used.

Definition at line 627 of file rtcppacketbuilder.cpp.

References qrtplib::RTCPCompoundPacketBuilder::AddBYEPacket(), qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), qrtplib::RTCPCompoundPacketBuilder::AddSDESSource(), qrtplib::RTCPSDESPacket::CNAME, qrtplib::RTPTime::CurrentTime(), qrtplib::RTCPCompoundPacketBuilder::EndBuild(), ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, ERR_RTP_RTCPPACKETBUILDER_NOTINIT, ERR_RTP_RTCPPACKETBUILDER_PACKETFILLEDTOOSOON, qrtplib::RTCPSDESInfo::GetCNAME(), qrtplib::RTPTime::GetDouble(), qrtplib::RTPTime::GetNTPTime(), qrtplib::RTPSources::GetOwnSourceInfo(), qrtplib::RTPPacketBuilder::GetPacketCount(), qrtplib::RTPPacketBuilder::GetPacketTime(), qrtplib::RTPPacketBuilder::GetPacketTimestamp(), qrtplib::RTPPacketBuilder::GetPayloadOctetCount(), qrtplib::RTPPacketBuilder::GetSSRC(), init, qrtplib::RTCPCompoundPacketBuilder::InitBuild(), qrtplib::RTPSourceData::IsSender(), maxpacketsize, ownsdesinfo, rtppacketbuilder, sources, qrtplib::RTCPCompoundPacketBuilder::StartReceiverReport(), qrtplib::RTCPCompoundPacketBuilder::StartSenderReport(), and timestampunit.

Referenced by qrtplib::RTPSession::BYEDestroy(), and qrtplib::RTPSession::ProcessPolledData().

628 {
629  if (!init)
631 
632  RTCPCompoundPacketBuilder *rtcpcomppack;
633  int status;
634 
635  if (reasonlength > 255)
636  reasonlength = 255;
637 
638  *pack = 0;
639 
640  rtcpcomppack = new RTCPCompoundPacketBuilder();
641 
642  if ((status = rtcpcomppack->InitBuild(maxpacketsize)) < 0)
643  {
644  delete rtcpcomppack;
645  return status;
646  }
647 
649  bool useSR = false;
650 
651  if (useSRifpossible)
652  {
653  RTPSourceData *srcdat;
654 
655  if ((srcdat = sources.GetOwnSourceInfo()) != 0)
656  {
657  if (srcdat->IsSender())
658  useSR = true;
659  }
660  }
661 
662  if (useSR)
663  {
664  RTPTime curtime = RTPTime::CurrentTime();
665  RTPTime rtppacktime = rtppacketbuilder.GetPacketTime();
666  uint32_t rtppacktimestamp = rtppacketbuilder.GetPacketTimestamp();
669  RTPTime diff = curtime;
670  diff -= rtppacktime;
671 
672  uint32_t tsdiff = (uint32_t) ((diff.GetDouble() / timestampunit) + 0.5);
673  uint32_t rtptimestamp = rtppacktimestamp + tsdiff;
674  RTPNTPTime ntptimestamp = curtime.GetNTPTime();
675 
676  if ((status = rtcpcomppack->StartSenderReport(ssrc, ntptimestamp, rtptimestamp, packcount, octetcount)) < 0)
677  {
678  delete rtcpcomppack;
681  return status;
682  }
683  }
684  else
685  {
686  if ((status = rtcpcomppack->StartReceiverReport(ssrc)) < 0)
687  {
688  delete rtcpcomppack;
691  return status;
692  }
693  }
694 
695  uint8_t *owncname;
696  std::size_t owncnamelen;
697 
698  owncname = ownsdesinfo.GetCNAME(&owncnamelen);
699 
700  if ((status = rtcpcomppack->AddSDESSource(ssrc)) < 0)
701  {
702  delete rtcpcomppack;
705  return status;
706  }
707  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::CNAME, owncname, owncnamelen)) < 0)
708  {
709  delete rtcpcomppack;
712  return status;
713  }
714 
715  uint32_t ssrcs[1];
716 
717  ssrcs[0] = ssrc;
718 
719  if ((status = rtcpcomppack->AddBYEPacket(ssrcs, 1, (const uint8_t *) reason, reasonlength)) < 0)
720  {
721  delete rtcpcomppack;
724  return status;
725  }
726 
727  if ((status = rtcpcomppack->EndBuild()) < 0)
728  {
729  delete rtcpcomppack;
730  return status;
731  }
732 
733  *pack = rtcpcomppack;
734  return 0;
735 }
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT
Definition: rtperrors.h:95
RTPSourceData * GetOwnSourceInfo()
Definition: rtpsources.h:243
RTCPSDESInfoInternal ownsdesinfo
uint8_t * GetCNAME(std::size_t *len) const
Definition: rtcpsdesinfo.h:123
unsigned int uint32_t
Definition: rtptypes_win.h:46
unsigned char uint8_t
Definition: rtptypes_win.h:42
uint32_t GetPacketTimestamp() const
#define ERR_RTP_RTCPPACKETBUILDER_PACKETFILLEDTOOSOON
Definition: rtperrors.h:103
static RTPTime CurrentTime()
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
RTPPacketBuilder & rtppacketbuilder
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildNextPacket()

int qrtplib::RTCPPacketBuilder::BuildNextPacket ( RTCPCompoundPacket **  pack)

Builds the next RTCP compound packet which should be sent and stores it in pack.

Definition at line 101 of file rtcppacketbuilder.cpp.

References qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), qrtplib::RTCPCompoundPacketBuilder::AddSDESSource(), ClearAllSDESFlags(), ClearAllSourceFlags(), qrtplib::RTCPSDESPacket::CNAME, qrtplib::RTPTime::CurrentTime(), doemail, doloc, doname, donote, dophone, dotool, qrtplib::RTCPCompoundPacketBuilder::EndBuild(), ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, ERR_RTP_RTCPPACKETBUILDER_NOTINIT, ERR_RTP_RTCPPACKETBUILDER_PACKETFILLEDTOOSOON, FillInReportBlocks(), FillInSDES(), firstpacket, qrtplib::RTCPSDESInfo::GetCNAME(), qrtplib::RTPTime::GetDouble(), qrtplib::RTPTime::GetNTPTime(), qrtplib::RTPSources::GetOwnSourceInfo(), qrtplib::RTPPacketBuilder::GetPacketCount(), qrtplib::RTPPacketBuilder::GetPacketTime(), qrtplib::RTPPacketBuilder::GetPacketTimestamp(), qrtplib::RTPPacketBuilder::GetPayloadOctetCount(), qrtplib::RTPPacketBuilder::GetSSRC(), qrtplib::RTPSources::GetTotalCount(), init, qrtplib::RTCPCompoundPacketBuilder::InitBuild(), interval_email, interval_location, interval_name, interval_note, interval_phone, interval_tool, qrtplib::RTPSourceData::IsSender(), maxpacketsize, ownsdesinfo, prevbuildtime, processingsdes, rtppacketbuilder, sdesbuildcount, sources, qrtplib::RTCPCompoundPacketBuilder::StartReceiverReport(), qrtplib::RTCPCompoundPacketBuilder::StartSenderReport(), timestampunit, and transmissiondelay.

Referenced by qrtplib::RTPSession::ProcessPolledData().

102 {
103  if (!init)
105 
106  RTCPCompoundPacketBuilder *rtcpcomppack;
107  int status;
108  bool sender = false;
109  RTPSourceData *srcdat;
110 
111  *pack = 0;
112 
113  rtcpcomppack = new RTCPCompoundPacketBuilder();
114 
115  if ((status = rtcpcomppack->InitBuild(maxpacketsize)) < 0)
116  {
117  delete rtcpcomppack;
118  return status;
119  }
120 
121  if ((srcdat = sources.GetOwnSourceInfo()) != 0)
122  {
123  if (srcdat->IsSender())
124  sender = true;
125  }
126 
128  RTPTime curtime = RTPTime::CurrentTime();
129 
130  if (sender)
131  {
132  RTPTime rtppacktime = rtppacketbuilder.GetPacketTime();
133  uint32_t rtppacktimestamp = rtppacketbuilder.GetPacketTimestamp();
136  RTPTime diff = curtime;
137  diff -= rtppacktime;
138  diff += transmissiondelay; // the sample being sampled at this very instant will need a larger timestamp
139 
140  uint32_t tsdiff = (uint32_t) ((diff.GetDouble() / timestampunit) + 0.5);
141  uint32_t rtptimestamp = rtppacktimestamp + tsdiff;
142  RTPNTPTime ntptimestamp = curtime.GetNTPTime();
143 
144  if ((status = rtcpcomppack->StartSenderReport(ssrc, ntptimestamp, rtptimestamp, packcount, octetcount)) < 0)
145  {
146  delete rtcpcomppack;
149  return status;
150  }
151  }
152  else
153  {
154  if ((status = rtcpcomppack->StartReceiverReport(ssrc)) < 0)
155  {
156  delete rtcpcomppack;
159  return status;
160  }
161  }
162 
163  uint8_t *owncname;
164  std::size_t owncnamelen;
165 
166  owncname = ownsdesinfo.GetCNAME(&owncnamelen);
167 
168  if ((status = rtcpcomppack->AddSDESSource(ssrc)) < 0)
169  {
170  delete rtcpcomppack;
173  return status;
174  }
175  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::CNAME, owncname, owncnamelen)) < 0)
176  {
177  delete rtcpcomppack;
180  return status;
181  }
182 
183  if (!processingsdes)
184  {
185  int added, skipped;
186  bool full, atendoflist;
187 
188  if ((status = FillInReportBlocks(rtcpcomppack, curtime, sources.GetTotalCount(), &full, &added, &skipped, &atendoflist)) < 0)
189  {
190  delete rtcpcomppack;
191  return status;
192  }
193 
194  if (full && added == 0)
195  {
196  delete rtcpcomppack;
198  }
199 
200  if (!full)
201  {
202  processingsdes = true;
203  sdesbuildcount++;
204 
206 
207  doname = false;
208  doemail = false;
209  doloc = false;
210  dophone = false;
211  dotool = false;
212  donote = false;
213  if (interval_name > 0 && ((sdesbuildcount % interval_name) == 0))
214  doname = true;
215  if (interval_email > 0 && ((sdesbuildcount % interval_email) == 0))
216  doemail = true;
217  if (interval_location > 0 && ((sdesbuildcount % interval_location) == 0))
218  doloc = true;
219  if (interval_phone > 0 && ((sdesbuildcount % interval_phone) == 0))
220  dophone = true;
221  if (interval_tool > 0 && ((sdesbuildcount % interval_tool) == 0))
222  dotool = true;
223  if (interval_note > 0 && ((sdesbuildcount % interval_note) == 0))
224  donote = true;
225 
226  bool processedall;
227  int itemcount;
228 
229  if ((status = FillInSDES(rtcpcomppack, &full, &processedall, &itemcount)) < 0)
230  {
231  delete rtcpcomppack;
232  return status;
233  }
234 
235  if (processedall)
236  {
237  processingsdes = false;
239  if (!full && skipped > 0)
240  {
241  // if the packet isn't full and we skipped some
242  // sources that we already got in a previous packet,
243  // we can add some of them now
244 
245  bool atendoflist;
246 
247  if ((status = FillInReportBlocks(rtcpcomppack, curtime, skipped, &full, &added, &skipped, &atendoflist)) < 0)
248  {
249  delete rtcpcomppack;
250  return status;
251  }
252  }
253  }
254  }
255  }
256  else // previous sdes processing wasn't finished
257  {
258  bool processedall;
259  int itemcount;
260  bool full;
261 
262  if ((status = FillInSDES(rtcpcomppack, &full, &processedall, &itemcount)) < 0)
263  {
264  delete rtcpcomppack;
265  return status;
266  }
267 
268  if (itemcount == 0) // Big problem: packet size is too small to let any progress happen
269  {
270  delete rtcpcomppack;
272  }
273 
274  if (processedall)
275  {
276  processingsdes = false;
278  if (!full)
279  {
280  // if the packet isn't full and we skipped some
281  // we can add some report blocks
282 
283  int added, skipped;
284  bool atendoflist;
285 
286  if ((status = FillInReportBlocks(rtcpcomppack, curtime, sources.GetTotalCount(), &full, &added, &skipped, &atendoflist)) < 0)
287  {
288  delete rtcpcomppack;
289  return status;
290  }
291  if (atendoflist) // filled in all possible sources
293  }
294  }
295  }
296 
297  if ((status = rtcpcomppack->EndBuild()) < 0)
298  {
299  delete rtcpcomppack;
300  return status;
301  }
302 
303  *pack = rtcpcomppack;
304  firstpacket = false;
305  prevbuildtime = curtime;
306  return 0;
307 }
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT
Definition: rtperrors.h:95
RTPSourceData * GetOwnSourceInfo()
Definition: rtpsources.h:243
RTCPSDESInfoInternal ownsdesinfo
int GetTotalCount() const
Definition: rtpsources.h:281
uint8_t * GetCNAME(std::size_t *len) const
Definition: rtcpsdesinfo.h:123
unsigned int uint32_t
Definition: rtptypes_win.h:46
int FillInSDES(RTCPCompoundPacketBuilder *pack, bool *full, bool *processedall, int *added)
unsigned char uint8_t
Definition: rtptypes_win.h:42
uint32_t GetPacketTimestamp() const
#define ERR_RTP_RTCPPACKETBUILDER_PACKETFILLEDTOOSOON
Definition: rtperrors.h:103
RTPNTPTime GetNTPTime() const
static RTPTime CurrentTime()
int FillInReportBlocks(RTCPCompoundPacketBuilder *pack, const RTPTime &curtime, int maxcount, bool *full, int *added, int *skipped, bool *atendoflist)
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
RTPPacketBuilder & rtppacketbuilder
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearAllSDESFlags()

void qrtplib::RTCPPacketBuilder::ClearAllSDESFlags ( )
private

Definition at line 622 of file rtcppacketbuilder.cpp.

References qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ClearFlags(), and ownsdesinfo.

Referenced by BuildNextPacket().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearAllSourceFlags()

void qrtplib::RTCPPacketBuilder::ClearAllSourceFlags ( )
private

Definition at line 309 of file rtcppacketbuilder.cpp.

References qrtplib::RTPSources::GetCurrentSourceInfo(), qrtplib::RTPSources::GotoFirstSource(), qrtplib::RTPSources::GotoNextSource(), qrtplib::RTPSourceData::SetProcessedInRTCP(), and sources.

Referenced by BuildNextPacket(), and Init().

310 {
311  if (sources.GotoFirstSource())
312  {
313  do
314  {
315  RTPSourceData *srcdat = sources.GetCurrentSourceInfo();
316  srcdat->SetProcessedInRTCP(false);
317  } while (sources.GotoNextSource());
318  }
319 }
RTPSourceData * GetCurrentSourceInfo()
Definition: rtpsources.cpp:609
void SetProcessedInRTCP(bool v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Destroy()

void qrtplib::RTCPPacketBuilder::Destroy ( )

Cleans up the builder.

Definition at line 93 of file rtcppacketbuilder.cpp.

References qrtplib::RTCPSDESInfo::Clear(), init, and ownsdesinfo.

Referenced by qrtplib::RTPSession::BYEDestroy(), qrtplib::RTPSession::Destroy(), qrtplib::RTPSession::InternalCreate(), and ~RTCPPacketBuilder().

94 {
95  if (!init)
96  return;
98  init = false;
99 }
RTCPSDESInfoInternal ownsdesinfo
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillInReportBlocks()

int qrtplib::RTCPPacketBuilder::FillInReportBlocks ( RTCPCompoundPacketBuilder pack,
const RTPTime curtime,
int  maxcount,
bool *  full,
int *  added,
int *  skipped,
bool *  atendoflist 
)
private

Definition at line 321 of file rtcppacketbuilder.cpp.

References qrtplib::RTCPCompoundPacketBuilder::AddReportBlock(), ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, firstpacket, qrtplib::RTPSources::GetCurrentSourceInfo(), qrtplib::RTPTime::GetDouble(), qrtplib::RTPNTPTime::GetLSW(), qrtplib::RTPNTPTime::GetMSW(), qrtplib::RTPSourceData::GetSSRC(), qrtplib::RTPSources::GotoFirstSource(), qrtplib::RTPSources::GotoNextSource(), qrtplib::RTPSourceData::INF_GetBaseSequenceNumber(), qrtplib::RTPSourceData::INF_GetExtendedHighestSequenceNumber(), qrtplib::RTPSourceData::INF_GetJitter(), qrtplib::RTPSourceData::INF_GetLastRTPPacketTime(), qrtplib::RTPSourceData::INF_GetNumPacketsReceived(), qrtplib::RTPSourceData::INF_GetNumPacketsReceivedInInterval(), qrtplib::RTPSourceData::INF_GetSavedExtendedSequenceNumber(), qrtplib::RTPSourceData::INF_HasSentData(), qrtplib::RTPSourceData::INF_StartNewInterval(), qrtplib::RTPSourceData::IsCSRC(), qrtplib::RTPSourceData::IsOwnSSRC(), qrtplib::RTPSourceData::IsProcessedInRTCP(), prevbuildtime, qrtplib::RTPSourceData::SetProcessedInRTCP(), sources, qrtplib::RTPSourceData::SR_GetNTPTimestamp(), qrtplib::RTPSourceData::SR_GetReceiveTime(), and qrtplib::RTPSourceData::SR_HasInfo().

Referenced by BuildNextPacket().

322 {
323  RTPSourceData *srcdat;
324  int addedcount = 0;
325  int skippedcount = 0;
326  bool done = false;
327  bool filled = false;
328  bool atend = false;
329  int status;
330 
331  if (sources.GotoFirstSource())
332  {
333  do
334  {
335  bool shouldprocess = false;
336 
337  srcdat = sources.GetCurrentSourceInfo();
338  if (!srcdat->IsOwnSSRC()) // don't send to ourselves
339  {
340  if (!srcdat->IsCSRC()) // p 35: no reports should go to CSRCs
341  {
342  if (srcdat->INF_HasSentData()) // if this isn't true, INF_GetLastRTPPacketTime() won't make any sense
343  {
344  if (firstpacket)
345  shouldprocess = true;
346  else
347  {
348  // p 35: only if rtp packets were received since the last RTP packet, a report block
349  // should be added
350 
351  RTPTime lastrtptime = srcdat->INF_GetLastRTPPacketTime();
352 
353  if (lastrtptime > prevbuildtime)
354  shouldprocess = true;
355  }
356  }
357  }
358  }
359 
360  if (shouldprocess)
361  {
362  if (srcdat->IsProcessedInRTCP()) // already covered this one
363  {
364  skippedcount++;
365  }
366  else
367  {
368  uint32_t rr_ssrc = srcdat->GetSSRC();
369  uint32_t num = srcdat->INF_GetNumPacketsReceivedInInterval();
370  uint32_t prevseq = srcdat->INF_GetSavedExtendedSequenceNumber();
371  uint32_t curseq = srcdat->INF_GetExtendedHighestSequenceNumber();
372  uint32_t expected = curseq - prevseq;
373  uint8_t fraclost;
374 
375  if (expected < num) // got duplicates
376  fraclost = 0;
377  else
378  {
379  double lost = (double) (expected - num);
380  double frac = lost / ((double) expected);
381  fraclost = (uint8_t) (frac * 256.0);
382  }
383 
384  expected = curseq - srcdat->INF_GetBaseSequenceNumber();
385  num = srcdat->INF_GetNumPacketsReceived();
386 
387  uint32_t diff = expected - num;
388  int32_t *packlost = (int32_t *) &diff;
389 
390  uint32_t jitter = srcdat->INF_GetJitter();
391  uint32_t lsr;
392  uint32_t dlsr;
393 
394  if (!srcdat->SR_HasInfo())
395  {
396  lsr = 0;
397  dlsr = 0;
398  }
399  else
400  {
401  RTPNTPTime srtime = srcdat->SR_GetNTPTimestamp();
402  uint32_t m = (srtime.GetMSW() & 0xFFFF);
403  uint32_t l = ((srtime.GetLSW() >> 16) & 0xFFFF);
404  lsr = ((m << 16) | l);
405 
406  RTPTime diff = curtime;
407  diff -= srcdat->SR_GetReceiveTime();
408  double diff2 = diff.GetDouble();
409  diff2 *= 65536.0;
410  dlsr = (uint32_t) diff2;
411  }
412 
413  status = rtcpcomppack->AddReportBlock(rr_ssrc, fraclost, *packlost, curseq, jitter, lsr, dlsr);
414  if (status < 0)
415  {
417  {
418  done = true;
419  filled = true;
420  }
421  else
422  return status;
423  }
424  else
425  {
426  addedcount++;
427  if (addedcount >= maxcount)
428  {
429  done = true;
430  if (!sources.GotoNextSource())
431  atend = true;
432  }
433  srcdat->INF_StartNewInterval();
434  srcdat->SetProcessedInRTCP(true);
435  }
436  }
437  }
438 
439  if (!done)
440  {
441  if (!sources.GotoNextSource())
442  {
443  atend = true;
444  done = true;
445  }
446  }
447 
448  } while (!done);
449  }
450 
451  *added = addedcount;
452  *skipped = skippedcount;
453  *full = filled;
454 
455  if (!atend) // search for available sources
456  {
457  bool shouldprocess = false;
458 
459  do
460  {
461  srcdat = sources.GetCurrentSourceInfo();
462  if (!srcdat->IsOwnSSRC()) // don't send to ourselves
463  {
464  if (!srcdat->IsCSRC()) // p 35: no reports should go to CSRCs
465  {
466  if (srcdat->INF_HasSentData()) // if this isn't true, INF_GetLastRTPPacketTime() won't make any sense
467  {
468  if (firstpacket)
469  shouldprocess = true;
470  else
471  {
472  // p 35: only if rtp packets were received since the last RTP packet, a report block
473  // should be added
474 
475  RTPTime lastrtptime = srcdat->INF_GetLastRTPPacketTime();
476 
477  if (lastrtptime > prevbuildtime)
478  shouldprocess = true;
479  }
480  }
481  }
482  }
483 
484  if (shouldprocess)
485  {
486  if (srcdat->IsProcessedInRTCP())
487  shouldprocess = false;
488  }
489 
490  if (!shouldprocess)
491  {
492  if (!sources.GotoNextSource())
493  atend = true;
494  }
495 
496  } while (!atend && !shouldprocess);
497  }
498 
499  *atendoflist = atend;
500  return 0;
501 }
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT
Definition: rtperrors.h:95
double GetDouble() const
RTPSourceData * GetCurrentSourceInfo()
Definition: rtpsources.cpp:609
unsigned int uint32_t
Definition: rtptypes_win.h:46
unsigned char uint8_t
Definition: rtptypes_win.h:42
int int32_t
Definition: rtptypes_win.h:45
RTPTime INF_GetLastRTPPacketTime() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FillInSDES()

int qrtplib::RTCPPacketBuilder::FillInSDES ( RTCPCompoundPacketBuilder pack,
bool *  full,
bool *  processedall,
int *  added 
)
private

Definition at line 503 of file rtcppacketbuilder.cpp.

References qrtplib::RTCPCompoundPacketBuilder::AddSDESNormalItem(), doemail, doloc, doname, donote, dophone, dotool, qrtplib::RTCPSDESPacket::EMAIL, ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT, qrtplib::RTCPSDESInfo::GetEMail(), qrtplib::RTCPSDESInfo::GetLocation(), qrtplib::RTCPSDESInfo::GetName(), qrtplib::RTCPSDESInfo::GetNote(), qrtplib::RTCPSDESInfo::GetPhone(), qrtplib::RTCPSDESInfo::GetTool(), qrtplib::RTCPSDESPacket::LOC, qrtplib::RTCPSDESPacket::NAME, qrtplib::RTCPSDESPacket::NOTE, ownsdesinfo, qrtplib::RTCPSDESPacket::PHONE, qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedEMail(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedLocation(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedName(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedNote(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedPhone(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::ProcessedTool(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedEMail(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedLocation(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedName(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedNote(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedPhone(), qrtplib::RTCPPacketBuilder::RTCPSDESInfoInternal::SetProcessedTool(), and qrtplib::RTCPSDESPacket::TOOL.

Referenced by BuildNextPacket().

504 {
505  int status;
506  uint8_t *data;
507  std::size_t datalen;
508 
509  *full = false;
510  *processedall = false;
511  *added = 0;
512 
513  // We don't need to add a SSRC for our own data, this is still set
514  // from adding the CNAME
515  if (doname)
516  {
517  if (!ownsdesinfo.ProcessedName())
518  {
519  data = ownsdesinfo.GetName(&datalen);
520  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::NAME, data, datalen)) < 0)
521  {
523  {
524  *full = true;
525  return 0;
526  }
527  }
528  (*added)++;
530  }
531  }
532  if (doemail)
533  {
535  {
536  data = ownsdesinfo.GetEMail(&datalen);
537  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::EMAIL, data, datalen)) < 0)
538  {
540  {
541  *full = true;
542  return 0;
543  }
544  }
545  (*added)++;
547  }
548  }
549  if (doloc)
550  {
552  {
553  data = ownsdesinfo.GetLocation(&datalen);
554  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::LOC, data, datalen)) < 0)
555  {
557  {
558  *full = true;
559  return 0;
560  }
561  }
562  (*added)++;
564  }
565  }
566  if (dophone)
567  {
569  {
570  data = ownsdesinfo.GetPhone(&datalen);
571  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::PHONE, data, datalen)) < 0)
572  {
574  {
575  *full = true;
576  return 0;
577  }
578  }
579  (*added)++;
581  }
582  }
583  if (dotool)
584  {
585  if (!ownsdesinfo.ProcessedTool())
586  {
587  data = ownsdesinfo.GetTool(&datalen);
588  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::TOOL, data, datalen)) < 0)
589  {
591  {
592  *full = true;
593  return 0;
594  }
595  }
596  (*added)++;
598  }
599  }
600  if (donote)
601  {
602  if (!ownsdesinfo.ProcessedNote())
603  {
604  data = ownsdesinfo.GetNote(&datalen);
605  if ((status = rtcpcomppack->AddSDESNormalItem(RTCPSDESPacket::NOTE, data, datalen)) < 0)
606  {
608  {
609  *full = true;
610  return 0;
611  }
612  }
613  (*added)++;
615  }
616  }
617 
618  *processedall = true;
619  return 0;
620 }
#define ERR_RTP_RTCPCOMPPACKBUILDER_NOTENOUGHBYTESLEFT
Definition: rtperrors.h:95
uint8_t * GetTool(std::size_t *len) const
Definition: rtcpsdesinfo.h:153
RTCPSDESInfoInternal ownsdesinfo
uint8_t * GetNote(std::size_t *len) const
Definition: rtcpsdesinfo.h:159
uint8_t * GetLocation(std::size_t *len) const
Definition: rtcpsdesinfo.h:147
unsigned char uint8_t
Definition: rtptypes_win.h:42
uint8_t * GetName(std::size_t *len) const
Definition: rtcpsdesinfo.h:129
uint8_t * GetEMail(std::size_t *len) const
Definition: rtcpsdesinfo.h:135
uint8_t * GetPhone(std::size_t *len) const
Definition: rtcpsdesinfo.h:141
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLocalCNAME()

uint8_t* qrtplib::RTCPPacketBuilder::GetLocalCNAME ( std::size_t *  len) const
inline

Returns the own CNAME item with length len

Definition at line 263 of file rtcppacketbuilder.h.

Referenced by qrtplib::RTPSession::SendRTCPAPPPacket().

264  {
265  if (!init)
266  return 0;
267  return ownsdesinfo.GetCNAME(len);
268  }
RTCPSDESInfoInternal ownsdesinfo
uint8_t * GetCNAME(std::size_t *len) const
Definition: rtcpsdesinfo.h:123
+ Here is the caller graph for this function:

◆ Init()

int qrtplib::RTCPPacketBuilder::Init ( std::size_t  maxpacksize,
double  timestampunit,
const void *  cname,
std::size_t  cnamelen 
)

Initializes the builder. Initializes the builder to use the maximum allowed packet size maxpacksize, timestamp unit timestampunit and the SDES CNAME item specified by cname with length cnamelen. The timestamp unit is defined as a time interval divided by the timestamp interval corresponding to that interval: for 8000 Hz audio this would be 1/8000.

Definition at line 55 of file rtcppacketbuilder.cpp.

References ClearAllSourceFlags(), ERR_RTP_RTCPPACKETBUILDER_ALREADYINIT, ERR_RTP_RTCPPACKETBUILDER_ILLEGALMAXPACKSIZE, ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT, firstpacket, init, interval_email, interval_location, interval_name, interval_note, interval_phone, interval_tool, maxpacketsize, ownsdesinfo, processingsdes, RTP_MINPACKETSIZE, sdesbuildcount, qrtplib::RTCPSDESInfo::SetCNAME(), timestampunit, and transmissiondelay.

Referenced by qrtplib::RTPSession::InternalCreate().

56 {
57  if (init)
59  if (maxpacksize < RTP_MINPACKETSIZE)
61  if (tsunit < 0.0)
63 
64  if (cnamelen > 255)
65  cnamelen = 255;
66 
67  maxpacketsize = maxpacksize;
68  timestampunit = tsunit;
69 
70  int status;
71 
72  if ((status = ownsdesinfo.SetCNAME((const uint8_t *) cname, cnamelen)) < 0)
73  return status;
74 
76 
77  interval_name = -1;
78  interval_email = -1;
79  interval_location = -1;
80  interval_phone = -1;
81  interval_tool = -1;
82  interval_note = -1;
83 
84  sdesbuildcount = 0;
85  transmissiondelay = RTPTime(0, 0);
86 
87  firstpacket = true;
88  processingsdes = false;
89  init = true;
90  return 0;
91 }
RTCPSDESInfoInternal ownsdesinfo
#define ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT
Definition: rtperrors.h:101
#define ERR_RTP_RTCPPACKETBUILDER_ALREADYINIT
Definition: rtperrors.h:99
#define RTP_MINPACKETSIZE
Definition: rtpdefines.h:39
int SetCNAME(const uint8_t *s, std::size_t l)
Definition: rtcpsdesinfo.h:70
unsigned char uint8_t
Definition: rtptypes_win.h:42
#define ERR_RTP_RTCPPACKETBUILDER_ILLEGALMAXPACKSIZE
Definition: rtperrors.h:100
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetEMailInterval()

void qrtplib::RTCPPacketBuilder::SetEMailInterval ( int  count)
inline

Sets the RTCP interval for the SDES e-mail item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES e-mail item will be added after the sources in the source table have been processed count times.

Definition at line 155 of file rtcppacketbuilder.h.

Referenced by qrtplib::RTPSession::SetEMailInterval().

156  {
157  if (!init)
158  return;
159  interval_email = count;
160  }
+ Here is the caller graph for this function:

◆ SetLocalEMail()

int qrtplib::RTCPPacketBuilder::SetLocalEMail ( const void *  s,
std::size_t  len 
)
inline

Sets the SDES e-mail item for the local participant to the value s with length len.

Definition at line 223 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetLocalEMail().

224  {
225  if (!init)
227  return ownsdesinfo.SetEMail((const uint8_t *) s, len);
228  }
RTCPSDESInfoInternal ownsdesinfo
int SetEMail(const uint8_t *s, std::size_t l)
Definition: rtcpsdesinfo.h:82
unsigned char uint8_t
Definition: rtptypes_win.h:42
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetLocalLocation()

int qrtplib::RTCPPacketBuilder::SetLocalLocation ( const void *  s,
std::size_t  len 
)
inline

Sets the SDES location item for the local participant to the value s with length len.

Definition at line 231 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetLocalLocation().

232  {
233  if (!init)
235  return ownsdesinfo.SetLocation((const uint8_t *) s, len);
236  }
RTCPSDESInfoInternal ownsdesinfo
unsigned char uint8_t
Definition: rtptypes_win.h:42
int SetLocation(const uint8_t *s, std::size_t l)
Definition: rtcpsdesinfo.h:94
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetLocalName()

int qrtplib::RTCPPacketBuilder::SetLocalName ( const void *  s,
std::size_t  len 
)
inline

Sets the SDES name item for the local participant to the value s with length len.

Definition at line 215 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetLocalName().

216  {
217  if (!init)
219  return ownsdesinfo.SetName((const uint8_t *) s, len);
220  }
RTCPSDESInfoInternal ownsdesinfo
unsigned char uint8_t
Definition: rtptypes_win.h:42
int SetName(const uint8_t *s, std::size_t l)
Definition: rtcpsdesinfo.h:76
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetLocalNote()

int qrtplib::RTCPPacketBuilder::SetLocalNote ( const void *  s,
std::size_t  len 
)
inline

Sets the SDES note item for the local participant to the value s with length len.

Definition at line 255 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetLocalNote().

256  {
257  if (!init)
259  return ownsdesinfo.SetNote((const uint8_t *) s, len);
260  }
RTCPSDESInfoInternal ownsdesinfo
unsigned char uint8_t
Definition: rtptypes_win.h:42
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
int SetNote(const uint8_t *s, std::size_t l)
Definition: rtcpsdesinfo.h:106
+ Here is the caller graph for this function:

◆ SetLocalPhone()

int qrtplib::RTCPPacketBuilder::SetLocalPhone ( const void *  s,
std::size_t  len 
)
inline

Sets the SDES phone item for the local participant to the value s with length len.

Definition at line 239 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetLocalPhone().

240  {
241  if (!init)
243  return ownsdesinfo.SetPhone((const uint8_t *) s, len);
244  }
RTCPSDESInfoInternal ownsdesinfo
int SetPhone(const uint8_t *s, std::size_t l)
Definition: rtcpsdesinfo.h:88
unsigned char uint8_t
Definition: rtptypes_win.h:42
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetLocalTool()

int qrtplib::RTCPPacketBuilder::SetLocalTool ( const void *  s,
std::size_t  len 
)
inline

Sets the SDES tool item for the local participant to the value s with length len.

Definition at line 247 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetLocalTool().

248  {
249  if (!init)
251  return ownsdesinfo.SetTool((const uint8_t *) s, len);
252  }
RTCPSDESInfoInternal ownsdesinfo
unsigned char uint8_t
Definition: rtptypes_win.h:42
int SetTool(const uint8_t *s, std::size_t l)
Definition: rtcpsdesinfo.h:100
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetLocationInterval()

void qrtplib::RTCPPacketBuilder::SetLocationInterval ( int  count)
inline

Sets the RTCP interval for the SDES location item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES location item will be added after the sources in the source table have been processed count times.

Definition at line 168 of file rtcppacketbuilder.h.

Referenced by qrtplib::RTPSession::SetLocationInterval().

169  {
170  if (!init)
171  return;
172  interval_location = count;
173  }
+ Here is the caller graph for this function:

◆ SetMaximumPacketSize()

int qrtplib::RTCPPacketBuilder::SetMaximumPacketSize ( std::size_t  maxpacksize)
inline

Sets the maximum size allowed size of an RTCP compound packet to maxpacksize.

Definition at line 102 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_ILLEGALMAXPACKSIZE, ERR_RTP_RTCPPACKETBUILDER_NOTINIT, and RTP_MINPACKETSIZE.

Referenced by qrtplib::RTPSession::SetMaximumPacketSize().

103  {
104  if (!init)
106  if (maxpacksize < RTP_MINPACKETSIZE)
108  maxpacketsize = maxpacksize;
109  return 0;
110  }
#define RTP_MINPACKETSIZE
Definition: rtpdefines.h:39
#define ERR_RTP_RTCPPACKETBUILDER_ILLEGALMAXPACKSIZE
Definition: rtperrors.h:100
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetNameInterval()

void qrtplib::RTCPPacketBuilder::SetNameInterval ( int  count)
inline

Sets the RTCP interval for the SDES name item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES name item will be added after the sources in the source table have been processed count times.

Definition at line 142 of file rtcppacketbuilder.h.

Referenced by qrtplib::RTPSession::SetNameInterval().

143  {
144  if (!init)
145  return;
146  interval_name = count;
147  }
+ Here is the caller graph for this function:

◆ SetNoteInterval()

void qrtplib::RTCPPacketBuilder::SetNoteInterval ( int  count)
inline

Sets the RTCP interval for the SDES note item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES note item will be added after the sources in the source table have been processed count times.

Definition at line 207 of file rtcppacketbuilder.h.

Referenced by qrtplib::RTPSession::SetNoteInterval().

208  {
209  if (!init)
210  return;
211  interval_note = count;
212  }
+ Here is the caller graph for this function:

◆ SetPhoneInterval()

void qrtplib::RTCPPacketBuilder::SetPhoneInterval ( int  count)
inline

Sets the RTCP interval for the SDES phone item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES phone item will be added after the sources in the source table have been processed count times.

Definition at line 181 of file rtcppacketbuilder.h.

Referenced by qrtplib::RTPSession::SetPhoneInterval().

182  {
183  if (!init)
184  return;
185  interval_phone = count;
186  }
+ Here is the caller graph for this function:

◆ SetPreTransmissionDelay()

int qrtplib::RTCPPacketBuilder::SetPreTransmissionDelay ( const RTPTime delay)
inline

This function allows you to inform RTCP packet builder about the delay between sampling the first sample of a packet and sending the packet. This function allows you to inform RTCP packet builder about the delay between sampling the first sample of a packet and sending the packet. This delay is taken into account when calculating the relation between RTP timestamp and wallclock time, used for inter-media synchronization.

Definition at line 118 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetPreTransmissionDelay().

119  {
120  if (!init)
122  transmissiondelay = delay;
123  return 0;
124  }
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetTimestampUnit()

int qrtplib::RTCPPacketBuilder::SetTimestampUnit ( double  tsunit)
inline

Sets the timestamp unit to be used to tsunit. Sets the timestamp unit to be used to tsunit. The timestamp unit is defined as a time interval divided by the timestamp interval corresponding to that interval: for 8000 Hz audio this would be 1/8000.

Definition at line 91 of file rtcppacketbuilder.h.

References ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT, and ERR_RTP_RTCPPACKETBUILDER_NOTINIT.

Referenced by qrtplib::RTPSession::SetTimestampUnit().

92  {
93  if (!init)
95  if (tsunit < 0)
97  timestampunit = tsunit;
98  return 0;
99  }
#define ERR_RTP_RTCPPACKETBUILDER_ILLEGALTIMESTAMPUNIT
Definition: rtperrors.h:101
#define ERR_RTP_RTCPPACKETBUILDER_NOTINIT
Definition: rtperrors.h:102
+ Here is the caller graph for this function:

◆ SetToolInterval()

void qrtplib::RTCPPacketBuilder::SetToolInterval ( int  count)
inline

Sets the RTCP interval for the SDES tool item. After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES tool item will be added after the sources in the source table have been processed count times.

Definition at line 194 of file rtcppacketbuilder.h.

Referenced by qrtplib::RTPSession::SetToolInterval().

195  {
196  if (!init)
197  return;
198  interval_tool = count;
199  }
+ Here is the caller graph for this function:

Member Data Documentation

◆ doemail

bool qrtplib::RTCPPacketBuilder::doemail
private

Definition at line 355 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and FillInSDES().

◆ doloc

bool qrtplib::RTCPPacketBuilder::doloc
private

Definition at line 355 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and FillInSDES().

◆ doname

bool qrtplib::RTCPPacketBuilder::doname
private

Definition at line 355 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and FillInSDES().

◆ donote

bool qrtplib::RTCPPacketBuilder::donote
private

Definition at line 355 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and FillInSDES().

◆ dophone

bool qrtplib::RTCPPacketBuilder::dophone
private

Definition at line 355 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and FillInSDES().

◆ dotool

bool qrtplib::RTCPPacketBuilder::dotool
private

Definition at line 355 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and FillInSDES().

◆ firstpacket

bool qrtplib::RTCPPacketBuilder::firstpacket
private

Definition at line 281 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), FillInReportBlocks(), and Init().

◆ init

bool qrtplib::RTCPPacketBuilder::init
private

◆ interval_email

int qrtplib::RTCPPacketBuilder::interval_email
private

Definition at line 353 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ interval_location

int qrtplib::RTCPPacketBuilder::interval_location
private

Definition at line 353 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ interval_name

int qrtplib::RTCPPacketBuilder::interval_name
private

Definition at line 353 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ interval_note

int qrtplib::RTCPPacketBuilder::interval_note
private

Definition at line 354 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ interval_phone

int qrtplib::RTCPPacketBuilder::interval_phone
private

Definition at line 354 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ interval_tool

int qrtplib::RTCPPacketBuilder::interval_tool
private

Definition at line 354 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ maxpacketsize

std::size_t qrtplib::RTCPPacketBuilder::maxpacketsize
private

Definition at line 279 of file rtcppacketbuilder.h.

Referenced by BuildBYEPacket(), BuildNextPacket(), and Init().

◆ ownsdesinfo

RTCPSDESInfoInternal qrtplib::RTCPPacketBuilder::ownsdesinfo
private

◆ prevbuildtime

RTPTime qrtplib::RTCPPacketBuilder::prevbuildtime
private

Definition at line 282 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and FillInReportBlocks().

◆ processingsdes

bool qrtplib::RTCPPacketBuilder::processingsdes
private

Definition at line 356 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ rtppacketbuilder

RTPPacketBuilder& qrtplib::RTCPPacketBuilder::rtppacketbuilder
private

Definition at line 276 of file rtcppacketbuilder.h.

Referenced by BuildBYEPacket(), and BuildNextPacket().

◆ sdesbuildcount

int qrtplib::RTCPPacketBuilder::sdesbuildcount
private

Definition at line 358 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().

◆ sources

RTPSources& qrtplib::RTCPPacketBuilder::sources
private

◆ timestampunit

double qrtplib::RTCPPacketBuilder::timestampunit
private

Definition at line 280 of file rtcppacketbuilder.h.

Referenced by BuildBYEPacket(), BuildNextPacket(), and Init().

◆ transmissiondelay

RTPTime qrtplib::RTCPPacketBuilder::transmissiondelay
private

Definition at line 282 of file rtcppacketbuilder.h.

Referenced by BuildNextPacket(), and Init().


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