OPAL
Version 3.18.8
|
#include <rtp_session.h>
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 OpalMediaStream * | CreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource) |
![]() | |
~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 OpalMediaCryptoKeyList & | GetOfferedCryptoKeys () |
virtual bool | ApplyCryptoKey (OpalMediaCryptoKeyList &keys, bool rx) |
virtual OpalMediaCryptoKeyInfo * | IsCryptoSecured (bool rx) const |
OpalConnection & | GetConnection () const |
unsigned | GetSessionID () const |
const OpalMediaType & | GetMediaType () 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 const PString & | GetBundleGroupId () |
Protected Types | |
typedef std::map < RTP_SyncSourceId, SyncSource * > | SyncSourceMap |
Protected Member Functions | |
virtual OpalMediaTransport * | CreateMediaTransport (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 SyncSource & | GetSyncSource (RTP_SyncSourceId ssrc, Direction dir) const |
virtual bool | GetSyncSource (RTP_SyncSourceId ssrc, Direction dir, SyncSource *&info) |
virtual SyncSource * | UseSyncSource (RTP_SyncSourceId ssrc, Direction dir, bool force) |
virtual SyncSource * | CreateSyncSource (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::CongestionControl * | GetCongestionControl () |
PTRACE_THROTTLE (m_throttleTxReport, 3, 60000, 5) | |
PTRACE_THROTTLE (m_throttleRxEmptyRR, 3, 60000) | |
PTRACE_THROTTLE (m_throttleRxSDES, 4, 60000) | |
![]() | |
OpalMediaSession (const Init &init) | |
Friends | |
struct | SyncSource |
class | RTCP_XR_Metrics |
Additional Inherited Members | |
![]() | |
enum | SubChannels { e_AllSubChannels = -1, e_Media, e_Data = e_Media, e_Control, eSubChannelA, eSubChannelB, eSubChannelC, eSubChannelD, eMaxSubChannels } |
This class is for encpsulating the IETF Real Time Protocol interface.
typedef PNotifierTemplate<const RTP_ControlFrame::ApplDefinedInfo &> OpalRTPSession::ApplDefinedNotifier |
typedef PNotifierListTemplate<const RTP_ControlFrame::ApplDefinedInfo &> OpalRTPSession::ApplDefinedNotifierList |
typedef PNotifierTemplate<Data &> OpalRTPSession::DataNotifier |
|
protected |
OpalRTPSession::OpalRTPSession | ( | const Init & | init | ) |
Create a new RTP session.
OpalRTPSession::~OpalRTPSession | ( | ) |
Delete a session. This deletes the userData field if autoDeleteUserData is true.
|
inline |
References m_applDefinedNotifiers.
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 |
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.
|
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.
|
virtual |
Attach an existing set of transport channels to media session.
Reimplemented from OpalMediaSession.
|
protectedvirtual |
|
virtual |
Close the media session.
Reimplemented from OpalMediaSession.
|
virtual |
Create an appropriate media stread for this media session.
Implements OpalMediaSession.
|
protectedvirtual |
|
protectedvirtual |
|
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.
primarySSRC | Primary SSRC of data that can be retransmitted |
rtxPT | Payload type of retramitted packet |
rtxSSRC | SSRC 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.
primaryPT | Payload type of primary sync source |
rtxPT | Payload type of retransmiitted packet |
dir | Media direction |
|
static |
|
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.
|
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.
|
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.
|
protected |
RTPHeaderExtensions OpalRTPSession::GetHeaderExtensions | ( | ) | const |
Get the RTP header extension codes for the session.
|
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.
|
inline |
References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_lastPacketNetTime.
|
inline |
References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_lastPacketTimestamp.
|
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 |
Get local control port of session.
|
virtual |
Get local data port of session.
|
virtual |
Get the local host name as used in SDES packes.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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
|
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.
|
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.
|
inline |
Get total number of octets received in session.
References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_octets.
|
inline |
Get total number of octets sent in session.
References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_octets.
|
inline |
Get the maximum time to wait for an out of order packet before flagging it missing.
References m_waitOutOfOrderTime.
|
inline |
Get total number received packets lost in session.
References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_packetsUnrecovered.
|
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.
|
inline |
Get total number of packets received out of order in session.
References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_packetsOutOfOrder.
|
inline |
Get total number of packets received in session.
References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_packets.
|
inline |
Get total number of packets sent in session.
References e_Sender, GetSyncSource(), and OpalRTPSession::SyncSource::m_packets.
|
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.
|
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.
ssrc
does not exist or is not the expected type. ssrc | SSRC to get value for |
dir | Direction of media, if ssrc == 0 |
isPrimary | The ssrc is a primary and we are getting "rtx" SSRC |
|
inline |
Get the interval for receiver statistics in the session.
References m_rxStatisticsInterval.
|
inlinevirtual |
|
virtual |
|
protected |
Referenced by GetAverageReceiveTime(), GetAverageSendTime(), GetAvgJitterTime(), GetJitterTimeOnRemote(), GetLastSentNetTime(), GetLastSentTimestamp(), GetMarkerRecvCount(), GetMarkerSendCount(), GetMaximumReceiveTime(), GetMaximumSendTime(), GetMaxJitterTime(), GetMinimumReceiveTime(), GetMinimumSendTime(), GetOctetsReceived(), GetOctetsSent(), GetPacketsLost(), GetPacketsLostByRemote(), GetPacketsOutOfOrder(), GetPacketsReceived(), GetPacketsSent(), GetSyncSourceIn(), and GetSyncSourceOut().
|
protectedvirtual |
|
inline |
Get the source identifier for remote data to us.
References e_Receiver, GetSyncSource(), and OpalRTPSession::SyncSource::m_sourceIdentifier.
|
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 |
|
inline |
Get the interval for transmitter statistics in the session.
References m_txStatisticsInterval.
|
inline |
References m_feedback.
Referenced by OpalRTPSession::SyncSource::IsNackEnabled().
|
protectedvirtual |
|
protected |
|
protectedvirtual |
Set up RTCP as per RFC rules.
|
protected |
|
inline |
Get flag for is audio RTP.
References m_isAudio.
|
inlinevirtual |
|
inline |
Get flag for single port receive.
References m_singlePortRx.
|
inline |
Get flag for single port transmit.
References m_singlePortTx.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Open the media session.
Implements OpalMediaSession.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
References m_applDefinedNotifiers.
void OpalRTPSession::RemoveDataNotifier | ( | const DataNotifier & | notifier, |
RTP_SyncSourceId | ssrc = 0 |
||
) |
Remove the data notifier.
|
virtual |
Remove the synchronisation source.
|
protectedvirtual |
|
static |
Referenced by GetSessionType().
|
static |
|
virtual |
Send BYE command.
|
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.
maxBitRate | New temporary maximum bit rate |
overhead | Protocol overhead, defaults to IP/UDP/RTP header size |
notify | Send request/notification |
|
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 |
Send NACK RTCP command.
|
virtual |
Send a report to remote.
ssrc | Zero means all senders, not just first. |
force | Send even if no packets sent yet |
|
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 |
Send Transport Wide Congestion Control RTCP command.
|
protected |
void OpalRTPSession::SetAnySyncSource | ( | bool | allow | ) |
Indicate if will ignore all but first received SSRC value.
allow | Flag for allow any SSRC values |
|
inline |
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.
packets | Number 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
|
inline |
Set the maximum time to wait for an out of order packet before flagging it missing.
interval | New time interval for reports. |
References m_waitOutOfOrderTime.
|
inline |
Set flag for RFC5506 reduced size RTCP.
References m_reducedSizeRTCP.
|
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.
|
inline |
Set the time interval for sending RTCP reports in the session.
interval | New time interval for reports. |
References m_reportTimer.
|
inline |
Set the interval for receiver statistics in the session.
packets | Number 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.
|
inline |
Set the interval for transmitter statistics in the session.
packets | Number of packets between callbacks |
References m_txStatisticsInterval.
|
virtual |
Update media stream with media options contained in the media format.
Reimplemented from OpalMediaSession.
|
inline |
Get flag for RFC5506 reduced size RTCP.
References m_reducedSizeRTCP.
|
protectedvirtual |
|
virtual |
Write a control frame from the RTP channel.
frame | Frame to write to the RTP session |
remote | Alternate address to transmit control frame |
|
virtual |
Write a data frame from the RTP channel.
frame | Frame to write to the RTP session |
rewrite | Indicate what headers are to be rewritten |
remote | Alternate address to transmit data frame |
|
friend |
|
friend |
|
protected |
|
protected |
Referenced by AddApplDefinedNotifier(), and RemoveApplDefinedNotifier().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by HasFeedback().
|
protected |
|
protected |
Referenced by IsAudio(), and SetAudio().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetMaxOutOfOrderPackets().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by SetReducedSizeRTCP(), and UseReducedSizeRTCP().
|
protected |
|
protected |
Referenced by GetReportTimeInterval(), and SetReportTimeInterval().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetRxStatisticsInterval(), and SetRxStatisticsInterval().
|
protected |
|
protected |
Referenced by IsSinglePortRx().
|
protected |
Referenced by IsSinglePortTx().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetTxStatisticsInterval(), and SetTxStatisticsInterval().
|
protected |
Referenced by GetOutOfOrderWaitTime(), and SetOutOfOrderWaitTime().