OPAL  Version 3.18.8
OpalRTPSession Class Reference

#include <rtp_session.h>

Inheritance diagram for OpalRTPSession:
Collaboration diagram for OpalRTPSession:

Data Structures

struct  Data
 
class  NotifierMap
 
struct  SyncSource
 

Public Member Functions

virtual SendReceiveStatus SendBYE (RTP_SyncSourceId ssrc=0)
 Send BYE command. More...
 
virtual SendReceiveStatus SendNACK (const RTP_ControlFrame::LostPacketMask &lostPackets, RTP_SyncSourceId ssrc=0)
 Send NACK RTCP command. More...
 
virtual SendReceiveStatus SendTWCC (const RTP_TransportWideCongestionControl &twcc)
 Send Transport Wide Congestion Control RTCP command. More...
 
virtual SendReceiveStatus SendFlowControl (unsigned maxBitRate, unsigned overhead=0, bool notify=false, RTP_SyncSourceId ssrc=0)
 
virtual SendReceiveStatus SendIntraFrameRequest (unsigned options, RTP_SyncSourceId ssrc=0, const PTime &now=PTime())
 
virtual SendReceiveStatus SendTemporalSpatialTradeOff (unsigned tradeOff, RTP_SyncSourceId ssrc=0)
 
RTP_Timestamp GetLastSentTimestamp (RTP_SyncSourceId ssrc=0) const
 
const PTime & GetLastSentNetTime (RTP_SyncSourceId ssrc=0) const
 
void SetJitterBuffer (OpalJitterBuffer *jitterBuffer, RTP_SyncSourceId ssrc=0)
 Set the jitter buffer to get certain RTCP statustics from. More...
 
bool HasFeedback (OpalMediaFormat::RTCPFeedback feature) const
 
Construction
 OpalRTPSession (const Init &init)
 
 ~OpalRTPSession ()
 
Overrides from class OpalMediaSession
virtual const PCaselessString & GetSessionType () const
 
virtual bool Open (const PString &localInterface, const OpalTransportAddress &remoteAddress)
 
virtual bool Close ()
 
virtual OpalTransportAddress GetLocalAddress (bool isMediaAddress=true) const
 
virtual OpalTransportAddress GetRemoteAddress (bool isMediaAddress=true) const
 
virtual bool SetRemoteAddress (const OpalTransportAddress &remoteAddress, bool isMediaAddress=true)
 
virtual void AttachTransport (const OpalMediaTransportPtr &transport)
 
virtual OpalMediaTransportPtr DetachTransport ()
 
virtual bool AddGroup (const PString &groupId, const PString &mediaId, bool overwrite=true)
 
virtual bool UpdateMediaFormat (const OpalMediaFormat &mediaFormat)
 
virtual OpalMediaStreamCreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource)
 
- Public Member Functions inherited from OpalMediaSession
 ~OpalMediaSession ()
 
virtual void PrintOn (ostream &strm) const
 
virtual bool IsOpen () const
 
virtual void Start ()
 
virtual bool IsEstablished () const
 
OpalMediaTransportPtr GetTransport () const
 
bool IsGroupMember (const PString &groupId) const
 
PStringArray GetGroups () const
 
PString GetGroupMediaId (const PString &groupId) const
 
virtual void GetStatistics (OpalMediaStatistics &statistics, bool receiver) const
 
void SetRemoteBehindNAT ()
 Indicate remote is behind NAT. More...
 
bool IsRemoteBehindNAT () const
 
void OfferCryptoSuite (const PString &cryptoSuite)
 
virtual OpalMediaCryptoKeyListGetOfferedCryptoKeys ()
 
virtual bool ApplyCryptoKey (OpalMediaCryptoKeyList &keys, bool rx)
 
virtual OpalMediaCryptoKeyInfoIsCryptoSecured (bool rx) const
 
OpalConnectionGetConnection () const
 
unsigned GetSessionID () const
 
const OpalMediaTypeGetMediaType () const
 
const PStringOptions & GetStringOptions () const
 
void SetStringOptions (const PStringOptions &options)
 

Static Public Member Functions

static const PCaselessString & RTP_AVP ()
 
static const PCaselessString & RTP_AVPF ()
 
- Static Public Member Functions inherited from OpalMediaSession
static const PString & GetBundleGroupId ()
 

Protected Types

typedef std::map
< RTP_SyncSourceId, SyncSource * > 
SyncSourceMap
 

Protected Member Functions

virtual OpalMediaTransportCreateMediaTransport (const PString &name)
 
void InternalAttachTransport (const OpalMediaTransportPtr &transport PTRACE_PARAM(, const char *from))
 
bool InternalSetQoS (const PIPSocket::QoS &qos)
 
 PDECLARE_MediaReadNotifier (OpalRTPSession, OnRxDataPacket)
 
 PDECLARE_MediaReadNotifier (OpalRTPSession, OnRxControlPacket)
 
void SessionFailed (SubChannels subchannel PTRACE_PARAM(, const char *reason))
 
const SyncSourceGetSyncSource (RTP_SyncSourceId ssrc, Direction dir) const
 
virtual bool GetSyncSource (RTP_SyncSourceId ssrc, Direction dir, SyncSource *&info)
 
virtual SyncSourceUseSyncSource (RTP_SyncSourceId ssrc, Direction dir, bool force)
 
virtual SyncSourceCreateSyncSource (RTP_SyncSourceId id, Direction dir, const char *cname)
 
virtual bool CheckControlSSRC (RTP_SyncSourceId senderSSRC, RTP_SyncSourceId targetSSRC, SyncSource *&info PTRACE_PARAM(, const char *pduName))
 
virtual bool ResequenceOutOfOrderPackets (SyncSource &ssrc) const
 
virtual bool InternalSendReport (RTP_ControlFrame &report, SyncSource &sender, bool includeReceivers, bool forced, const PTime &now)
 Set up RTCP as per RFC rules. More...
 
