sipxmedialib  Version 3.3
RTCPConnection.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 _RTCPConnection_h
15 #define _RTCPConnection_h
16 
17 #include "rtcp/RtcpConfig.h"
18 
19 // Includes
20 #include "NetworkChannel.h"
21 #include "RTCPSource.h"
22 #include "RTCPRender.h"
23 #include "RTCPTimer.h"
24 #include "IRTCPSession.h"
25 
26 
71 class CRTCPConnection : public CBaseClass,
72  // Inherits CBaseClass implementation
73  public CRTCPTimer,
74  // Inherit CTimer Class implementation
75  public IRTCPConnection,
76  // Interface exposed for RTCP Connection Control
77  public IRTCPNotify
78  // Interface exposed for RTCP Notifications
79  {
80 
81 // Public Methods
82 public:
83 
108  CRTCPConnection(unsigned long ulSSRC, IRTCPNotify *piRTCPNotify,
109  ISDESReport *piSDESReport);
110 
133  ~CRTCPConnection(void);
134 
135 
156  bool Initialize(void);
157 
158 
186  void GetDispatchInterfaces(INetDispatch **ppiNetDispatch,
187  IRTPDispatch **ppiRTPDispatch,
188  ISetSenderStatistics **piSenderStats);
189 
208  unsigned long GetRemoteSSRC(void);
209  bool isRemoteSSRCValid(void);
210 
211 
230  IRTCPRender * GetRenderInterface(void);
231 
256  void GenerateRTCPReports(unsigned char *puchByeReason = NULL,
257  ssrc_t aulCSRC[] = NULL,
258  unsigned long ulCSRCs = 0);
259 
260 
278  bool StopRenderer(void);
279 
280 
299  bool Terminate(void);
300 
301 
321  unsigned long GetEventInterest(void);
322 
347  void NewSDES(IGetSrcDescription *piGetSrcDescription,
348  IRTCPConnection *piRTCPConnection=NULL,
349  IRTCPSession *piRTCPSession=NULL);
350 
376  void UpdatedSDES(IGetSrcDescription *piGetSrcDescription,
377  unsigned long ulChangeMask,
378  IRTCPConnection *piRTCPConnection=NULL,
379  IRTCPSession *piRTCPSession=NULL);
380 
381 
405  void SenderReportReceived(IGetSenderStatistics *piGetSenderStatistics,
406  IRTCPConnection *piRTCPConnection=NULL,
407  IRTCPSession *piRTCPSession=NULL);
408 
409 
433  void ReceiverReportReceived(IGetReceiverStatistics *piGetReceiverStatistics,
434  IRTCPConnection *piRTCPConnection=NULL,
435  IRTCPSession *piRTCPSession=NULL);
436 
437 
461  void ByeReportReceived(IGetByeInfo *piGetByeInfo,
462  IRTCPConnection *piRTCPConnection=NULL,
463  IRTCPSession *piRTCPSession=NULL);
464 
488  void SDESReportSent(IGetSrcDescription *piGetSrcDescription,
489  IRTCPConnection *piRTCPConnection=NULL,
490  IRTCPSession *piRTCPSession=NULL) {};
491 
515  void SenderReportSent(IGetSenderStatistics *piGetSenderStatistics,
516  IRTCPConnection *piRTCPConnection=NULL,
517  IRTCPSession *piRTCPSession=NULL) {};
518 
519 
543  void ReceiverReportSent(IGetReceiverStatistics *piGetReceiverStatistics,
544  IRTCPConnection *piRTCPConnection=NULL,
545  IRTCPSession *piRTCPSession=NULL) {};
546 
547 
571  void ByeReportSent(IGetByeInfo *piGetByeInfo,
572  IRTCPConnection *piRTCPConnection=NULL,
573  IRTCPSession *piRTCPSession=NULL) {};
574 
596  void LocalSSRCCollision(IRTCPConnection *piRTCPConnection=NULL,
597  IRTCPSession *piRTCPSession=NULL) {};
598 
599 
620  void RemoteSSRCCollision(IRTCPConnection *piRTCPConnection=NULL,
621  IRTCPSession *piRTCPSession=NULL) {};
622 
645  void RTCPReportingAlarm(IRTCPConnection *piRTCPConnection=NULL,
646  IRTCPSession *piRTCPSession=NULL);
647 
648 
668 
669 
670 private: // Private Data Members
671 
672 #ifdef PINGTEL_OSSOCKET
673 
691  bool StartRenderer(OsSocket& rRtcpSocket);
692 #else
693  bool StartRenderer(INetworkRender *piNetworkRender);
694 #endif
695 
696 
697 
708  unsigned long m_ulSSRC;
709 
720  INetworkRender *m_piRTCPNetworkRender;
721 
732  IRTCPNotify * m_piRTCPNotify;
733 
744  ISDESReport *m_piSDESReport;
745 
756  unsigned long m_ulEventInterest;
757 
758 
759 
771 
772 
783 
784 
785 };
786 
806 inline unsigned long CRTCPConnection::GetRemoteSSRC(void) { return ((m_poRTCPRender) ? (m_poRTCPRender->GetRemoteSSRC()) : 0); }
808 
828 inline unsigned long CRTCPConnection::GetEventInterest(void)
829 {
830 
831  return(m_ulEventInterest);
832 }
833 
834 #endif
Definition: RTCPSource.h:53
void SenderReportReceived(IGetSenderStatistics *piGetSenderStatistics, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
ISDESReport * m_piSDESReport
Definition: RTCPConnection.h:744
bool Terminate(void)
void UpdatedSDES(IGetSrcDescription *piGetSrcDescription, unsigned long ulChangeMask, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
void NewSDES(IGetSrcDescription *piGetSrcDescription, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
bool StartRenderer(INetworkRender *piNetworkRender)
interface IRTPDispatch ISetSenderStatistics ** piSenderStats
Definition: IRTCPConnection.h:83
CRTCPRender * m_poRTCPRender
Definition: RTCPConnection.h:770
void SenderReportSent(IGetSenderStatistics *piGetSenderStatistics, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPConnection.h:515
void GenerateRTCPReports(unsigned char *puchByeReason=NULL, ssrc_t aulCSRC[]=NULL, unsigned long ulCSRCs=0)
IRTCPRender * GetRenderInterface(void)
void RemoteSSRCCollision(IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPConnection.h:620
ssrc_t GetRemoteSSRC(void)
Definition: RTCPRender.h:623
bool Initialize(void)
unsigned long GetRemoteSSRC(void)
Definition: RTCPConnection.h:806
void LocalSSRCCollision(IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPConnection.h:596
unsigned long m_ulSSRC
Definition: RTCPConnection.h:708
void ByeReportReceived(IGetByeInfo *piGetByeInfo, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
void ReceiverReportReceived(IGetReceiverStatistics *piGetReceiverStatistics, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
IRTCPNotify * m_piRTCPNotify
Definition: RTCPConnection.h:732
bool StopRenderer(void)
Definition: RTCPRender.h:52
CRTCPSource * m_poRTCPSource
Definition: RTCPConnection.h:782
void ByeReportSent(IGetByeInfo *piGetByeInfo, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPConnection.h:571
unsigned long m_ulEventInterest
Definition: RTCPConnection.h:756
~CRTCPConnection(void)
void SDESReportSent(IGetSrcDescription *piGetSrcDescription, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPConnection.h:488
void ReceiverReportSent(IGetReceiverStatistics *piGetReceiverStatistics, IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
Definition: RTCPConnection.h:543
Definition: RTCPConnection.h:71
#define DECLARE_IBASE_M
Definition: BaseClass.h:368
uint32_t ssrc_t
Definition: RtcpConfig.h:62
Definition: RTCPTimer.h:52
void RTCPReportingAlarm(IRTCPConnection *piRTCPConnection=NULL, IRTCPSession *piRTCPSession=NULL)
INetworkRender * m_piRTCPNetworkRender
Definition: RTCPConnection.h:720
Definition: BaseClass.h:118
bool isRemoteSSRCValid(void)
Definition: RTCPRender.h:624
void GetDispatchInterfaces(INetDispatch **ppiNetDispatch, IRTPDispatch **ppiRTPDispatch, ISetSenderStatistics **piSenderStats)
interface IRTPDispatch ** ppiRTPDispatch
Definition: IRTCPConnection.h:81
CRTCPConnection(unsigned long ulSSRC, IRTCPNotify *piRTCPNotify, ISDESReport *piSDESReport)
interface IGetSenderStatistics IGetReceiverStatistics IGetByeInfo ** piGetByeInfo
Definition: IRTCPStatistics.h:74
bool isRemoteSSRCValid(void)
Definition: RTCPConnection.h:807
unsigned long GetEventInterest(void)
Definition: RTCPConnection.h:828