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.
rtpsources.cpp
Go to the documentation of this file.
1 /*
2 
3  This file is a part of JRTPLIB
4  Copyright (c) 1999-2017 Jori Liesenborgs
5 
6  Contact: jori.liesenborgs@gmail.com
7 
8  This library was developed at the Expertise Centre for Digital Media
9  (http://www.edm.uhasselt.be), a research center of the Hasselt University
10  (http://www.uhasselt.be). The library is based upon work done for
11  my thesis at the School for Knowledge Technology (Belgium/The Netherlands).
12 
13  Permission is hereby granted, free of charge, to any person obtaining a
14  copy of this software and associated documentation files (the "Software"),
15  to deal in the Software without restriction, including without limitation
16  the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  and/or sell copies of the Software, and to permit persons to whom the
18  Software is furnished to do so, subject to the following conditions:
19 
20  The above copyright notice and this permission notice shall be included
21  in all copies or substantial portions of the Software.
22 
23  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29  IN THE SOFTWARE.
30 
31  */
32 
33 #include "rtpsources.h"
34 #include "rtperrors.h"
35 #include "rtprawpacket.h"
36 #include "rtpinternalsourcedata.h"
37 #include "rtptimeutilities.h"
38 #include "rtpdefines.h"
39 #include "rtcpcompoundpacket.h"
40 #include "rtcppacket.h"
41 #include "rtcpapppacket.h"
42 #include "rtcpbyepacket.h"
43 #include "rtcpsdespacket.h"
44 #include "rtcpsrpacket.h"
45 #include "rtcprrpacket.h"
46 #include "rtptransmitter.h"
47 
48 namespace qrtplib
49 {
50 
52 {
53  totalcount = 0;
54  sendercount = 0;
55  activecount = 0;
56  owndata = 0;
57 }
58 
60 {
61  Clear();
62 }
63 
65 {
67 }
68 
70 {
71  sourcelist.GotoFirstElement();
72  while (sourcelist.HasCurrentElement())
73  {
74  RTPInternalSourceData *sourcedata;
75 
76  sourcedata = sourcelist.GetCurrentElement();
77  delete sourcedata;
78  sourcelist.GotoNextElement();
79  }
80  sourcelist.Clear();
81  owndata = 0;
82  totalcount = 0;
83  sendercount = 0;
84  activecount = 0;
85 }
86 
88 {
89  if (owndata != 0)
91  if (GotEntry(ssrc))
93 
94  int status;
95  bool created;
96 
97  status = ObtainSourceDataInstance(ssrc, &owndata, &created);
98  if (status < 0)
99  {
100  owndata = 0; // just to make sure
101  return status;
102  }
103  owndata->SetOwnSSRC();
106 
107  // we've created a validated ssrc, so we should increase activecount
108  activecount++;
109 
111  return 0;
112 }
113 
115 {
116  if (owndata == 0)
118 
119  uint32_t ssrc = owndata->GetSSRC();
120 
121  sourcelist.GotoElement(ssrc);
122  sourcelist.DeleteCurrentElement();
123 
124  totalcount--;
125  if (owndata->IsSender())
126  sendercount--;
127  if (owndata->IsActive())
128  activecount--;
129 
131 
132  delete owndata;
133  owndata = 0;
134  return 0;
135 }
136 
138 {
139  if (owndata == 0)
140  return;
141 
142  bool prevsender = owndata->IsSender();
143 
145  if (!prevsender && owndata->IsSender())
146  sendercount++;
147 }
148 
149 int RTPSources::ProcessRawPacket(RTPRawPacket *rawpack, RTPTransmitter *rtptrans, bool acceptownpackets)
150 {
151  RTPTransmitter *transmitters[1];
152  int num;
153 
154  transmitters[0] = rtptrans;
155  if (rtptrans == 0)
156  num = 0;
157  else
158  num = 1;
159  return ProcessRawPacket(rawpack, transmitters, num, acceptownpackets);
160 }
161 
162 int RTPSources::ProcessRawPacket(RTPRawPacket *rawpack, RTPTransmitter *rtptrans[], int numtrans, bool acceptownpackets)
163 {
164  int status;
165 
166  if (rawpack->IsRTP()) // RTP packet
167  {
168  RTPPacket *rtppack;
169 
170  // First, we'll see if the packet can be parsed
171  rtppack = new RTPPacket(*rawpack);
172 
173  if ((status = rtppack->GetCreationError()) < 0)
174  {
175  if (status == ERR_RTP_PACKET_INVALIDPACKET)
176  {
177  delete rtppack;
178  rtppack = 0;
179  }
180  else
181  {
182  delete rtppack;
183  return status;
184  }
185  }
186 
187  // Check if the packet was valid
188  if (rtppack != 0)
189  {
190  bool stored = false;
191  bool ownpacket = false;
192  int i;
193  const RTPAddress& senderaddress = rawpack->GetSenderAddress();
194 
195  for (i = 0; !ownpacket && i < numtrans; i++)
196  {
197  if (rtptrans[i]->ComesFromThisTransmitter(senderaddress))
198  ownpacket = true;
199  }
200 
201  // Check if the packet is our own.
202  if (ownpacket)
203  {
204  // Now it depends on the user's preference
205  // what to do with this packet:
206  if (acceptownpackets)
207  {
208  // sender addres for own packets has to be NULL!
209  if ((status = ProcessRTPPacket(rtppack, rawpack->GetReceiveTime(), 0, &stored)) < 0)
210  {
211  if (!stored)
212  delete rtppack;
213  return status;
214  }
215  }
216  }
217  else
218  {
219  if ((status = ProcessRTPPacket(rtppack, rawpack->GetReceiveTime(), &senderaddress, &stored)) < 0)
220  {
221  if (!stored)
222  delete rtppack;
223  return status;
224  }
225  }
226  if (!stored)
227  delete rtppack;
228  }
229  }
230  else // RTCP packet
231  {
232  RTCPCompoundPacket rtcpcomppack(*rawpack);
233  bool valid = false;
234 
235  if ((status = rtcpcomppack.GetCreationError()) < 0)
236  {
238  return status;
239  }
240  else
241  valid = true;
242 
243  if (valid)
244  {
245  bool ownpacket = false;
246  int i;
247  const RTPAddress& senderaddress = rawpack->GetSenderAddress();
248 
249  for (i = 0; !ownpacket && i < numtrans; i++)
250  {
251  if (rtptrans[i]->ComesFromThisTransmitter(senderaddress))
252  ownpacket = true;
253  }
254 
255  // First check if it's a packet of this session.
256  if (ownpacket)
257  {
258  if (acceptownpackets)
259  {
260  // sender address for own packets has to be NULL
261  status = ProcessRTCPCompoundPacket(&rtcpcomppack, rawpack->GetReceiveTime(), 0);
262  if (status < 0)
263  return status;
264  }
265  }
266  else // not our own packet
267  {
268  status = ProcessRTCPCompoundPacket(&rtcpcomppack, rawpack->GetReceiveTime(), &rawpack->GetSenderAddress());
269  if (status < 0)
270  return status;
271  }
272  }
273  }
274 
275  return 0;
276 }
277 
278 int RTPSources::ProcessRTPPacket(RTPPacket *rtppack, const RTPTime &receivetime, const RTPAddress *senderaddress, bool *stored)
279 {
280  uint32_t ssrc;
281  RTPInternalSourceData *srcdat;
282  int status;
283  bool created;
284 
285  OnRTPPacket(rtppack, receivetime, senderaddress);
286 
287  *stored = false;
288 
289  ssrc = rtppack->GetSSRC();
290  if ((status = ObtainSourceDataInstance(ssrc, &srcdat, &created)) < 0)
291  return status;
292 
293  if (created)
294  {
295  if ((status = srcdat->SetRTPDataAddress(senderaddress)) < 0)
296  return status;
297  }
298  else // got a previously existing source
299  {
300  if (CheckCollision(srcdat, senderaddress, true))
301  return 0; // ignore packet on collision
302  }
303 
304  bool prevsender = srcdat->IsSender();
305  bool prevactive = srcdat->IsActive();
306 
307  uint32_t CSRCs[RTP_MAXCSRCS];
308  int numCSRCs = rtppack->GetCSRCCount();
309  if (numCSRCs > RTP_MAXCSRCS) // shouldn't happen, but better to check than go out of bounds
310  numCSRCs = RTP_MAXCSRCS;
311 
312  for (int i = 0; i < numCSRCs; i++)
313  CSRCs[i] = rtppack->GetCSRC(i);
314 
315  // The packet comes from a valid source, we can process it further now
316  // The following function should delete rtppack itself if something goes
317  // wrong
318  if ((status = srcdat->ProcessRTPPacket(rtppack, receivetime, stored, this)) < 0)
319  return status;
320 
321  // NOTE: we cannot use 'rtppack' anymore since it may have been deleted in
322  // OnValidatedRTPPacket
323 
324  if (!prevsender && srcdat->IsSender())
325  sendercount++;
326  if (!prevactive && srcdat->IsActive())
327  activecount++;
328 
329  if (created)
330  OnNewSource(srcdat);
331 
332  if (srcdat->IsValidated()) // process the CSRCs
333  {
334  RTPInternalSourceData *csrcdat;
335  bool createdcsrc;
336 
337  int num = numCSRCs;
338  int i;
339 
340  for (i = 0; i < num; i++)
341  {
342  if ((status = ObtainSourceDataInstance(CSRCs[i], &csrcdat, &createdcsrc)) < 0)
343  return status;
344  if (createdcsrc)
345  {
346  csrcdat->SetCSRC();
347  if (csrcdat->IsActive())
348  activecount++;
349  OnNewSource(csrcdat);
350  }
351  else // already found an entry, possibly because of RTCP data
352  {
353  if (!CheckCollision(csrcdat, senderaddress, true))
354  csrcdat->SetCSRC();
355  }
356  }
357  }
358 
359  return 0;
360 }
361 
362 int RTPSources::ProcessRTCPCompoundPacket(RTCPCompoundPacket *rtcpcomppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
363 {
364  RTCPPacket *rtcppack;
365  int status;
366  bool gotownssrc = ((owndata == 0) ? false : true);
367  uint32_t ownssrc = ((owndata != 0) ? owndata->GetSSRC() : 0);
368 
369  OnRTCPCompoundPacket(rtcpcomppack, receivetime, senderaddress);
370 
371  rtcpcomppack->GotoFirstPacket();
372  while ((rtcppack = rtcpcomppack->GetNextPacket()) != 0)
373  {
374  if (rtcppack->IsKnownFormat())
375  {
376  switch (rtcppack->GetPacketType())
377  {
378  case RTCPPacket::SR:
379  {
380  RTCPSRPacket *p = (RTCPSRPacket *) rtcppack;
381  uint32_t senderssrc = p->GetSenderSSRC();
382 
383  status = ProcessRTCPSenderInfo(senderssrc, p->GetNTPTimestamp(), p->GetRTPTimestamp(), p->GetSenderPacketCount(), p->GetSenderOctetCount(), receivetime,
384  senderaddress);
385  if (status < 0)
386  return status;
387 
388  bool gotinfo = false;
389  if (gotownssrc)
390  {
391  int i;
392  int num = p->GetReceptionReportCount();
393  for (i = 0; i < num; i++)
394  {
395  if (p->GetSSRC(i) == ownssrc) // data is meant for us
396  {
397  gotinfo = true;
399  p->GetLSR(i), p->GetDLSR(i), receivetime, senderaddress);
400  if (status < 0)
401  return status;
402  }
403  }
404  }
405  if (!gotinfo)
406  {
407  status = UpdateReceiveTime(senderssrc, receivetime, senderaddress);
408  if (status < 0)
409  return status;
410  }
411  }
412  break;
413  case RTCPPacket::RR:
414  {
415  RTCPRRPacket *p = (RTCPRRPacket *) rtcppack;
416  uint32_t senderssrc = p->GetSenderSSRC();
417 
418  bool gotinfo = false;
419 
420  if (gotownssrc)
421  {
422  int i;
423  int num = p->GetReceptionReportCount();
424  for (i = 0; i < num; i++)
425  {
426  if (p->GetSSRC(i) == ownssrc)
427  {
428  gotinfo = true;
430  p->GetLSR(i), p->GetDLSR(i), receivetime, senderaddress);
431  if (status < 0)
432  return status;
433  }
434  }
435  }
436  if (!gotinfo)
437  {
438  status = UpdateReceiveTime(senderssrc, receivetime, senderaddress);
439  if (status < 0)
440  return status;
441  }
442  }
443  break;
444  case RTCPPacket::SDES:
445  {
446  RTCPSDESPacket *p = (RTCPSDESPacket *) rtcppack;
447 
448  if (p->GotoFirstChunk())
449  {
450  do
451  {
452  uint32_t sdesssrc = p->GetChunkSSRC();
453  bool updated = false;
454  if (p->GotoFirstItem())
455  {
456  do
457  {
459 
460  if ((t = p->GetItemType()) != RTCPSDESPacket::PRIV)
461  {
462  updated = true;
463  status = ProcessSDESNormalItem(sdesssrc, t, p->GetItemLength(), p->GetItemData(), receivetime, senderaddress);
464  if (status < 0)
465  return status;
466  }
467 #ifdef RTP_SUPPORT_SDESPRIV
468  else
469  {
470  updated = true;
472  receivetime, senderaddress);
473  if (status < 0)
474  return status;
475  }
476 #endif // RTP_SUPPORT_SDESPRIV
477  } while (p->GotoNextItem());
478  }
479  if (!updated)
480  {
481  status = UpdateReceiveTime(sdesssrc, receivetime, senderaddress);
482  if (status < 0)
483  return status;
484  }
485  } while (p->GotoNextChunk());
486  }
487  }
488  break;
489  case RTCPPacket::BYE:
490  {
491  RTCPBYEPacket *p = (RTCPBYEPacket *) rtcppack;
492  int i;
493  int num = p->GetSSRCCount();
494 
495  for (i = 0; i < num; i++)
496  {
497  uint32_t byessrc = p->GetSSRC(i);
498  status = ProcessBYE(byessrc, p->GetReasonLength(), p->GetReasonData(), receivetime, senderaddress);
499  if (status < 0)
500  return status;
501  }
502  }
503  break;
504  case RTCPPacket::APP:
505  {
506  RTCPAPPPacket *p = (RTCPAPPPacket *) rtcppack;
507 
508  OnAPPPacket(p, receivetime, senderaddress);
509  }
510  break;
511  case RTCPPacket::Unknown:
512  default:
513  {
514  OnUnknownPacketType(rtcppack, receivetime, senderaddress);
515  }
516  break;
517  }
518  }
519  else
520  {
521  OnUnknownPacketFormat(rtcppack, receivetime, senderaddress);
522  }
523  }
524 
525  return 0;
526 }
527 
529 {
530  sourcelist.GotoFirstElement();
531  if (sourcelist.HasCurrentElement())
532  return true;
533  return false;
534 }
535 
537 {
538  sourcelist.GotoNextElement();
539  if (sourcelist.HasCurrentElement())
540  return true;
541  return false;
542 }
543 
545 {
546  sourcelist.GotoPreviousElement();
547  if (sourcelist.HasCurrentElement())
548  return true;
549  return false;
550 }
551 
553 {
554  bool found = false;
555 
556  sourcelist.GotoFirstElement();
557  while (!found && sourcelist.HasCurrentElement())
558  {
559  RTPInternalSourceData *srcdat;
560 
561  srcdat = sourcelist.GetCurrentElement();
562  if (srcdat->HasData())
563  found = true;
564  else
565  sourcelist.GotoNextElement();
566  }
567 
568  return found;
569 }
570 
572 {
573  bool found = false;
574 
575  sourcelist.GotoNextElement();
576  while (!found && sourcelist.HasCurrentElement())
577  {
578  RTPInternalSourceData *srcdat;
579 
580  srcdat = sourcelist.GetCurrentElement();
581  if (srcdat->HasData())
582  found = true;
583  else
584  sourcelist.GotoNextElement();
585  }
586 
587  return found;
588 }
589 
591 {
592  bool found = false;
593 
594  sourcelist.GotoPreviousElement();
595  while (!found && sourcelist.HasCurrentElement())
596  {
597  RTPInternalSourceData *srcdat;
598 
599  srcdat = sourcelist.GetCurrentElement();
600  if (srcdat->HasData())
601  found = true;
602  else
603  sourcelist.GotoPreviousElement();
604  }
605 
606  return found;
607 }
608 
610 {
611  if (!sourcelist.HasCurrentElement())
612  return 0;
613  return sourcelist.GetCurrentElement();
614 }
615 
617 {
618  if (sourcelist.GotoElement(ssrc) < 0)
619  return 0;
620  if (!sourcelist.HasCurrentElement())
621  return 0;
622  return sourcelist.GetCurrentElement();
623 }
624 
626 {
627  return sourcelist.HasElement(ssrc);
628 }
629 
631 {
632  if (!sourcelist.HasCurrentElement())
633  return 0;
634 
635  RTPInternalSourceData *srcdat = sourcelist.GetCurrentElement();
636  RTPPacket *pack = srcdat->GetNextPacket();
637  return pack;
638 }
639 
640 int RTPSources::ProcessRTCPSenderInfo(uint32_t ssrc, const RTPNTPTime &ntptime, uint32_t rtptime, uint32_t packetcount, uint32_t octetcount, const RTPTime &receivetime,
641  const RTPAddress *senderaddress)
642 {
643  RTPInternalSourceData *srcdat;
644  bool created;
645  int status;
646 
647  status = GetRTCPSourceData(ssrc, senderaddress, &srcdat, &created);
648  if (status < 0)
649  return status;
650  if (srcdat == 0)
651  return 0;
652 
653  srcdat->ProcessSenderInfo(ntptime, rtptime, packetcount, octetcount, receivetime);
654 
655  // Call the callback
656  if (created)
657  OnNewSource(srcdat);
658 
659  OnRTCPSenderReport(srcdat);
660 
661  return 0;
662 }
663 
664 int RTPSources::ProcessRTCPReportBlock(uint32_t ssrc, uint8_t fractionlost, int32_t lostpackets, uint32_t exthighseqnr, uint32_t jitter, uint32_t lsr, uint32_t dlsr,
665  const RTPTime &receivetime, const RTPAddress *senderaddress)
666 {
667  RTPInternalSourceData *srcdat;
668  bool created;
669  int status;
670 
671  status = GetRTCPSourceData(ssrc, senderaddress, &srcdat, &created);
672  if (status < 0)
673  return status;
674  if (srcdat == 0)
675  return 0;
676 
677  srcdat->ProcessReportBlock(fractionlost, lostpackets, exthighseqnr, jitter, lsr, dlsr, receivetime);
678 
679  // Call the callback
680  if (created)
681  OnNewSource(srcdat);
682 
683  OnRTCPReceiverReport(srcdat);
684 
685  return 0;
686 }
687 
688 int RTPSources::ProcessSDESNormalItem(uint32_t ssrc, RTCPSDESPacket::ItemType t, std::size_t itemlength, const void *itemdata, const RTPTime &receivetime,
689  const RTPAddress *senderaddress)
690 {
691  RTPInternalSourceData *srcdat;
692  bool created, cnamecollis;
693  int status;
694  uint8_t sdesid;
695  bool prevactive;
696 
697  switch (t)
698  {
700  sdesid = RTCP_SDES_ID_CNAME;
701  break;
703  sdesid = RTCP_SDES_ID_NAME;
704  break;
706  sdesid = RTCP_SDES_ID_EMAIL;
707  break;
709  sdesid = RTCP_SDES_ID_PHONE;
710  break;
711  case RTCPSDESPacket::LOC:
712  sdesid = RTCP_SDES_ID_LOCATION;
713  break;
715  sdesid = RTCP_SDES_ID_TOOL;
716  break;
718  sdesid = RTCP_SDES_ID_NOTE;
719  break;
720  default:
722  }
723 
724  status = GetRTCPSourceData(ssrc, senderaddress, &srcdat, &created);
725  if (status < 0)
726  return status;
727  if (srcdat == 0)
728  return 0;
729 
730  prevactive = srcdat->IsActive();
731  status = srcdat->ProcessSDESItem(sdesid, (const uint8_t *) itemdata, itemlength, receivetime, &cnamecollis);
732  if (!prevactive && srcdat->IsActive())
733  activecount++;
734 
735  // Call the callback
736  if (created)
737  OnNewSource(srcdat);
738  if (cnamecollis)
739  OnCNAMECollision(srcdat, senderaddress, (const uint8_t *) itemdata, itemlength);
740 
741  if (status >= 0)
742  OnRTCPSDESItem(srcdat, t, itemdata, itemlength);
743 
744  return status;
745 }
746 
747 #ifdef RTP_SUPPORT_SDESPRIV
748 int RTPSources::ProcessSDESPrivateItem(uint32_t ssrc, std::size_t prefixlen, const void *prefixdata, std::size_t valuelen, const void *valuedata, const RTPTime &receivetime,
749  const RTPAddress *senderaddress)
750 {
751  RTPInternalSourceData *srcdat;
752  bool created;
753  int status;
754 
755  status = GetRTCPSourceData(ssrc, senderaddress, &srcdat, &created);
756  if (status < 0)
757  return status;
758  if (srcdat == 0)
759  return 0;
760 
761  status = srcdat->ProcessPrivateSDESItem((const uint8_t *) prefixdata, prefixlen, (const uint8_t *) valuedata, valuelen, receivetime);
762  // Call the callback
763  if (created)
764  OnNewSource(srcdat);
765 
766  if (status >= 0)
767  OnRTCPSDESPrivateItem(srcdat, prefixdata, prefixlen, valuedata, valuelen);
768 
769  return status;
770 }
771 #endif //RTP_SUPPORT_SDESPRIV
772 
773 int RTPSources::ProcessBYE(uint32_t ssrc, std::size_t reasonlength, const void *reasondata, const RTPTime &receivetime, const RTPAddress *senderaddress)
774 {
775  RTPInternalSourceData *srcdat;
776  bool created;
777  int status;
778  bool prevactive;
779 
780  status = GetRTCPSourceData(ssrc, senderaddress, &srcdat, &created);
781  if (status < 0)
782  return status;
783  if (srcdat == 0)
784  return 0;
785 
786  // we'll ignore BYE packets for our own ssrc
787  if (srcdat == owndata)
788  return 0;
789 
790  prevactive = srcdat->IsActive();
791  srcdat->ProcessBYEPacket((const uint8_t *) reasondata, reasonlength, receivetime);
792  if (prevactive && !srcdat->IsActive())
793  activecount--;
794 
795  // Call the callback
796  if (created)
797  OnNewSource(srcdat);
798  OnBYEPacket(srcdat);
799  return 0;
800 }
801 
803 {
804  RTPInternalSourceData *srcdat2;
805  int status;
806 
807  if (sourcelist.GotoElement(ssrc) < 0) // No entry for this source
808  {
809  srcdat2 = new RTPInternalSourceData(ssrc);
810  if ((status = sourcelist.AddElement(ssrc, srcdat2)) < 0)
811  {
812  delete srcdat2;
813  return status;
814  }
815  *srcdat = srcdat2;
816  *created = true;
817  totalcount++;
818  }
819  else
820  {
821  *srcdat = sourcelist.GetCurrentElement();
822  *created = false;
823  }
824  return 0;
825 }
826 
827 int RTPSources::GetRTCPSourceData(uint32_t ssrc, const RTPAddress *senderaddress, RTPInternalSourceData **srcdat2, bool *newsource)
828 {
829  int status;
830  bool created;
831  RTPInternalSourceData *srcdat;
832 
833  *srcdat2 = 0;
834 
835  if ((status = ObtainSourceDataInstance(ssrc, &srcdat, &created)) < 0)
836  return status;
837 
838  if (created)
839  {
840  if ((status = srcdat->SetRTCPDataAddress(senderaddress)) < 0)
841  return status;
842  }
843  else // got a previously existing source
844  {
845  if (CheckCollision(srcdat, senderaddress, false))
846  return 0; // ignore packet on collision
847  }
848 
849  *srcdat2 = srcdat;
850  *newsource = created;
851 
852  return 0;
853 }
854 
855 int RTPSources::UpdateReceiveTime(uint32_t ssrc, const RTPTime &receivetime, const RTPAddress *senderaddress)
856 {
857  RTPInternalSourceData *srcdat;
858  bool created;
859  int status;
860 
861  status = GetRTCPSourceData(ssrc, senderaddress, &srcdat, &created);
862  if (status < 0)
863  return status;
864  if (srcdat == 0)
865  return 0;
866 
867  // We got valid SSRC info
868  srcdat->UpdateMessageTime(receivetime);
869 
870  // Call the callback
871  if (created)
872  OnNewSource(srcdat);
873 
874  return 0;
875 }
876 
877 void RTPSources::Timeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
878 {
879  int newtotalcount = 0;
880  int newsendercount = 0;
881  int newactivecount = 0;
882  RTPTime checktime = curtime;
883  checktime -= timeoutdelay;
884 
885  sourcelist.GotoFirstElement();
886  while (sourcelist.HasCurrentElement())
887  {
888  RTPInternalSourceData *srcdat = sourcelist.GetCurrentElement();
889  RTPTime lastmsgtime = srcdat->INF_GetLastMessageTime();
890 
891  // we don't want to time out ourselves
892  if ((srcdat != owndata) && (lastmsgtime < checktime)) // timeout
893  {
894 
895  totalcount--;
896  if (srcdat->IsSender())
897  sendercount--;
898  if (srcdat->IsActive())
899  activecount--;
900 
901  sourcelist.DeleteCurrentElement();
902 
903  OnTimeout(srcdat);
904  OnRemoveSource(srcdat);
905  delete srcdat;
906  }
907  else
908  {
909  newtotalcount++;
910  if (srcdat->IsSender())
911  newsendercount++;
912  if (srcdat->IsActive())
913  newactivecount++;
914  sourcelist.GotoNextElement();
915  }
916  }
917 
918  totalcount = newtotalcount; // just to play it safe
919  sendercount = newsendercount;
920  activecount = newactivecount;
921 }
922 
923 void RTPSources::SenderTimeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
924 {
925  int newtotalcount = 0;
926  int newsendercount = 0;
927  int newactivecount = 0;
928  RTPTime checktime = curtime;
929  checktime -= timeoutdelay;
930 
931  sourcelist.GotoFirstElement();
932  while (sourcelist.HasCurrentElement())
933  {
934  RTPInternalSourceData *srcdat = sourcelist.GetCurrentElement();
935 
936  newtotalcount++;
937  if (srcdat->IsActive())
938  newactivecount++;
939 
940  if (srcdat->IsSender())
941  {
942  RTPTime lastrtppacktime = srcdat->INF_GetLastRTPPacketTime();
943 
944  if (lastrtppacktime < checktime) // timeout
945  {
946  srcdat->ClearSenderFlag();
947  sendercount--;
948  }
949  else
950  newsendercount++;
951  }
952  sourcelist.GotoNextElement();
953  }
954 
955  totalcount = newtotalcount; // just to play it safe
956  sendercount = newsendercount;
957  activecount = newactivecount;
958 }
959 
960 void RTPSources::BYETimeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
961 {
962  int newtotalcount = 0;
963  int newsendercount = 0;
964  int newactivecount = 0;
965  RTPTime checktime = curtime;
966  checktime -= timeoutdelay;
967 
968  sourcelist.GotoFirstElement();
969  while (sourcelist.HasCurrentElement())
970  {
971  RTPInternalSourceData *srcdat = sourcelist.GetCurrentElement();
972 
973  if (srcdat->ReceivedBYE())
974  {
975  RTPTime byetime = srcdat->GetBYETime();
976 
977  if ((srcdat != owndata) && (checktime > byetime))
978  {
979  totalcount--;
980  if (srcdat->IsSender())
981  sendercount--;
982  if (srcdat->IsActive())
983  activecount--;
984  sourcelist.DeleteCurrentElement();
985  OnBYETimeout(srcdat);
986  OnRemoveSource(srcdat);
987  delete srcdat;
988  }
989  else
990  {
991  newtotalcount++;
992  if (srcdat->IsSender())
993  newsendercount++;
994  if (srcdat->IsActive())
995  newactivecount++;
996  sourcelist.GotoNextElement();
997  }
998  }
999  else
1000  {
1001  newtotalcount++;
1002  if (srcdat->IsSender())
1003  newsendercount++;
1004  if (srcdat->IsActive())
1005  newactivecount++;
1006  sourcelist.GotoNextElement();
1007  }
1008  }
1009 
1010  totalcount = newtotalcount; // just to play it safe
1011  sendercount = newsendercount;
1012  activecount = newactivecount;
1013 }
1014 
1015 void RTPSources::NoteTimeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
1016 {
1017  int newtotalcount = 0;
1018  int newsendercount = 0;
1019  int newactivecount = 0;
1020  RTPTime checktime = curtime;
1021  checktime -= timeoutdelay;
1022 
1023  sourcelist.GotoFirstElement();
1024  while (sourcelist.HasCurrentElement())
1025  {
1026  RTPInternalSourceData *srcdat = sourcelist.GetCurrentElement();
1027  std::size_t notelen;
1028 
1029  srcdat->SDES_GetNote(&notelen);
1030  if (notelen != 0) // Note has been set
1031  {
1032  RTPTime notetime = srcdat->INF_GetLastSDESNoteTime();
1033 
1034  if (checktime > notetime)
1035  {
1036  srcdat->ClearNote();
1037  OnNoteTimeout(srcdat);
1038  }
1039  }
1040 
1041  newtotalcount++;
1042  if (srcdat->IsSender())
1043  newsendercount++;
1044  if (srcdat->IsActive())
1045  newactivecount++;
1046  sourcelist.GotoNextElement();
1047  }
1048 
1049  totalcount = newtotalcount; // just to play it safe
1050  sendercount = newsendercount;
1051  activecount = newactivecount;
1052 
1053 }
1054 
1055 void RTPSources::MultipleTimeouts(const RTPTime &curtime, const RTPTime &sendertimeout, const RTPTime &byetimeout, const RTPTime &generaltimeout, const RTPTime &notetimeout)
1056 {
1057  int newtotalcount = 0;
1058  int newsendercount = 0;
1059  int newactivecount = 0;
1060  RTPTime senderchecktime = curtime;
1061  RTPTime byechecktime = curtime;
1062  RTPTime generaltchecktime = curtime;
1063  RTPTime notechecktime = curtime;
1064  senderchecktime -= sendertimeout;
1065  byechecktime -= byetimeout;
1066  generaltchecktime -= generaltimeout;
1067  notechecktime -= notetimeout;
1068 
1069  sourcelist.GotoFirstElement();
1070  while (sourcelist.HasCurrentElement())
1071  {
1072  RTPInternalSourceData *srcdat = sourcelist.GetCurrentElement();
1073  bool deleted, issender, isactive;
1074  bool byetimeout, normaltimeout, notetimeout;
1075 
1076  std::size_t notelen;
1077 
1078  issender = srcdat->IsSender();
1079  isactive = srcdat->IsActive();
1080  deleted = false;
1081  byetimeout = false;
1082  normaltimeout = false;
1083  notetimeout = false;
1084 
1085  srcdat->SDES_GetNote(&notelen);
1086  if (notelen != 0) // Note has been set
1087  {
1088  RTPTime notetime = srcdat->INF_GetLastSDESNoteTime();
1089 
1090  if (notechecktime > notetime)
1091  {
1092  notetimeout = true;
1093  srcdat->ClearNote();
1094  }
1095  }
1096 
1097  if (srcdat->ReceivedBYE())
1098  {
1099  RTPTime byetime = srcdat->GetBYETime();
1100 
1101  if ((srcdat != owndata) && (byechecktime > byetime))
1102  {
1103  sourcelist.DeleteCurrentElement();
1104  deleted = true;
1105  byetimeout = true;
1106  }
1107  }
1108 
1109  if (!deleted)
1110  {
1111  RTPTime lastmsgtime = srcdat->INF_GetLastMessageTime();
1112 
1113  if ((srcdat != owndata) && (lastmsgtime < generaltchecktime))
1114  {
1115  sourcelist.DeleteCurrentElement();
1116  deleted = true;
1117  normaltimeout = true;
1118  }
1119  }
1120 
1121  if (!deleted)
1122  {
1123  newtotalcount++;
1124 
1125  if (issender)
1126  {
1127  RTPTime lastrtppacktime = srcdat->INF_GetLastRTPPacketTime();
1128 
1129  if (lastrtppacktime < senderchecktime)
1130  {
1131  srcdat->ClearSenderFlag();
1132  sendercount--;
1133  }
1134  else
1135  newsendercount++;
1136  }
1137 
1138  if (isactive)
1139  newactivecount++;
1140 
1141  if (notetimeout)
1142  OnNoteTimeout(srcdat);
1143 
1144  sourcelist.GotoNextElement();
1145  }
1146  else // deleted entry
1147  {
1148  if (issender)
1149  sendercount--;
1150  if (isactive)
1151  activecount--;
1152  totalcount--;
1153 
1154  if (byetimeout)
1155  OnBYETimeout(srcdat);
1156  if (normaltimeout)
1157  OnTimeout(srcdat);
1158  OnRemoveSource(srcdat);
1159  delete srcdat;
1160  }
1161  }
1162 
1163  totalcount = newtotalcount; // just to play it safe
1164  sendercount = newsendercount;
1165  activecount = newactivecount;
1166 }
1167 
1168 bool RTPSources::CheckCollision(RTPInternalSourceData *srcdat, const RTPAddress *senderaddress, bool isrtp)
1169 {
1170  bool isset, otherisset;
1171  const RTPAddress *addr, *otheraddr;
1172 
1173  if (isrtp)
1174  {
1175  isset = srcdat->IsRTPAddressSet();
1176  addr = srcdat->GetRTPDataAddress();
1177  otherisset = srcdat->IsRTCPAddressSet();
1178  otheraddr = srcdat->GetRTCPDataAddress();
1179  }
1180  else
1181  {
1182  isset = srcdat->IsRTCPAddressSet();
1183  addr = srcdat->GetRTCPDataAddress();
1184  otherisset = srcdat->IsRTPAddressSet();
1185  otheraddr = srcdat->GetRTPDataAddress();
1186  }
1187 
1188  if (!isset)
1189  {
1190  if (otherisset) // got other address, can check if it comes from same host
1191  {
1192  if (otheraddr == 0) // other came from our own session
1193  {
1194  if (senderaddress != 0)
1195  {
1196  OnSSRCCollision(srcdat, senderaddress, isrtp);
1197  return true;
1198  }
1199 
1200  // Ok, store it
1201 
1202  if (isrtp)
1203  srcdat->SetRTPDataAddress(senderaddress);
1204  else
1205  srcdat->SetRTCPDataAddress(senderaddress);
1206  }
1207  else
1208  {
1209  if (!otheraddr->IsFromSameHost(senderaddress))
1210  {
1211  OnSSRCCollision(srcdat, senderaddress, isrtp);
1212  return true;
1213  }
1214 
1215  // Ok, comes from same host, store the address
1216 
1217  if (isrtp)
1218  srcdat->SetRTPDataAddress(senderaddress);
1219  else
1220  srcdat->SetRTCPDataAddress(senderaddress);
1221  }
1222  }
1223  else // no other address, store this one
1224  {
1225  if (isrtp)
1226  srcdat->SetRTPDataAddress(senderaddress);
1227  else
1228  srcdat->SetRTCPDataAddress(senderaddress);
1229  }
1230  }
1231  else // already got an address
1232  {
1233  if (addr == 0)
1234  {
1235  if (senderaddress != 0)
1236  {
1237  OnSSRCCollision(srcdat, senderaddress, isrtp);
1238  return true;
1239  }
1240  }
1241  else
1242  {
1243  if (!addr->IsSameAddress(senderaddress))
1244  {
1245  OnSSRCCollision(srcdat, senderaddress, isrtp);
1246  return true;
1247  }
1248  }
1249  }
1250 
1251  return false;
1252 }
1253 
1254 } // end namespace
1255 
uint8_t GetFractionLost(int index) const
Definition: rtcpsrpacket.h:198
bool ReceivedBYE() const
#define RTCP_SDES_ID_EMAIL
Definition: rtpdefines.h:58
#define ERR_RTP_SOURCES_DONTHAVEOWNSSRC
Definition: rtperrors.h:118
RTPTime GetReceiveTime() const
Definition: rtprawpacket.h:76
int ProcessRTPPacket(RTPPacket *rtppack, const RTPTime &receivetime, const RTPAddress *senderaddress, bool *stored)
Definition: rtpsources.cpp:278
#define RTCP_SDES_ID_LOCATION
Definition: rtpdefines.h:60
#define ERR_RTP_SOURCES_ALREADYHAVEOWNSSRC
Definition: rtperrors.h:117
uint32_t GetJitter(int index) const
Definition: rtcpsrpacket.h:226
RTPTime INF_GetLastMessageTime() const
int ProcessBYE(uint32_t ssrc, std::size_t reasonlength, const void *reasondata, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.cpp:773
std::size_t GetPRIVValueLength() const
virtual void OnRTCPSenderReport(RTPSourceData *srcdat)
Definition: rtpsources.h:401
uint32_t GetLSR(int index) const
Definition: rtcpsrpacket.h:234
int ProcessRTCPCompoundPacket(RTCPCompoundPacket *rtcpcomppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.cpp:362
int SetRTCPDataAddress(const RTPAddress *a)
#define ERR_RTP_PACKET_INVALIDPACKET
Definition: rtperrors.h:77
virtual void OnRTCPSDESItem(RTPSourceData *srcdat, RTCPSDESPacket::ItemType t, const void *itemdata, std::size_t itemlength)
Definition: rtpsources.h:407
virtual void OnAPPPacket(RTCPAPPPacket *apppacket, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.h:415
int ProcessBYEPacket(const uint8_t *reason, std::size_t reasonlen, const RTPTime &receivetime)
virtual void OnNoteTimeout(RTPSourceData *srcdat)
Definition: rtpsources.h:424
int GetReceptionReportCount() const
Definition: rtcpsrpacket.h:176
void MultipleTimeouts(const RTPTime &curtime, const RTPTime &sendertimeout, const RTPTime &byetimeout, const RTPTime &generaltimeout, const RTPTime &notetimeout)
std::size_t GetItemLength() const
bool IsRTCPAddressSet() const
uint32_t GetSSRC(int index) const
Definition: rtcpsrpacket.h:190
#define ERR_RTP_SOURCES_ILLEGALSDESTYPE
Definition: rtperrors.h:119
RTPTime INF_GetLastSDESNoteTime() const
std::size_t GetPRIVPrefixLength() const
RTPSourceData * GetCurrentSourceInfo()
Definition: rtpsources.cpp:609
#define RTCP_SDES_ID_NOTE
Definition: rtpdefines.h:62
uint32_t GetExtendedHighestSequenceNumber(int index) const
Definition: rtcprrpacket.h:171
const RTPAddress * GetRTPDataAddress() const
uint32_t GetSSRC(int index) const
Definition: rtcpbyepacket.h:98
uint32_t GetChunkSSRC() const
int GetSSRCCount() const
Definition: rtcpbyepacket.h:89
std::size_t GetReasonLength() const
RTPTime GetBYETime() const
void SenderTimeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
Definition: rtpsources.cpp:923
void Timeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
Definition: rtpsources.cpp:877
virtual void OnRTCPCompoundPacket(RTCPCompoundPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.h:377
RTPInternalSourceData * owndata
Definition: rtpsources.h:368
int ProcessRTCPReportBlock(uint32_t ssrc, uint8_t fractionlost, int32_t lostpackets, uint32_t exthighseqnr, uint32_t jitter, uint32_t lsr, uint32_t dlsr, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.cpp:664
int GetReceptionReportCount() const
Definition: rtcprrpacket.h:129
unsigned int uint32_t
Definition: rtptypes_win.h:46
int ProcessRawPacket(RTPRawPacket *rawpack, RTPTransmitter *trans, bool acceptownpackets)
Definition: rtpsources.cpp:149
const RTPAddress * GetRTCPDataAddress() const
virtual ~RTPSources()
Definition: rtpsources.cpp:59
uint32_t GetSenderSSRC() const
Definition: rtcprrpacket.h:121
RTPPacket * GetNextPacket()
int ProcessSDESPrivateItem(uint32_t ssrc, std::size_t prefixlen, const void *prefixdata, std::size_t valuelen, const void *valuedata, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.cpp:748
bool GotoFirstSourceWithData()
Definition: rtpsources.cpp:552
virtual void OnBYEPacket(RTPSourceData *srcdat)
Definition: rtpsources.h:398
unsigned char uint8_t
Definition: rtptypes_win.h:42
RTPSourceData * GetSourceInfo(uint32_t ssrc)
Definition: rtpsources.cpp:616
bool CheckCollision(RTPInternalSourceData *srcdat, const RTPAddress *senderaddress, bool isrtp)
virtual void OnRTPPacket(RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.h:374
uint32_t GetSSRC(int index) const
Definition: rtcprrpacket.h:143
int GetCreationError() const
Definition: rtppacket.h:111
uint32_t GetJitter(int index) const
Definition: rtcprrpacket.h:179
bool IsSameAddress(const RTPAddress *addr) const
Definition: rtpaddress.cpp:47
int CreateOwnSSRC(uint32_t ssrc)
Definition: rtpsources.cpp:87
void UpdateMessageTime(const RTPTime &receivetime)
uint8_t GetFractionLost(int index) const
Definition: rtcprrpacket.h:151
uint32_t GetSSRC() const
Definition: rtppacket.h:173
virtual void OnCNAMECollision(RTPSourceData *srcdat, const RTPAddress *senderaddress, const uint8_t *cname, std::size_t cnamelength)
Definition: rtpsources.h:383
RTPKeyHashTable< const uint32_t, RTPInternalSourceData *, RTPSources_GetHashIndex, RTPSOURCES_HASHSIZE > sourcelist
Definition: rtpsources.h:362
uint32_t GetSenderPacketCount() const
Definition: rtcpsrpacket.h:160
bool GotoNextSourceWithData()
Definition: rtpsources.cpp:571
int32_t GetLostPacketCount(int index) const
Definition: rtcpsrpacket.h:206
int32_t i
Definition: decimators.h:244
bool GotoPreviousSourceWithData()
Definition: rtpsources.cpp:590
int ProcessRTPPacket(RTPPacket *rtppack, const RTPTime &receivetime, bool *stored, RTPSources *sources)
#define RTP_MAXCSRCS
Definition: rtpdefines.h:38
int ObtainSourceDataInstance(uint32_t ssrc, RTPInternalSourceData **srcdat, bool *created)
Definition: rtpsources.cpp:802
void ProcessSenderInfo(const RTPNTPTime &ntptime, uint32_t rtptime, uint32_t packetcount, uint32_t octetcount, const RTPTime &receivetime)
ItemType GetItemType() const
#define RTCP_SDES_ID_TOOL
Definition: rtpdefines.h:61
uint32_t GetSSRC() const
int int32_t
Definition: rtptypes_win.h:45
virtual void OnBYETimeout(RTPSourceData *srcdat)
Definition: rtpsources.h:395
int GetCSRCCount() const
Definition: rtppacket.h:129
#define ERR_RTP_SOURCES_SSRCEXISTS
Definition: rtperrors.h:120
int ProcessSDESNormalItem(uint32_t ssrc, RTCPSDESPacket::ItemType t, std::size_t itemlength, const void *itemdata, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.cpp:688
int32_t GetLostPacketCount(int index) const
Definition: rtcprrpacket.h:159
bool IsKnownFormat() const
Definition: rtcppacket.h:76
#define RTCP_SDES_ID_CNAME
Definition: rtpdefines.h:56
virtual void OnUnknownPacketType(RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.h:418
bool IsRTPAddressSet() const
void NoteTimeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
friend class RTPInternalSourceData
Definition: rtpsources.h:370
uint32_t GetExtendedHighestSequenceNumber(int index) const
Definition: rtcpsrpacket.h:218
RTPNTPTime GetNTPTimestamp() const
Definition: rtcpsrpacket.h:143
virtual void OnTimeout(RTPSourceData *srcdat)
Definition: rtpsources.h:392
uint32_t GetSenderSSRC() const
Definition: rtcpsrpacket.h:134
virtual void OnSSRCCollision(RTPSourceData *srcdat, const RTPAddress *senderaddress, bool isrtp)
Definition: rtpsources.h:380
const RTPAddress & GetSenderAddress() const
Definition: rtprawpacket.h:82
virtual void OnRemoveSource(RTPSourceData *srcdat)
Definition: rtpsources.h:389
virtual void OnRTCPReceiverReport(RTPSourceData *srcdat)
Definition: rtpsources.h:404
int GetRTCPSourceData(uint32_t ssrc, const RTPAddress *senderaddress, RTPInternalSourceData **srcdat, bool *newsource)
Definition: rtpsources.cpp:827
#define RTCP_SDES_ID_NAME
Definition: rtpdefines.h:57
PacketType GetPacketType() const
Definition: rtcppacket.h:82
void BYETimeout(const RTPTime &curtime, const RTPTime &timeoutdelay)
Definition: rtpsources.cpp:960
int ProcessSDESItem(uint8_t sdesid, const uint8_t *data, std::size_t itemlen, const RTPTime &receivetime, bool *cnamecollis)
virtual void OnRTCPSDESPrivateItem(RTPSourceData *srcdat, const void *prefixdata, std::size_t prefixlen, const void *valuedata, std::size_t valuelen)
Definition: rtpsources.h:411
uint32_t GetRTPTimestamp() const
Definition: rtcpsrpacket.h:152
virtual void OnNewSource(RTPSourceData *srcdat)
Definition: rtpsources.h:386
#define RTCP_SDES_ID_PHONE
Definition: rtpdefines.h:59
bool IsRTP() const
Definition: rtprawpacket.h:88
uint32_t GetSenderOctetCount() const
Definition: rtcpsrpacket.h:168
virtual void OnUnknownPacketFormat(RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.h:421
bool GotEntry(uint32_t ssrc)
Definition: rtpsources.cpp:625
int ProcessRTCPSenderInfo(uint32_t ssrc, const RTPNTPTime &ntptime, uint32_t rtptime, uint32_t packetcount, uint32_t octetcount, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.cpp:640
bool IsValidated() const
#define ERR_RTP_RTCPCOMPOUND_INVALIDPACKET
Definition: rtperrors.h:82
uint32_t GetLSR(int index) const
Definition: rtcprrpacket.h:187
RTPPacket * GetNextPacket()
Definition: rtpsources.cpp:630
bool IsFromSameHost(const RTPAddress *addr) const
Definition: rtpaddress.cpp:67
int UpdateReceiveTime(uint32_t ssrc, const RTPTime &receivetime, const RTPAddress *senderaddress)
Definition: rtpsources.cpp:855
uint8_t * SDES_GetNote(std::size_t *len) const
uint32_t GetDLSR(int index) const
Definition: rtcpsrpacket.h:242
uint32_t GetCSRC(int num) const
Definition: rtppacket.cpp:249
RTPTime INF_GetLastRTPPacketTime() const
uint32_t GetDLSR(int index) const
Definition: rtcprrpacket.h:195
int ProcessPrivateSDESItem(const uint8_t *prefix, std::size_t prefixlen, const uint8_t *value, std::size_t valuelen, const RTPTime &receivetime)
void ProcessReportBlock(uint8_t fractionlost, int32_t lostpackets, uint32_t exthighseqnr, uint32_t jitter, uint32_t lsr, uint32_t dlsr, const RTPTime &receivetime)
int SetRTPDataAddress(const RTPAddress *a)