virtual void InitialiseControlFrame (RTP_ControlFrame &frame, SyncSource &sender)
 
 PDECLARE_NOTIFIER (PTimer, OpalRTPSession, TimedSendReport)
 
OpalMediaTransport::CongestionControlGetCongestionControl ()
 
 PTRACE_THROTTLE (m_throttleTxReport, 3, 60000, 5)
 
 PTRACE_THROTTLE (m_throttleRxEmptyRR, 3, 60000)
 
 PTRACE_THROTTLE (m_throttleRxSDES, 4, 60000)
 
- Protected Member Functions inherited from OpalMediaSession
 OpalMediaSession (const Init &init)
 

Protected Attributes

OpalRTPEndPointm_endpoint
 
OpalManagerm_manager
 
bool m_singlePortRx
 
bool m_singlePortTx
 
bool m_reducedSizeRTCP
 
bool m_isAudio
 
unsigned m_timeUnits
 
PString m_toolName
 
PString m_label
 
RTPHeaderExtensions m_headerExtensions
 
unsigned m_absSendTimeHdrExtId
 
unsigned m_transportWideSeqNumHdrExtId
 
PTimeInterval m_staleReceiverTimeout
 
PINDEX m_maxOutOfOrderPackets
 
PTimeInterval m_waitOutOfOrderTime
 
unsigned m_txStatisticsInterval
 
unsigned m_rxStatisticsInterval
 
OpalMediaFormat::RTCPFeedback m_feedback
 
OpalJitterBufferm_jitterBuffer
 
NotifierMap m_notifiers
 
SyncSourceMap m_SSRC
 
SyncSource m_dummySyncSource
 
atomic< RTP_SyncSourceIdm_defaultSSRC [2]
 
unsigned m_rtcpPacketsSent
 
unsigned m_rtcpPacketsReceived
 
int m_roundTripTime
 
PTimer m_reportTimer
 
PIPSocket::QoS m_qos
 
unsigned m_packetOverhead
 
WORD m_remoteControlPort
 
bool m_sendEstablished
 
OpalMediaTransport::ReadNotifier m_dataNotifier
 
OpalMediaTransport::ReadNotifier m_controlNotifier
 
ApplDefinedNotifierList m_applDefinedNotifiers
 
- Protected Attributes inherited from OpalMediaSession
OpalConnectionm_connection
 
unsigned m_sessionId
 
OpalMediaType m_mediaType
 
bool m_remoteBehindNAT
 
PStringOptions m_stringOptions
 
PStringToString m_groups
 
OpalMediaTransportPtr m_transport
 
OpalMediaCryptoKeyList m_offeredCryptokeys
 

Friends

struct SyncSource
 
class RTCP_XR_Metrics
 

Operations

enum  Direction { e_Receiver, e_Sender }
 
enum  SendReceiveStatus { e_IgnorePacket = -1, e_AbortTransport, e_ProcessPacket }
 
enum  RewriteMode {
  e_RewriteHeader, e_RewriteSSRC, e_RewriteNothing, e_RetransmitFirst,
  e_RetransmitAgain
}
 
enum  ReceiveType { e_RxFromNetwork, e_RxOutOfOrder, e_RxRetransmit, e_RxFromRTX }
 
virtual RTP_SyncSourceId AddSyncSource (RTP_SyncSourceId id, Direction dir, const char *cname=NULL)
 
virtual bool RemoveSyncSource (RTP_SyncSourceId id)
 
RTP_SyncSourceArray GetSyncSources (Direction dir) const
 
RTP_SyncSourceId EnableSyncSourceRtx (RTP_SyncSourceId primarySSRC, RTP_DataFrame::PayloadTypes rtxPT, RTP_SyncSourceId rtxSSRC)
 
void FinaliseSyncSourceRtx (RTP_DataFrame::PayloadTypes primaryPT, RTP_DataFrame::PayloadTypes rtxPT, OpalRTPSession::Direction dir)
 
virtual SendReceiveStatus WriteData (RTP_DataFrame &frame, RewriteMode rewrite=e_RewriteHeader, const PIPSocketAddressAndPort *remote=NULL, const PTime &now=PTime())
 
virtual SendReceiveStatus SendReport (RTP_SyncSourceId ssrc, bool force, const PTime &now=PTime())
 
virtual SendReceiveStatus WriteControl (RTP_ControlFrame &frame, const PIPSocketAddressAndPort *remote=NULL)
 
virtual PString GetLocalHostName ()
 
virtual void GetStatistics (OpalMediaStatistics &statistics, Direction dir) const
 

Call back functions

typedef PNotifierTemplate< Data & > DataNotifier
 
typedef PNotifierListTemplate
< const
RTP_ControlFrame::ApplDefinedInfo & > 
ApplDefinedNotifierList
 
typedef PNotifierTemplate
< const
RTP_ControlFrame::ApplDefinedInfo & > 
ApplDefinedNotifier
 
void AddDataNotifier (unsigned priority, const DataNotifier &notifier, RTP_SyncSourceId ssrc=0)
 
void RemoveDataNotifier (const DataNotifier &notifier, RTP_SyncSourceId ssrc=0)
 Remove the data notifier. More...
 
virtual SendReceiveStatus OnSendData (RewriteMode &rewrite, RTP_DataFrame &frame, const PTime &now)
 
virtual SendReceiveStatus OnSendControl (RTP_ControlFrame &frame, const PTime &now)
 
virtual SendReceiveStatus OnPreReceiveData (RTP_DataFrame &frame, const PTime &now)
 
virtual SendReceiveStatus OnReceiveData (RTP_DataFrame &frame, ReceiveType rxType, const PTime &now)
 
virtual SendReceiveStatus OnReceiveControl (RTP_ControlFrame &frame, const PTime &now)
 
virtual bool IsEncrypted () const
 
