sipxmedialib  Version 3.3
RTCPRender.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 // Border Guard
14 #ifndef _RTCPRender_h
15 #define _RTCPRender_h
16 
17 #include "rtcp/RtcpConfig.h"
18 
19 // Includes
20 #include "SenderReport.h"
21 #include "ReceiverReport.h"
22 #include "SourceDescription.h"
23 #include "ByeReport.h"
24 #include "INetworkRender.h"
25 #include "IRTPDispatch.h"
26 #include "IRTCPRender.h"
27 #include "IRTCPStatistics.h"
28 #include "IRTCPNotify.h"
29 
30 
31 
32 
53  public CBaseClass, // Inherits CBaseClass implementation
54  public IRTPDispatch, // Inbound RTP Dispatch Interface
55  public IRTCPRender, // RTCP Sender Control Interface
56  public IRTCPStatistics // RTCP Statistics Retrieval Interface
57 
58  {
59 
60 // Public Methods
61 public:
62 
87  CRTCPRender(ssrc_t ulSSRC,
88  IRTCPNotify *piRTCPNotify,
89  ISDESReport *piSDESReport=NULL);
90 
91 
123  virtual ~CRTCPRender(void);
124 
125 
146  bool Initialize(void);
147 
165  void GetReceiveStatInterface(ISetReceiverStatistics **ppiSetReceiverStats);
166 
184  void GetSenderStatInterface(ISetSenderStatistics **ppiSetSenderStats);
185 
204  void SetNetworkRender(INetworkRender *piNetworkRender);
205 
224  void ClearNetworkRender(void);
225 
251  void ForwardRTPHeader(IRTPHeader *piRTPHeader);
252 
253 
282  unsigned long ForwardSDESReport(ISDESReport *piSDESReport);
283 
284 
311  unsigned long ForwardByeReport(IByeReport *piByeReport);
312 
342  unsigned long GenerateRTCPReports(unsigned char *puchRTCPReport=NULL,
343  unsigned long ulReportLength=0);
344 
367  unsigned long GenerateByeReport(ssrc_t aulCSRC[],
368  unsigned long ulCSRCs,
369  unsigned char *puchByeReason);
370 
371 
393  void ReassignSSRC(ssrc_t ulSSRC);
394 
395 
396 
413  ssrc_t GetRemoteSSRC(void);
414  bool isRemoteSSRCValid(void);
415 
445  void GetStatistics(IGetSrcDescription **piGetSrcDescription,
446  IGetSenderStatistics **piSenderStatistics,
447  IGetReceiverStatistics **piReceiverStatistics,
448  IGetByeInfo **piGetByeInfo);
449 
469 
470 
471 private: // Private Data Members
472 
483  IRTCPNotify * m_piRTCPNotify;
484 
496  INetworkRender *m_piNetworkRender;
497 
508  ISDESReport *m_piSDESReport;
509 
510 
524 
538 
539 
553 
554 
565  unsigned long m_ulReportCount;
566 
578 
590 
602 
604 
605 };
606 
624 inline bool CRTCPRender::isRemoteSSRCValid(void) { return (0 != m_iRemoteSSRCFound); }
625 
644 inline void CRTCPRender::SetNetworkRender(INetworkRender *piNetworkRender)
645 {
646 
647 // Store the Network Render interface
648  m_piNetworkRender = piNetworkRender;
649  m_piNetworkRender->AddRef(ADD_RELEASE_CALL_ARGS(__LINE__));
650 
651 }
652 
672 {
673 
674 // Clear the Network Render interface
676  {
677  m_piNetworkRender->Release(ADD_RELEASE_CALL_ARGS(__LINE__));
678  m_piNetworkRender = NULL;
679  }
680 
681 }
682 
683 #endif
CRTCPRender(ssrc_t ulSSRC, IRTCPNotify *piRTCPNotify, ISDESReport *piSDESReport=NULL)
unsigned long m_ulReportCount
Definition: RTCPRender.h:565
void ForwardRTPHeader(IRTPHeader *piRTPHeader)
ssrc_t m_ulRemoteSSRC
Definition: RTCPRender.h:589
void GetReceiveStatInterface(ISetReceiverStatistics **ppiSetReceiverStats)
bool Initialize(void)
unsigned long ForwardSDESReport(ISDESReport *piSDESReport)
void GetStatistics(IGetSrcDescription **piGetSrcDescription, IGetSenderStatistics **piSenderStatistics, IGetReceiverStatistics **piReceiverStatistics, IGetByeInfo **piGetByeInfo)
ISDESReport * m_piSDESReport
Definition: RTCPRender.h:508
ssrc_t GetRemoteSSRC(void)
Definition: RTCPRender.h:623
IRTCPNotify * m_piRTCPNotify
Definition: RTCPRender.h:483
interface IGetSenderStatistics IGetReceiverStatistics ** piReceiverStatistics
Definition: IRTCPStatistics.h:74
interface IGetSenderStatistics ** piSenderStatistics
Definition: IRTCPStatistics.h:74
void ReassignSSRC(ssrc_t ulSSRC)
unsigned long ForwardByeReport(IByeReport *piByeReport)
#define ADD_RELEASE_CALL_ARGS(x)
Definition: RtcpConfig.h:74
void ClearNetworkRender(void)
Definition: RTCPRender.h:671
CReceiverReport * m_poReceiverReport
Definition: RTCPRender.h:537
unsigned long GenerateRTCPReports(unsigned char *puchRTCPReport=NULL, unsigned long ulReportLength=0)
ssrc_t m_ulLocalSSRC
Definition: RTCPRender.h:577
CSenderReport * m_poSenderReport
Definition: RTCPRender.h:523
Definition: RTCPRender.h:52
Definition: ReceiverReport.h:46
int mPacketCount
Definition: RTCPRender.h:603
void GetSenderStatInterface(ISetSenderStatistics **ppiSetSenderStats)
virtual ~CRTCPRender(void)
#define DECLARE_IBASE_M
Definition: BaseClass.h:368
uint32_t ssrc_t
Definition: RtcpConfig.h:62
int m_iRemoteSSRCFound
Definition: RTCPRender.h:601
Definition: ByeReport.h:44
Definition: BaseClass.h:118
bool isRemoteSSRCValid(void)
Definition: RTCPRender.h:624
Definition: SenderReport.h:49
INetworkRender * m_piNetworkRender
Definition: RTCPRender.h:496
unsigned long GenerateByeReport(ssrc_t aulCSRC[], unsigned long ulCSRCs, unsigned char *puchByeReason)
CByeReport * m_poByeReport
Definition: RTCPRender.h:552
void SetNetworkRender(INetworkRender *piNetworkRender)
Definition: RTCPRender.h:644
interface IGetSenderStatistics IGetReceiverStatistics IGetByeInfo ** piGetByeInfo
Definition: IRTCPStatistics.h:74