sipxmedialib  Version 3.3
ReceiverReport.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2013 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2006 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 
14 // Border Guard
15 #ifndef _ReceiverReport_h
16 #define _ReceiverReport_h
17 
18 #include "rtcp/RtcpConfig.h"
19 
20 // Includes
21 #include "RTPHeader.h"
22 #include "RTCPHeader.h"
23 #include "IReceiverReport.h"
24 #include "IGetReceiverStatistics.h"
25 #include "ISetReceiverStatistics.h"
26 
27 
28 
46 class CReceiverReport : public CBaseClass,
47  // Inherits CBaseClass implementation
48  public CRTCPHeader,
49  // Inherits the CRTCPHeader implementation
50  public IReceiverReport,
51  // Receiver Report Control Interface
52  public IGetReceiverStatistics,
53  // Get Receiver Statistics Interface
54  public ISetReceiverStatistics
55  // Set Receiver Statistics Interface
56  {
57 
58 // Public Methods
59 public:
60 
84  CReceiverReport(ssrc_t ulSSRC=0, unsigned long ulVersion=2);
85 
86 
105  ~CReceiverReport(void);
106 
107 
128  void SetRTPStatistics(IRTPHeader *piRTPHeader);
129 
130 
150  void SetLastRcvdSRTime(uint32_t aulNTPTimestamp[]);
151 
152 
184  void GetReceiverStatistics(uint32_t *pulFractionalLoss,
185  uint32_t *pulCumulativeLoss,
186  uint32_t *pulHighestSequenceNo,
187  uint32_t *pulInterarrivalJitter,
188  uint32_t *pulSRTimestamp,
189  uint32_t *pulPacketDelay);
190 
191 
192 
225  unsigned long FormatReceiverReport(bool bSRPresent,
226  unsigned char *puchReportBuffer,
227  unsigned long ulBufferSize);
228 
229 
230 
255  unsigned long ParseReceiverReport(bool bHeader,
256  unsigned char *puchReportBuffer);
257 
276  ssrc_t GetSSRC(void);
277 
296  virtual void SetSSRC(ssrc_t ulSSRC);
297 
298 
318 
319  private: // Private Methods
320 
321 
341  void SetRemoteSSRC(IRTPHeader *piRTPHeader);
342 
361  void UpdateJitter(IRTPHeader *pIRTPHeader);
362 
363 
385  void UpdateSequence(IRTPHeader *piRTPHeader);
386 
405  void UpdateSequenceNumbers(ssrc_t ulSequenceNo);
406 
423  void IncrementPacketCounters(void);
424 
425 
443  void UpdateLostPackets(void);
444 
445 
464  unsigned long LoadRemoteSSRC(ssrc_t *pulPayloadBuffer);
465 
484  unsigned long LoadLossStatistics(uint32_t *pulPayloadBuffer);
485 
506  unsigned long LoadExtendedSequence(uint32_t *pulPayloadBuffer);
507 
528  unsigned long LoadJitter(uint32_t *pulPayloadBuffer);
529 
550  unsigned long LoadReportTimes(uint32_t *pulPayloadBuffer);
551 
570  unsigned long ExtractRemoteSSRC(uint32_t *pulPayloadBuffer);
571 
590  unsigned long ExtractLossStatistics(uint32_t *pulPayloadBuffer);
591 
612  unsigned long ExtractExtendedSequence(uint32_t *pulPayloadBuffer);
613 
634  unsigned long ExtractJitter(uint32_t *pulPayloadBuffer);
635 
655  unsigned long ExtractReportTimes(uint32_t *pulPayloadBuffer);
656 
657 
673  void ResetPeriodCounts(void);
674 
693  void ResetStatistics(void);
694 
695 
696  private: // Private Data Members
697 
698 
710  CRITICAL_SECTION m_csSynchronized;
711 
723 
735 
747 
759 
771 
772 
784 
795 
806 
817 
818 
831 
844 
845 
856 
867 
878 
879 
888  uint32_t m_ulMeanJitter;
889 
890 
902 
914 
915 
926  uint32_t m_ulSRDelay;
927 
946 
949 
950 };
951 
971 {
972 
973  return(CRTCPHeader::GetSSRC());
974 
975 }
976 
977 #endif
int mTotalPackets
Definition: ReceiverReport.h:947
unsigned long ParseReceiverReport(bool bHeader, unsigned char *puchReportBuffer)
interface unsigned long ulBufferSize
Definition: INetworkSource.h:54
unsigned long ExtractRemoteSSRC(uint32_t *pulPayloadBuffer)
uint32_t m_ulCachedLastSRTimestamp
Definition: ReceiverReport.h:944
uint32_t m_ulCachedSRDelay
Definition: ReceiverReport.h:945
void UpdateSequenceNumbers(ssrc_t ulSequenceNo)
uint32_t m_ulLastSequenceNo
Definition: ReceiverReport.h:805
uint32_t m_ulTotalPacketCount
Definition: ReceiverReport.h:734
unsigned long ExtractJitter(uint32_t *pulPayloadBuffer)
void GetReceiverStatistics(uint32_t *pulFractionalLoss, uint32_t *pulCumulativeLoss, uint32_t *pulHighestSequenceNo, uint32_t *pulInterarrivalJitter, uint32_t *pulSRTimestamp, uint32_t *pulPacketDelay)
void UpdateLostPackets(void)
unsigned long FormatReceiverReport(bool bSRPresent, unsigned char *puchReportBuffer, unsigned long ulBufferSize)
unsigned long LoadRemoteSSRC(ssrc_t *pulPayloadBuffer)
void SetLastRcvdSRTime(uint32_t aulNTPTimestamp[])
uint32_t m_ulHighestSequenceNo
Definition: ReceiverReport.h:830
CRITICAL_SECTION m_csSynchronized
Definition: ReceiverReport.h:710
uint32_t m_ulPeriodPacketCount
Definition: ReceiverReport.h:746
unsigned long ExtractReportTimes(uint32_t *pulPayloadBuffer)
uint32_t m_ulFirstSequenceNo
Definition: ReceiverReport.h:794
void SetRTPStatistics(IRTPHeader *piRTPHeader)
unsigned long LoadJitter(uint32_t *pulPayloadBuffer)
void ResetPeriodCounts(void)
uint32_t m_ulLastPacketSendTime
Definition: ReceiverReport.h:866
void ResetStatistics(void)
ssrc_t m_ulRemoteSSRC
Definition: ReceiverReport.h:722
void IncrementPacketCounters(void)
void SetRemoteSSRC(IRTPHeader *piRTPHeader)
uint32_t m_ulCachedCumulativeLoss
Definition: ReceiverReport.h:941
uint32_t m_ulCachedFractionalLoss
Definition: ReceiverReport.h:940
uint32_t m_ulLastPeriodExpectedCount
Definition: ReceiverReport.h:843
uint32_t m_ulPeriodPacketLoss
Definition: ReceiverReport.h:758
unsigned long LoadLossStatistics(uint32_t *pulPayloadBuffer)
void UpdateJitter(IRTPHeader *pIRTPHeader)
interface long unsigned char * puchReportBuffer
Definition: ISDESReport.h:79
Definition: ReceiverReport.h:46
uint32_t m_ulCachedHighestSequenceNo
Definition: ReceiverReport.h:942
~CReceiverReport(void)
uint32_t m_ulLastPeriodPacketCount
Definition: ReceiverReport.h:855
virtual void SetSSRC(ssrc_t ulSSRC)
Definition: RTCPHeader.h:51
#define DECLARE_IBASE_M
Definition: BaseClass.h:368
ssrc_t GetSSRC(void)
Definition: ReceiverReport.h:970
uint32_t m_ulLastPacketReceiveTime
Definition: ReceiverReport.h:877
uint32_t m_ulMeanJitter
Definition: ReceiverReport.h:888
uint32_t ssrc_t
Definition: RtcpConfig.h:62
uint32_t m_ulLastSRTimestamp
Definition: ReceiverReport.h:901
double m_dLastSRRcvdTimestamp
Definition: ReceiverReport.h:913
unsigned long LoadExtendedSequence(uint32_t *pulPayloadBuffer)
Definition: BaseClass.h:118
unsigned long ExtractExtendedSequence(uint32_t *pulPayloadBuffer)
void UpdateSequence(IRTPHeader *piRTPHeader)
uint32_t m_ulFractionalLoss
Definition: ReceiverReport.h:770
unsigned long ExtractLossStatistics(uint32_t *pulPayloadBuffer)
uint32_t m_ulCumulativeLoss
Definition: ReceiverReport.h:783
CReceiverReport(ssrc_t ulSSRC=0, unsigned long ulVersion=2)
uint32_t m_ulSRDelay
Definition: ReceiverReport.h:926
virtual ssrc_t GetSSRC(void)
unsigned long LoadReportTimes(uint32_t *pulPayloadBuffer)
uint32_t m_ulSequenceWraps
Definition: ReceiverReport.h:816
uint32_t m_ulCachedMeanJitter
Definition: ReceiverReport.h:943
int mTotalWarnings
Definition: ReceiverReport.h:948