virtual void OnRxSenderReport (const RTP_SenderReport &sender, const PTime &now)
 
virtual void OnRxReceiverReports (RTP_SyncSourceId src, const RTP_ControlFrame::ReceiverReport *rr, unsigned count, const PTime &now)
 
virtual void OnRxReceiverReports (RTP_SyncSourceId src, const std::vector< RTP_ReceiverReport > &reports)
 
virtual void OnRxReceiverReport (RTP_SyncSourceId src, const RTP_ControlFrame::ReceiverReport &rr)
 
virtual void OnRxReceiverReport (RTP_SyncSourceId src, const RTP_ReceiverReport &report)
 
virtual void OnRxSourceDescription (const RTP_SourceDescriptionArray &descriptions)
 
virtual void OnRxGoodbye (const RTP_SyncSourceArray &sources, const PString &reason)
 
virtual void OnRxNACK (RTP_SyncSourceId ssrc, const RTP_ControlFrame::LostPacketMask &lostPackets, const PTime &now)
 
virtual void OnRxTWCC (const RTP_TransportWideCongestionControl &twcc)
 
virtual void OnRxApplDefined (const RTP_ControlFrame::ApplDefinedInfo &info)
 
virtual bool OnReceiveExtendedReports (const RTP_ControlFrame &frame, const PTime &now)
 
virtual void OnRxReceiverReferenceTimeReport (RTP_SyncSourceId ssrc, const PTime &ntp, const PTime &now)
 
virtual void OnRxDelayLastReceiverReport (const RTP_DelayLastReceiverReport &dlrr, const PTime &now)
 
void AddApplDefinedNotifier (const ApplDefinedNotifier &notifier)
 
void RemoveApplDefinedNotifier (const ApplDefinedNotifier &notifier)
 

Member variable access

static const PString & GetAbsSendTimeHdrExtURI ()
 
static const PString & GetTransportWideSeqNumHdrExtURI ()
 
void SetSinglePortRx (bool v=true)
 
bool IsSinglePortRx ()
 
void SetSinglePortTx (bool v=true)
 
bool IsSinglePortTx ()
 
void SetReducedSizeRTCP (bool v=true)
 
bool UseReducedSizeRTCP () const
 
bool IsAudio () const
 
void SetAudio (bool aud)
 
PString GetLabel () const
 
void SetLabel (const PString &name)
 
PString GetCanonicalName (RTP_SyncSourceId ssrc=0, Direction dir=e_Sender) const
 
void SetCanonicalName (const PString &name, RTP_SyncSourceId ssrc=0, Direction dir=e_Sender)
 
PString GetMediaStreamId (RTP_SyncSourceId ssrc, Direction dir) const
 
void SetMediaStreamId (const PString &id, RTP_SyncSourceId ssrc, Direction dir)
 
PString GetMediaTrackId (RTP_SyncSourceId ssrc, Direction dir) const
 
void SetMediaTrackId (const PString &id, RTP_SyncSourceId ssrc, Direction dir)
 
RTP_SyncSourceId GetRtxSyncSource (RTP_SyncSourceId ssrc, Direction dir, bool isPrimary) const
 
PString GetToolName () const
 
void SetToolName (const PString &name)
 
RTPHeaderExtensions GetHeaderExtensions () const
 
void SetHeaderExtensions (const RTPHeaderExtensions &ext)
 
bool AddHeaderExtension (const RTPHeaderExtensionInfo &ext)
 
RTP_SyncSourceId GetSyncSourceIn () const
 
RTP_SyncSourceId GetSyncSourceOut () const
 
void SetAnySyncSource (bool allow)
 
PINDEX GetMaxOutOfOrderPackets ()
 
void SetMaxOutOfOrderPackets (PINDEX packets)
 
const PTimeInterval & GetOutOfOrderWaitTime ()
 
void SetOutOfOrderWaitTime (const PTimeInterval &interval)
 
PTimeInterval GetReportTimeInterval ()
 
void SetReportTimeInterval (const PTimeInterval &interval)
 
unsigned GetTxStatisticsInterval ()
 
void SetTxStatisticsInterval (unsigned packets)
 
unsigned GetRxStatisticsInterval ()
 
void SetRxStatisticsInterval (unsigned packets)
 
virtual WORD GetLocalDataPort () const
 
virtual WORD GetLocalControlPort () const
 
unsigned GetPacketsSent (RTP_SyncSourceId ssrc=0) const
 
uint64_t GetOctetsSent (RTP_SyncSourceId ssrc=0) const
 
unsigned GetPacketsReceived (RTP_SyncSourceId ssrc=0) const
 
uint64_t GetOctetsReceived (RTP_SyncSourceId ssrc=0) const
 
unsigned GetPacketsLost (RTP_SyncSourceId ssrc=0) const
 
int GetPacketsLostByRemote (RTP_SyncSourceId ssrc=0) const
 
unsigned GetPacketsOutOfOrder (RTP_SyncSourceId ssrc=0) const
 
int GetAverageSendTime (RTP_SyncSourceId ssrc=0) const
 
unsigned GetMarkerRecvCount (RTP_SyncSourceId ssrc=0) const
 
unsigned GetMarkerSendCount (RTP_SyncSourceId ssrc=0) const
 
int GetMaximumSendTime (RTP_SyncSourceId ssrc=0) const
 
int GetMinimumSendTime (RTP_SyncSourceId ssrc=0) const
 
int GetAverageReceiveTime (RTP_SyncSourceId ssrc=0) const
 
int GetMaximumReceiveTime (RTP_SyncSourceId ssrc=0) const
 
int GetMinimumReceiveTime (RTP_SyncSourceId ssrc=0) const
 
int GetAvgJitterTime (RTP_SyncSourceId ssrc=0) const
 
int GetMaxJitterTime (RTP_SyncSourceId ssrc=0) const
 
int GetJitterTimeOnRemote (RTP_SyncSourceId ssrc=0) const
 
int GetRoundTripTime () const
 

Additional Inherited Members

- Public Types inherited from OpalMediaTransportChannelTypes
enum  SubChannels {
  e_AllSubChannels = -1, e_Media, e_Data = e_Media, e_Control,
  eSubChannelA, eSubChannelB, eSubChannelC, eSubChannelD,
  eMaxSubChannels
}
 

Detailed Description

This class is for encpsulating the IETF Real Time Protocol interface.

Member Typedef Documentation

typedef PNotifierTemplate<Data &> OpalRTPSession::DataNotifier

Member Enumeration Documentation

Enumerator
e_Receiver 
e_Sender 
Enumerator
e_RxFromNetwork 
e_RxOutOfOrder 
e_RxRetransmit 
e_RxFromRTX 
Enumerator
e_RewriteHeader 
e_RewriteSSRC 
e_RewriteNothing 
e_RetransmitFirst 
e_RetransmitAgain 
Enumerator
e_IgnorePacket 
e_AbortTransport 
e_ProcessPacket 

Constructor & Destructor Documentation

OpalRTPSession::OpalRTPSession ( const Init init)

Create a new RTP session.

OpalRTPSession::~OpalRTPSession ( )

Delete a session. This deletes the userData field if autoDeleteUserData is true.

Member Function Documentation

void OpalRTPSession::AddApplDefinedNotifier ( const ApplDefinedNotifier notifier)
inline
void OpalRTPSession::AddDataNotifier ( unsigned  priority,
const DataNotifier notifier,
RTP_SyncSourceId  ssrc = 0 
)

Set the notifier for received RTP data. Note an SSRC of zero usually means first SSRC, in this case it measn all SSRC's

virtual bool OpalRTPSession::AddGroup ( const PString &  groupId,
const PString &  mediaId,
bool  overwrite = true 
)
virtual

Set the "group" id for the RTP session. This is typically a mechanism for connecting audio and video together via BUNDLE.

Reimplemented from OpalMediaSession.

bool OpalRTPSession::AddHeaderExtension ( const RTPHeaderExtensionInfo ext)

Add the RTP header extension code to the session.

Returns
false if unsupported, or ID already present.
virtual RTP_SyncSourceId OpalRTPSession::AddSyncSource ( RTP_SyncSourceId  id,
Direction  dir,
const char *  cname = NULL 
)
virtual

Add a syncronisation source. If no call is made to this function, then the first sent/received RTP_DataFrame packet will set the SSRC for the session. if id is zero then a new random SSRC is generated.

Returns
SSRC that was added.
virtual void OpalRTPSession::AttachTransport ( const OpalMediaTransportPtr transport)
virtual

Attach an existing set of transport channels to media session.

Reimplemented from OpalMediaSession.

virtual bool OpalRTPSession::CheckControlSSRC ( RTP_SyncSourceId  senderSSRC,
RTP_SyncSourceId  targetSSRC,
SyncSource *&info   PTRACE_PARAM, const char *pduName 
)
protectedvirtual
virtual bool OpalRTPSession::Close ( )
virtual

Close the media session.

Reimplemented from OpalMediaSession.

virtual OpalMediaStream* OpalRTPSession::CreateMediaStream ( const OpalMediaFormat mediaFormat,
unsigned  sessionID,
bool  isSource 
)
virtual

Create an appropriate media stread for this media session.

Implements OpalMediaSession.

virtual OpalMediaTransport* OpalRTPSession::CreateMediaTransport ( const PString &  name)
protectedvirtual
virtual SyncSource* OpalRTPSession::CreateSyncSource ( RTP_SyncSourceId  id,
Direction  dir,
const char *  cname 
)
protectedvirtual
virtual OpalMediaTransportPtr OpalRTPSession::DetachTransport ( )
virtual

Detach the transport channels from the media session. Note that while the channels are not closed, the media session will be. Also note that the channel objects are now owned by the Transport PList so care must be take when removing them in such a way they are not deleted unexpectedly.

Reimplemented from OpalMediaSession.

RTP_SyncSourceId OpalRTPSession::EnableSyncSourceRtx ( RTP_SyncSourceId  primarySSRC,
RTP_DataFrame::PayloadTypes  rtxPT,
RTP_SyncSourceId  rtxSSRC 
)

Set the "rtx" SSRC to use for the given SSRC.

Returns
rtxSSRC or a newly allocated SSRC used for "rtx" packets. Zero on error.
Parameters
primarySSRCPrimary SSRC of data that can be retransmitted
rtxPTPayload type of retramitted packet
rtxSSRCSSRC of re-transmitted data, 0 indicates allocate new one
void OpalRTPSession::FinaliseSyncSourceRtx ( RTP_DataFrame::PayloadTypes  primaryPT,
RTP_DataFrame::PayloadTypes  rtxPT,
OpalRTPSession::Direction  dir 
)

Set the "rtx" SSRC to use for the given SSRC.

Returns
rtxSSRC or a newly allocated SSRC used for "rtx" packets. Zero on error.
Parameters
primaryPTPayload type of primary sync source
rtxPTPayload type of retransmiitted packet
dirMedia direction
static const PString& OpalRTPSession::GetAbsSendTimeHdrExtURI ( )
static
int OpalRTPSession::GetAverageReceiveTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get average time between received packets. This is averaged over the last rxStatisticsInterval packets and is in milliseconds. -1 indicated no packets received.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_averagePacketTime.

int OpalRTPSession::GetAverageSendTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get average time between sent packets. This is averaged over the last txStatisticsInterval packets and is in milliseconds. -1 indicated no packets sent.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_averagePacketTime.

int OpalRTPSession::GetAvgJitterTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get averaged jitter time for received packets. This is the calculated statistical variance of the interarrival time of received packets in milliseconds. -1 indicated no packets received.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_currentJitter.

PString OpalRTPSession::GetCanonicalName ( RTP_SyncSourceId  ssrc = 0,
Direction  dir = e_Sender 
) const

Get the canonical name for the RTP session.

OpalMediaTransport::CongestionControl* OpalRTPSession::GetCongestionControl ( )
protected
RTPHeaderExtensions OpalRTPSession::GetHeaderExtensions ( ) const

Get the RTP header extension codes for the session.

int OpalRTPSession::GetJitterTimeOnRemote ( RTP_SyncSourceId  ssrc = 0) const
inline

Get jitter time for received packets on remote. This is the calculated statistical variance of the interarrival time of received packets in milliseconds. -1 indicated no RTCP received.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_currentJitter.

PString OpalRTPSession::GetLabel ( ) const

Get the label for the RTP session.

const PTime& OpalRTPSession::GetLastSentNetTime ( RTP_SyncSourceId  ssrc = 0) const
inline
RTP_Timestamp OpalRTPSession::GetLastSentTimestamp ( RTP_SyncSourceId  ssrc = 0) const
inline
virtual OpalTransportAddress OpalRTPSession::GetLocalAddress ( bool  isMediaAddress = true) const
virtual

Get the local transport address used by this media session. The isMediaAddress can get an optional secondary channel address when false.

Reimplemented from OpalMediaSession.

virtual WORD OpalRTPSession::GetLocalControlPort ( ) const
virtual

Get local control port of session.

virtual WORD OpalRTPSession::GetLocalDataPort ( ) const
virtual

Get local data port of session.

virtual PString OpalRTPSession::GetLocalHostName ( )
virtual

Get the local host name as used in SDES packes.

unsigned OpalRTPSession::GetMarkerRecvCount ( RTP_SyncSourceId  ssrc = 0) const
inline

Get the number of marker packets received this session. This can be used to find out the number of frames received in a video RTP stream.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_markerCount.

unsigned OpalRTPSession::GetMarkerSendCount ( RTP_SyncSourceId  ssrc = 0) const
inline

Get the number of marker packets sent this session. This can be used to find out the number of frames sent in a video RTP stream.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_markerCount.

int OpalRTPSession::GetMaximumReceiveTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get maximum time between received packets. This is over the last rxStatisticsInterval packets and is in milliseconds. -1 indicated no packets received.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_maximumPacketTime.

int OpalRTPSession::GetMaximumSendTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get maximum time between sent packets. This is over the last txStatisticsInterval packets and is in milliseconds. -1 indicated no packets sent.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_maximumPacketTime.

int OpalRTPSession::GetMaxJitterTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get averaged jitter time for received packets. This is the maximum value of jitterLevel for the session. -1 indicated no packets received.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_maximumJitter.

PINDEX OpalRTPSession::GetMaxOutOfOrderPackets ( )
inline

Get the maximum out of order packets before flagging it missing.

References m_maxOutOfOrderPackets.

PString OpalRTPSession::GetMediaStreamId ( RTP_SyncSourceId  ssrc,
Direction  dir 
) const

Get the "MediaStream" id for the RTP session SSRC. See http://tools.ietf.org/html/draft-ietf-mmusic-msid-12

PString OpalRTPSession::GetMediaTrackId ( RTP_SyncSourceId  ssrc,
Direction  dir 
) const

Get the "MediaStreamTrack" id for the RTP session SSRC. See http://tools.ietf.org/html/draft-ietf-mmusic-msid-12

int OpalRTPSession::GetMinimumReceiveTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get minimum time between received packets. This is over the last rxStatisticsInterval packets and is in milliseconds. -1 indicated no packets received.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_minimumPacketTime.

int OpalRTPSession::GetMinimumSendTime ( RTP_SyncSourceId  ssrc = 0) const
inline

Get minimum time between sent packets. This is over the last txStatisticsInterval packets and is in milliseconds. -1 indicated no packets sent.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_minimumPacketTime.

uint64_t OpalRTPSession::GetOctetsReceived ( RTP_SyncSourceId  ssrc = 0) const
inline

Get total number of octets received in session.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_octets.

uint64_t OpalRTPSession::GetOctetsSent ( RTP_SyncSourceId  ssrc = 0) const
inline

Get total number of octets sent in session.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_octets.

const PTimeInterval& OpalRTPSession::GetOutOfOrderWaitTime ( )
inline

Get the maximum time to wait for an out of order packet before flagging it missing.

References m_waitOutOfOrderTime.

unsigned OpalRTPSession::GetPacketsLost ( RTP_SyncSourceId  ssrc = 0) const
inline

Get total number received packets lost in session.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_packetsUnrecovered.

int OpalRTPSession::GetPacketsLostByRemote ( RTP_SyncSourceId  ssrc = 0) const
inline

Get total number transmitted packets lost by remote in session. Determined via RTCP. -1 indicates no RTCP received yet.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_packetsMissing.

unsigned OpalRTPSession::GetPacketsOutOfOrder ( RTP_SyncSourceId  ssrc = 0) const
inline

Get total number of packets received out of order in session.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_packetsOutOfOrder.

unsigned OpalRTPSession::GetPacketsReceived ( RTP_SyncSourceId  ssrc = 0) const
inline

Get total number of packets received in session.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_packets.

unsigned OpalRTPSession::GetPacketsSent ( RTP_SyncSourceId  ssrc = 0) const
inline

Get total number of packets sent in session.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_packets.

virtual OpalTransportAddress OpalRTPSession::GetRemoteAddress ( bool  isMediaAddress = true) const
virtual

Get the remote transport address used by this media session. The isMediaAddress can get an optional secondary channel address when false.

Reimplemented from OpalMediaSession.

PTimeInterval OpalRTPSession::GetReportTimeInterval ( )
inline

Get the time interval for sending RTCP reports in the session.

References m_reportTimer.

int OpalRTPSession::GetRoundTripTime ( ) const

Get round trip time to remote. This is calculated according to the RFC 3550 algorithm.

RTP_SyncSourceId OpalRTPSession::GetRtxSyncSource ( RTP_SyncSourceId  ssrc,
Direction  dir,
bool  isPrimary 
) const

Get the SSRC for the secondary rtx packets. If primary is true then ssrc is a primary SSRC and the function returns the SSRC that is being used for "rtx" packets. When false, ssrc is expected to be an "rtx" SSRC and the function returns the SSRC used for primary data.

Returns
zero if ssrc does not exist or is not the expected type.
Parameters
ssrcSSRC to get value for
dirDirection of media, if ssrc == 0
isPrimaryThe ssrc is a primary and we are getting "rtx" SSRC
unsigned OpalRTPSession::GetRxStatisticsInterval ( )
inline

Get the interval for receiver statistics in the session.

References m_rxStatisticsInterval.

virtual const PCaselessString& OpalRTPSession::GetSessionType ( ) const
inlinevirtual

Get the session type string (for factory).

Implements OpalMediaSession.

References RTP_AVP().

virtual void OpalRTPSession::GetStatistics ( OpalMediaStatistics statistics,
Direction  dir 
) const
virtual
virtual bool OpalRTPSession::GetSyncSource ( RTP_SyncSourceId  ssrc,
Direction  dir,
SyncSource *&  info 
)
protectedvirtual
RTP_SyncSourceId OpalRTPSession::GetSyncSourceIn ( ) const
inline

Get the source identifier for remote data to us.

References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_sourceIdentifier.

RTP_SyncSourceId OpalRTPSession::GetSyncSourceOut ( ) const
inline

Get the source identifier for our data to the remote.

References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_sourceIdentifier.

RTP_SyncSourceArray OpalRTPSession::GetSyncSources ( Direction  dir) const

Get the all source identifiers.

PString OpalRTPSession::GetToolName ( ) const

Get the tool name for the RTP session.

static const PString& OpalRTPSession::GetTransportWideSeqNumHdrExtURI ( )
static
unsigned OpalRTPSession::GetTxStatisticsInterval ( )
inline

Get the interval for transmitter statistics in the session.

References m_txStatisticsInterval.

bool OpalRTPSession::HasFeedback ( OpalMediaFormat::RTCPFeedback  feature) const
inline
virtual void OpalRTPSession::InitialiseControlFrame ( RTP_ControlFrame frame,
SyncSource sender 
)
protectedvirtual
void OpalRTPSession::InternalAttachTransport ( const OpalMediaTransportPtr &transport   PTRACE_PARAM, const char *from)
protected
virtual bool OpalRTPSession::InternalSendReport ( RTP_ControlFrame report,
SyncSource sender,
bool  includeReceivers,
bool  forced,
const PTime &  now 
)
protectedvirtual

Set up RTCP as per RFC rules.

bool OpalRTPSession::InternalSetQoS ( const PIPSocket::QoS &  qos)
protected
bool OpalRTPSession::IsAudio ( ) const
inline

Get flag for is audio RTP.

References m_isAudio.

virtual bool OpalRTPSession::IsEncrypted ( ) const
inlinevirtual
bool OpalRTPSession::IsSinglePortRx ( )
inline

Get flag for single port receive.

References m_singlePortRx.

bool OpalRTPSession::IsSinglePortTx ( )
inline

Get flag for single port transmit.

References m_singlePortTx.

virtual SendReceiveStatus OpalRTPSession::OnPreReceiveData ( RTP_DataFrame frame,
const PTime &  now 
)
virtual
virtual SendReceiveStatus OpalRTPSession::OnReceiveControl ( RTP_ControlFrame frame,
const PTime &  now 
)
virtual
virtual SendReceiveStatus OpalRTPSession::OnReceiveData ( RTP_DataFrame frame,
ReceiveType  rxType,
const PTime &  now 
)
virtual
virtual bool OpalRTPSession::OnReceiveExtendedReports ( const RTP_ControlFrame frame,
const PTime &  now 
)
virtual
virtual void OpalRTPSession::OnRxApplDefined ( const RTP_ControlFrame::ApplDefinedInfo info)
virtual
virtual void OpalRTPSession::OnRxDelayLastReceiverReport ( const RTP_DelayLastReceiverReport dlrr,
const PTime &  now 
)
virtual
virtual void OpalRTPSession::OnRxGoodbye ( const RTP_SyncSourceArray sources,
const PString &  reason 
)
virtual
virtual void OpalRTPSession::OnRxNACK ( RTP_SyncSourceId  ssrc,
const RTP_ControlFrame::LostPacketMask lostPackets,
const PTime &  now 
)
virtual
virtual void OpalRTPSession::OnRxReceiverReferenceTimeReport ( RTP_SyncSourceId  ssrc,
const PTime &  ntp,
const PTime &  now 
)
virtual
virtual void OpalRTPSession::OnRxReceiverReport ( RTP_SyncSourceId  src,
const RTP_ControlFrame::ReceiverReport rr 
)
virtual
virtual void OpalRTPSession::OnRxReceiverReport ( RTP_SyncSourceId  src,
const RTP_ReceiverReport report 
)
virtual
virtual void OpalRTPSession::OnRxReceiverReports ( RTP_SyncSourceId  src,
const RTP_ControlFrame::ReceiverReport rr,
unsigned  count,
const PTime &  now 
)
virtual
virtual void OpalRTPSession::OnRxReceiverReports ( RTP_SyncSourceId  src,
const std::vector< RTP_ReceiverReport > &  reports 
)
virtual
virtual void OpalRTPSession::OnRxSenderReport ( const RTP_SenderReport sender,
const PTime &  now 
)
virtual
virtual void OpalRTPSession::OnRxSourceDescription ( const RTP_SourceDescriptionArray descriptions)
virtual
virtual void OpalRTPSession::OnRxTWCC ( const RTP_TransportWideCongestionControl twcc)
virtual
virtual SendReceiveStatus OpalRTPSession::OnSendControl ( RTP_ControlFrame frame,
const PTime &  now 
)
virtual
virtual SendReceiveStatus OpalRTPSession::OnSendData ( RewriteMode rewrite,
RTP_DataFrame frame,
const PTime &  now 
)
virtual
virtual bool OpalRTPSession::Open ( const PString &  localInterface,
const OpalTransportAddress remoteAddress 
)
virtual

Open the media session.

Implements OpalMediaSession.

OpalRTPSession::PDECLARE_MediaReadNotifier ( OpalRTPSession  ,
OnRxDataPacket   
)
protected
OpalRTPSession::PDECLARE_MediaReadNotifier ( OpalRTPSession  ,
OnRxControlPacket   
)
protected
OpalRTPSession::PDECLARE_NOTIFIER ( PTimer  ,
OpalRTPSession  ,
TimedSendReport   
)
protected
OpalRTPSession::PTRACE_THROTTLE ( m_throttleTxReport  ,
,
60000  ,
 
)
protected
OpalRTPSession::PTRACE_THROTTLE ( m_throttleRxEmptyRR  ,
,
60000   
)
protected
OpalRTPSession::PTRACE_THROTTLE ( m_throttleRxSDES  ,
,
60000   
)
protected
void OpalRTPSession::RemoveApplDefinedNotifier ( const ApplDefinedNotifier notifier)
inline
void OpalRTPSession::RemoveDataNotifier ( const DataNotifier notifier,
RTP_SyncSourceId  ssrc = 0 
)

Remove the data notifier.

virtual bool OpalRTPSession::RemoveSyncSource ( RTP_SyncSourceId  id)
virtual

Remove the synchronisation source.

virtual bool OpalRTPSession::ResequenceOutOfOrderPackets ( SyncSource ssrc) const
protectedvirtual
static const PCaselessString& OpalRTPSession::RTP_AVP ( )
static

Referenced by GetSessionType().

static const PCaselessString& OpalRTPSession::RTP_AVPF ( )
static
virtual SendReceiveStatus OpalRTPSession::SendBYE ( RTP_SyncSourceId  ssrc = 0)
virtual

Send BYE command.

virtual SendReceiveStatus OpalRTPSession::SendFlowControl ( unsigned  maxBitRate,
unsigned  overhead = 0,
bool  notify = false,
RTP_SyncSourceId  ssrc = 0 
)
virtual

Send flow control Request/Notification. This uses Temporary Maximum Media Stream Bit Rate from RFC 5104. If notify is false, and TMMBR is not available, and the Google specific REMB is available, that is sent instead.

Parameters
maxBitRateNew temporary maximum bit rate
overheadProtocol overhead, defaults to IP/UDP/RTP header size
notifySend request/notification
virtual SendReceiveStatus OpalRTPSession::SendIntraFrameRequest ( unsigned  options,
RTP_SyncSourceId  ssrc = 0,
const PTime &  now = PTime() 
)
virtual

Tell the rtp session to send out an intra frame request control packet. This is called when the media stream receives an OpalVideoUpdatePicture media command.

virtual SendReceiveStatus OpalRTPSession::SendNACK ( const RTP_ControlFrame::LostPacketMask lostPackets,
RTP_SyncSourceId  ssrc = 0 
)
virtual

Send NACK RTCP command.

virtual SendReceiveStatus OpalRTPSession::SendReport ( RTP_SyncSourceId  ssrc,
bool  force,
const PTime &  now = PTime() 
)
virtual

Send a report to remote.

Parameters
ssrcZero means all senders, not just first.
forceSend even if no packets sent yet
virtual SendReceiveStatus OpalRTPSession::SendTemporalSpatialTradeOff ( unsigned  tradeOff,
RTP_SyncSourceId  ssrc = 0 
)
virtual

Tell the rtp session to send out an temporal spatial trade off request control packet. This is called when the media stream receives an OpalTemporalSpatialTradeOff media command.

virtual SendReceiveStatus OpalRTPSession::SendTWCC ( const RTP_TransportWideCongestionControl twcc)
virtual

Send Transport Wide Congestion Control RTCP command.

void OpalRTPSession::SessionFailed ( SubChannels subchannel   PTRACE_PARAM, const char *reason)
protected
void OpalRTPSession::SetAnySyncSource ( bool  allow)

Indicate if will ignore all but first received SSRC value.

Parameters
allowFlag for allow any SSRC values
void OpalRTPSession::SetAudio ( bool  aud)
inline

Set flag for RTP session is audio.

Parameters
audNew audio indication flag

References m_isAudio.

void OpalRTPSession::SetCanonicalName ( const PString &  name,
RTP_SyncSourceId  ssrc = 0,
Direction  dir = e_Sender 
)

Set the canonical name for the RTP session.

void OpalRTPSession::SetHeaderExtensions ( const RTPHeaderExtensions ext)

Set the RTP header extension codes for the session.

void OpalRTPSession::SetJitterBuffer ( OpalJitterBuffer jitterBuffer,
RTP_SyncSourceId  ssrc = 0 
)

Set the jitter buffer to get certain RTCP statustics from.

void OpalRTPSession::SetLabel ( const PString &  name)

Set the label for the RTP session.

void OpalRTPSession::SetMaxOutOfOrderPackets ( PINDEX  packets)

Set the maximum out of order packets before flagging it missing.

Parameters
packetsNumber of packets.
void OpalRTPSession::SetMediaStreamId ( const PString &  id,
RTP_SyncSourceId  ssrc,
Direction  dir 
)

Set the "MediaStream" id for the RTP session SSRC. See http://tools.ietf.org/html/draft-ietf-mmusic-msid-12

void OpalRTPSession::SetMediaTrackId ( const PString &  id,
RTP_SyncSourceId  ssrc,
Direction  dir 
)

Set the "MediaStreamTrack" id for the RTP session SSRC. See http://tools.ietf.org/html/draft-ietf-mmusic-msid-12

void OpalRTPSession::SetOutOfOrderWaitTime ( const PTimeInterval &  interval)
inline

Set the maximum time to wait for an out of order packet before flagging it missing.

Parameters
intervalNew time interval for reports.

References m_waitOutOfOrderTime.

void OpalRTPSession::SetReducedSizeRTCP ( bool  v = true)
inline

Set flag for RFC5506 reduced size RTCP.

References m_reducedSizeRTCP.

virtual bool OpalRTPSession::SetRemoteAddress ( const OpalTransportAddress remoteAddress,
bool  isMediaAddress = true 
)
virtual

Set the remote transport address used by this media session. The isMediaAddress can get an optional secondary channel address when false.

Reimplemented from OpalMediaSession.

void OpalRTPSession::SetReportTimeInterval ( const PTimeInterval &  interval)
inline

Set the time interval for sending RTCP reports in the session.

Parameters
intervalNew time interval for reports.

References m_reportTimer.

void OpalRTPSession::SetRxStatisticsInterval ( unsigned  packets)
inline

Set the interval for receiver statistics in the session.

Parameters
packetsNumber of packets between callbacks

References m_rxStatisticsInterval.

void OpalRTPSession::SetSinglePortRx ( bool  v = true)

Set flag for single port receive. This must be done before Open() is called to take effect.

void OpalRTPSession::SetSinglePortTx ( bool  v = true)

Set flag for single port transmit.

void OpalRTPSession::SetToolName ( const PString &  name)

Set the tool name for the RTP session.

void OpalRTPSession::SetTxStatisticsInterval ( unsigned  packets)
inline

Set the interval for transmitter statistics in the session.

Parameters
packetsNumber of packets between callbacks

References m_txStatisticsInterval.

virtual bool OpalRTPSession::UpdateMediaFormat ( const OpalMediaFormat mediaFormat)
virtual

Update media stream with media options contained in the media format.

Reimplemented from OpalMediaSession.

bool OpalRTPSession::UseReducedSizeRTCP ( ) const
inline

Get flag for RFC5506 reduced size RTCP.

References m_reducedSizeRTCP.

virtual SyncSource* OpalRTPSession::UseSyncSource ( RTP_SyncSourceId  ssrc,
Direction  dir,
bool  force 
)
protectedvirtual
virtual SendReceiveStatus OpalRTPSession::WriteControl ( RTP_ControlFrame frame,
const PIPSocketAddressAndPort *  remote = NULL 
)
virtual

Write a control frame from the RTP channel.

Parameters
frameFrame to write to the RTP session
remoteAlternate address to transmit control frame
virtual SendReceiveStatus OpalRTPSession::WriteData ( RTP_DataFrame frame,
RewriteMode  rewrite = e_RewriteHeader,
const PIPSocketAddressAndPort *  remote = NULL,
const PTime &  now = PTime() 
)
virtual

Write a data frame from the RTP channel.

Parameters
frameFrame to write to the RTP session
rewriteIndicate what headers are to be rewritten
remoteAlternate address to transmit data frame

Friends And Related Function Documentation

friend class RTCP_XR_Metrics
friend
friend struct SyncSource
friend

Field Documentation

unsigned OpalRTPSession::m_absSendTimeHdrExtId
protected
ApplDefinedNotifierList OpalRTPSession::m_applDefinedNotifiers
protected
OpalMediaTransport::ReadNotifier OpalRTPSession::m_controlNotifier
protected
OpalMediaTransport::ReadNotifier OpalRTPSession::m_dataNotifier
protected
atomic<RTP_SyncSourceId> OpalRTPSession::m_defaultSSRC[2]
protected
SyncSource OpalRTPSession::m_dummySyncSource
protected
OpalRTPEndPoint& OpalRTPSession::m_endpoint
protected
OpalMediaFormat::RTCPFeedback OpalRTPSession::m_feedback
protected

Referenced by HasFeedback().

RTPHeaderExtensions OpalRTPSession::m_headerExtensions
protected
bool OpalRTPSession::m_isAudio
protected

Referenced by IsAudio(), and SetAudio().

OpalJitterBuffer* OpalRTPSession::m_jitterBuffer
protected
PString OpalRTPSession::m_label
protected
OpalManager& OpalRTPSession::m_manager
protected
PINDEX OpalRTPSession::m_maxOutOfOrderPackets
protected

Referenced by GetMaxOutOfOrderPackets().

NotifierMap OpalRTPSession::m_notifiers
protected
unsigned OpalRTPSession::m_packetOverhead
protected
PIPSocket::QoS OpalRTPSession::m_qos
protected
bool OpalRTPSession::m_reducedSizeRTCP
protected
WORD OpalRTPSession::m_remoteControlPort
protected
PTimer OpalRTPSession::m_reportTimer
protected
int OpalRTPSession::m_roundTripTime
protected
unsigned OpalRTPSession::m_rtcpPacketsReceived
protected
unsigned OpalRTPSession::m_rtcpPacketsSent
protected
unsigned OpalRTPSession::m_rxStatisticsInterval
protected
bool OpalRTPSession::m_sendEstablished
protected
bool OpalRTPSession::m_singlePortRx
protected

Referenced by IsSinglePortRx().

bool OpalRTPSession::m_singlePortTx
protected

Referenced by IsSinglePortTx().

SyncSourceMap OpalRTPSession::m_SSRC
protected
PTimeInterval OpalRTPSession::m_staleReceiverTimeout
protected
unsigned OpalRTPSession::m_timeUnits
protected
PString OpalRTPSession::m_toolName
protected
unsigned OpalRTPSession::m_transportWideSeqNumHdrExtId
protected
unsigned OpalRTPSession::m_txStatisticsInterval
protected
PTimeInterval OpalRTPSession::m_waitOutOfOrderTime
protected

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