OPAL
Version 3.14.3
|
#include <rtp_session.h>
Data Structures | |
class | ReceiverReport |
class | SenderReport |
class | SourceDescription |
Public Types | |
typedef PNotifierTemplate < SendReceiveStatus & > | FilterNotifier |
![]() | |
typedef PList< PChannel > | Transport |
Public Member Functions | |
virtual void | SetCloseOnBYE (bool v) |
virtual void | SendFlowControl (unsigned maxBitRate, unsigned overhead=0, bool notify=false) |
virtual void | SendIntraFrameRequest (bool rfc2032, bool pictureLoss) |
virtual void | SendTemporalSpatialTradeOff (unsigned tradeOff) |
void | SetNextSentSequenceNumber (WORD num) |
DWORD | GetLastSentTimestamp () const |
const PTimeInterval & | GetLastSentPacketTime () const |
DWORD | GetSyncSourceIn () const |
void | AddFilter (const FilterNotifier &filter) |
virtual void | SendBYE () |
bool | SetQoS (const PIPSocket::QoS &qos) |
Construction | |
OpalRTPSession (const Init &init) | |
~OpalRTPSession () | |
Overrides from class OpalMediaSession | |
virtual const PCaselessString & | GetSessionType () const |
virtual bool | Open (const PString &localInterface, const OpalTransportAddress &remoteAddress, bool isMediaAddress) |
virtual bool | IsOpen () const |
virtual bool | Close () |
virtual bool | Shutdown (bool reading) |
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 (Transport &transport) |
virtual Transport | DetachTransport () |
virtual OpalMediaStream * | CreateMediaStream (const OpalMediaFormat &mediaFormat, unsigned sessionID, bool isSource) |
Operations | |
bool | SetJitterBufferSize (const OpalJitterBuffer::Init &init) |
unsigned | GetJitterBufferSize () const |
unsigned | GetJitterBufferDelay () const |
unsigned | GetJitterTimeUnits () const |
virtual bool | ReadData (RTP_DataFrame &frame) |
virtual bool | WriteData (RTP_DataFrame &frame, const PIPSocketAddressAndPort *remote=NULL, bool rewriteHeader=true) |
void | SendReport (bool force) |
virtual bool | WriteControl (RTP_ControlFrame &frame, const PIPSocketAddressAndPort *remote=NULL) |
virtual void | Restart (bool isReading) |
virtual PString | GetLocalHostName () |
virtual void | GetStatistics (OpalMediaStatistics &statistics, bool receiver) const |
![]() | |
void | OfferCryptoSuite (const PString &cryptoSuite) |
virtual OpalMediaCryptoKeyList & | GetOfferedCryptoKeys () |
virtual bool | ApplyCryptoKey (OpalMediaCryptoKeyList &keys, bool rx) |
virtual bool | IsCryptoSecured (bool rx) const |
OpalConnection & | GetConnection () const |
unsigned | GetSessionID () const |
const OpalMediaType & | GetMediaType () const |
const PString & | GetLocalUsername () const |
const PString & | GetLocalPassword () const |
virtual void | SetRemoteUserPass (const PString &user, const PString &pass) |
Static Public Member Functions | |
static const PCaselessString & | RTP_AVP () |
static const PCaselessString & | RTP_AVPF () |
Protected Types | |
typedef PSafePtr < OpalJitterBuffer, PSafePtrMultiThreaded > | JitterBufferPtr |
Protected Member Functions | |
ReceiverReportArray | BuildReceiverReportArray (const RTP_ControlFrame &frame, PINDEX offset) |
void | AddReceiverReport (RTP_ControlFrame::ReceiverReport &receiver) |
bool | InitialiseControlFrame (RTP_ControlFrame &report) |
virtual SendReceiveStatus | ReadDataPDU (RTP_DataFrame &frame) |
virtual SendReceiveStatus | OnReadTimeout (RTP_DataFrame &frame) |
virtual bool | InternalReadData (RTP_DataFrame &frame) |
virtual SendReceiveStatus | ReadControlPDU () |
virtual SendReceiveStatus | ReadRawPDU (BYTE *framePtr, PINDEX &frameSize, bool fromDataChannel) |
virtual bool | HandleUnreachable (PTRACE_PARAM(const char *channelName)) |
virtual bool | WriteRawPDU (const BYTE *framePtr, PINDEX frameSize, bool toDataChannel, const PIPSocketAddressAndPort *remote=NULL) |
void | SaveOutOfOrderPacket (RTP_DataFrame &frame) |
PDECLARE_NOTIFIER (PTimer, OpalRTPSession, TimedSendReport) | |
![]() | |
OpalMediaSession (const Init &init) | |
Friends | |
class | RTP_JitterBuffer |
Call back functions | |
enum | SendReceiveStatus { e_ProcessPacket, e_IgnorePacket, e_AbortTransport } |
typedef PNotifierListTemplate < const RTP_ControlFrame::ApplDefinedInfo & > | ApplDefinedNotifierList |
typedef PNotifierTemplate < const RTP_ControlFrame::ApplDefinedInfo & > | ApplDefinedNotifier |
virtual SendReceiveStatus | OnSendData (RTP_DataFrame &frame, bool rewriteHeader) |
virtual SendReceiveStatus | OnSendControl (RTP_ControlFrame &frame) |
virtual SendReceiveStatus | OnReceiveData (RTP_DataFrame &frame, PINDEX pduSize) |
virtual SendReceiveStatus | OnReceiveData (RTP_DataFrame &frame) |
virtual SendReceiveStatus | OnReceiveControl (RTP_ControlFrame &frame) |
PARRAY (ReceiverReportArray, ReceiverReport) | |
virtual void | OnRxSenderReport (const SenderReport &sender, const ReceiverReportArray &reports) |
virtual void | OnRxReceiverReport (DWORD src, const ReceiverReportArray &reports) |
virtual void | OnReceiverReports (const ReceiverReportArray &reports) |
PARRAY (SourceDescriptionArray, SourceDescription) | |
virtual void | OnRxSourceDescription (const SourceDescriptionArray &descriptions) |
virtual void | OnRxGoodbye (const PDWORDArray &sources, const PString &reason) |
virtual void | OnRxApplDefined (const RTP_ControlFrame::ApplDefinedInfo &info) |
void | AddApplDefinedNotifier (const ApplDefinedNotifier ¬ifier) |
void | RemoveApplDefinedNotifier (const ApplDefinedNotifier ¬ifier) |
Member variable access | |
enum | { JitterRoundingGuardBits = 4 } |
void | SetSinglePort (bool v=true) |
bool | IsAudio () const |
void | SetAudio (bool aud) |
PString | GetCanonicalName () const |
void | SetCanonicalName (const PString &name) |
PString | GetGroupId () const |
void | SetGroupId (const PString &id) |
PString | GetToolName () const |
void | SetToolName (const PString &name) |
RTPExtensionHeaders | GetExtensionHeaders () const |
void | SetExtensionHeader (const RTPExtensionHeaders &ext) |
DWORD | GetSyncSourceOut () const |
bool | AllowAnySyncSource () const |
void | SetAnySyncSource (bool allow) |
void | SetIgnorePayloadTypeChanges (bool ignore) |
const PTimeInterval & | GetMaxNoReceiveTime () |
void | SetMaxNoReceiveTime (const PTimeInterval &interval) |
const PTimeInterval & | GetMaxNoTransmitTime () |
void | SetMaxNoTransmitTime (const PTimeInterval &interval) |
PTimeInterval | GetReportTimeInterval () |
void | SetReportTimeInterval (const PTimeInterval &interval) |
unsigned | GetTxStatisticsInterval () |
void | SetTxStatisticsInterval (unsigned packets) |
unsigned | GetRxStatisticsInterval () |
void | SetRxStatisticsInterval (unsigned packets) |
void | ClearStatistics () |
virtual WORD | GetLocalDataPort () const |
virtual WORD | GetLocalControlPort () const |
virtual WORD | GetRemoteDataPort () const |
virtual WORD | GetRemoteControlPort () const |
virtual PUDPSocket & | GetDataSocket () |
virtual PUDPSocket & | GetControlSocket () |
DWORD | GetPacketsSent () const |
DWORD | GetOctetsSent () const |
DWORD | GetPacketsReceived () const |
DWORD | GetOctetsReceived () const |
DWORD | GetPacketsLost () const |
DWORD | GetPacketsLostByRemote () const |
DWORD | GetPacketsOutOfOrder () const |
DWORD | GetPacketsTooLate () const |
DWORD | GetPacketOverruns () const |
DWORD | GetAverageSendTime () const |
DWORD | GetMarkerRecvCount () const |
DWORD | GetMarkerSendCount () const |
DWORD | GetMaximumSendTime () const |
DWORD | GetMinimumSendTime () const |
DWORD | GetAverageReceiveTime () const |
DWORD | GetMaximumReceiveTime () const |
DWORD | GetMinimumReceiveTime () const |
DWORD | GetAvgJitterTime () const |
DWORD | GetMaxJitterTime () const |
DWORD | GetJitterTimeOnRemote () const |
DWORD | GetRoundTripTime () const |
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<SendReceiveStatus &> OpalRTPSession::FilterNotifier |
|
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::AddFilter | ( | const FilterNotifier & | filter | ) |
|
protected |
|
inline |
Indicate if will ignore all but first received SSRC value.
References allowAnySyncSource.
|
virtual |
Reimplemented from OpalMediaSession.
|
protected |
void OpalRTPSession::ClearStatistics | ( | ) |
Clear statistics
|
virtual |
Reimplemented from OpalMediaSession.
|
virtual |
Implements OpalMediaSession.
|
virtual |
Reimplemented from OpalMediaSession.
|
inline |
Get average time between received packets. This is averaged over the last rxStatisticsInterval packets and is in milliseconds.
References averageReceiveTime.
|
inline |
Get average time between sent packets. This is averaged over the last txStatisticsInterval packets and is in milliseconds.
References averageSendTime.
|
inline |
Get averaged jitter time for received packets. This is the calculated statistical variance of the interarrival time of received packets in milliseconds.
References GetJitterTimeUnits(), jitterLevel, and JitterRoundingGuardBits.
PString OpalRTPSession::GetCanonicalName | ( | ) | const |
Get the canonical name for the RTP session.
|
inlinevirtual |
Get control UDP socket of session.
References m_controlSocket.
|
inlinevirtual |
Get data UDP socket of session.
References m_dataSocket.
RTPExtensionHeaders OpalRTPSession::GetExtensionHeaders | ( | ) | const |
Get the RTP header extension codes for the session.
PString OpalRTPSession::GetGroupId | ( | ) | const |
Get the group id for the RTP session.
|
inline |
References GetJitterBufferSize(), and GetJitterTimeUnits().
unsigned OpalRTPSession::GetJitterBufferSize | ( | ) | const |
Get current size of the jitter buffer. This returns the currently used jitter buffer delay in RTP timestamp units. It will be some value between the minimum and maximum set in the SetJitterBufferSize() function.
Referenced by GetJitterBufferDelay().
|
inline |
Get jitter time for received packets on remote. This is the calculated statistical variance of the interarrival time of received packets in milliseconds.
References GetJitterTimeUnits(), and jitterLevelOnRemote.
|
inline |
Get current time units of the jitter buffer.
References m_timeUnits.
Referenced by GetAvgJitterTime(), GetJitterBufferDelay(), GetJitterTimeOnRemote(), and GetMaxJitterTime().
|
inline |
References lastSentPacketTime.
|
inline |
References lastSentTimestamp.
|
virtual |
Reimplemented from OpalMediaSession.
|
inlinevirtual |
Get local control port of session.
References m_localControlPort.
|
inlinevirtual |
Get local data port of session.
References m_localDataPort.
|
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 markerRecvCount.
|
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 markerSendCount.
|
inline |
Get maximum time between received packets. This is over the last rxStatisticsInterval packets and is in milliseconds.
References maximumReceiveTime.
|
inline |
Get maximum time between sent packets. This is over the last txStatisticsInterval packets and is in milliseconds.
References maximumSendTime.
|
inline |
Get averaged jitter time for received packets. This is the maximum value of jitterLevel for the session.
References GetJitterTimeUnits(), JitterRoundingGuardBits, and maximumJitterLevel.
|
inline |
Get the maximum time we wait for packets from remote.
References m_maxNoReceiveTime.
|
inline |
Get the maximum time we wait for remote to start accepting out packets.
References m_maxNoTransmitTime.
|
inline |
Get minimum time between received packets. This is over the last rxStatisticsInterval packets and is in milliseconds.
References minimumReceiveTime.
|
inline |
Get minimum time between sent packets. This is over the last txStatisticsInterval packets and is in milliseconds.
References minimumSendTime.
|
inline |
Get total number of octets received in session.
References octetsReceived.
|
inline |
Get total number of octets sent in session.
References octetsSent.
DWORD OpalRTPSession::GetPacketOverruns | ( | ) | const |
Get total number received packets that could not fit into the jitter buffer.
|
inline |
Get total number received packets lost in session.
References packetsLost.
|
inline |
Get total number transmitted packets lost by remote in session. Determined via RTCP.
References packetsLostByRemote.
|
inline |
Get total number of packets received out of order in session.
References packetsOutOfOrder.
|
inline |
Get total number of packets received in session.
References packetsReceived.
|
inline |
Get total number of packets sent in session.
References packetsSent.
DWORD OpalRTPSession::GetPacketsTooLate | ( | ) | const |
Get total number received packets too late to go into jitter buffer.
|
virtual |
Reimplemented from OpalMediaSession.
|
inlinevirtual |
Get remote control port of session.
References m_remoteControlPort.
|
inlinevirtual |
Get remote data port of session.
References m_remoteDataPort.
|
inline |
Get the time interval for sending RTCP reports in the session.
References m_reportTimer.
|
inline |
Get round trip time to remote. This is calculated according to the RFC 3550 algorithm.
References roundTripTime.
|
inline |
Get the interval for receiver statistics in the session.
References rxStatisticsInterval.
|
inlinevirtual |
Implements OpalMediaSession.
References RTP_AVP().
|
virtual |
Reimplemented from OpalMediaSession.
|
inline |
References syncSourceIn.
|
inline |
Get the source output identifier.
References syncSourceOut.
PString OpalRTPSession::GetToolName | ( | ) | const |
Get the tool name for the RTP session.
|
inline |
Get the interval for transmitter statistics in the session.
References txStatisticsInterval.
|
protectedvirtual |
|
protected |
|
protectedvirtual |
|
inline |
Get flag for is audio RTP.
References m_isAudio.
|
virtual |
Reimplemented from OpalMediaSession.
|
protectedvirtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Reimplemented from OpalMediaSession.
OpalRTPSession::PARRAY | ( | ReceiverReportArray | , |
ReceiverReport | |||
) |
OpalRTPSession::PARRAY | ( | SourceDescriptionArray | , |
SourceDescription | |||
) |
|
protected |
|
protectedvirtual |
|
virtual |
Read a data frame from the RTP channel. This function will conditionally read data from the jitter buffer or directly if there is no jitter buffer enabled.
frame | Frame read from the RTP session |
|
protectedvirtual |
|
protectedvirtual |
|
inline |
References m_applDefinedNotifiers.
|
virtual |
Restarts an existing session in the given direction.
|
static |
Referenced by GetSessionType().
|
static |
|
protected |
|
virtual |
|
virtual |
Send flow control (Temporary Maximum Media Stream Bit Rate) Request/Notification.
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.
void OpalRTPSession::SendReport | ( | bool | force | ) |
Send a report to remote.
|
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.
|
inline |
Indicate if will ignore all but first received SSRC value.
allow | Flag for allow any SSRC values |
References allowAnySyncSource.
|
inline |
void OpalRTPSession::SetCanonicalName | ( | const PString & | name | ) |
Set the canonical name for the RTP session.
|
inlinevirtual |
References m_closeOnBye.
void OpalRTPSession::SetExtensionHeader | ( | const RTPExtensionHeaders & | ext | ) |
Set the RTP header extension codes for the session.
void OpalRTPSession::SetGroupId | ( | const PString & | id | ) |
Set the group id for the RTP session.
|
inline |
Indicate if will ignore rtp payload type changes in received packets.
ignore | Flag to ignore payload type changes |
References ignorePayloadTypeChanges.
bool OpalRTPSession::SetJitterBufferSize | ( | const OpalJitterBuffer::Init & | init | ) |
Sets the size of the jitter buffer to be used by this RTP session. A session defaults to not having any jitter buffer enabled for reading and the ReadBufferedData() function simply calls ReadData().
If either jitter delay parameter is zero, it destroys the jitter buffer attached to this RTP session.
init | Initialisation information |
|
inline |
Set the maximum time we wait for packets from remote.
interval | New time interval for reports. |
References m_maxNoReceiveTime.
|
inline |
Set the maximum time we wait for remote to start accepting out packets.
interval | New time interval for reports. |
References m_maxNoTransmitTime.
|
inline |
References lastSentSequenceNumber.
bool OpalRTPSession::SetQoS | ( | const PIPSocket::QoS & | qos | ) |
|
virtual |
Reimplemented from OpalMediaSession.
|
inline |
Set the time interval for sending RTCP reports in the session.
interval | New time interval for reports. |
References m_reportTimer.
void OpalRTPSession::SetRxStatisticsInterval | ( | unsigned | packets | ) |
Set the interval for receiver statistics in the session.
packets | Number of packets between callbacks |
|
inline |
Set flag for single port operation. This must be done before Open() is called to take effect.
References m_singlePort.
void OpalRTPSession::SetToolName | ( | const PString & | name | ) |
Set the tool name for the RTP session.
void OpalRTPSession::SetTxStatisticsInterval | ( | unsigned | packets | ) |
Set the interval for transmitter statistics in the session.
packets | Number of packets between callbacks |
|
virtual |
|
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 |
remote | Alternate address to transmit data frame |
rewriteHeader | Indicate header fields like sequence numbers are to be rewritten according to session status |
|
protectedvirtual |
|
friend |
|
protected |
Referenced by AllowAnySyncSource(), and SetAnySyncSource().
|
protected |
|
protected |
|
protected |
Referenced by GetAverageReceiveTime().
|
protected |
|
protected |
Referenced by GetAverageSendTime().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by SetIgnorePayloadTypeChanges().
|
protected |
Referenced by GetAvgJitterTime().
|
protected |
Referenced by GetJitterTimeOnRemote().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetLastSentPacketTime().
|
protected |
Referenced by SetNextSentSequenceNumber().
|
protected |
Referenced by GetLastSentTimestamp().
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by AddApplDefinedNotifier(), and RemoveApplDefinedNotifier().
|
protected |
|
protected |
|
protected |
Referenced by SetCloseOnBYE().
|
protected |
Referenced by GetControlSocket().
|
protected |
|
protected |
Referenced by GetDataSocket().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by IsAudio(), and SetAudio().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetLocalControlPort().
|
protected |
Referenced by GetLocalDataPort().
|
protected |
|
protected |
Referenced by GetMaxNoReceiveTime(), and SetMaxNoReceiveTime().
|
protected |
Referenced by GetMaxNoTransmitTime(), and SetMaxNoTransmitTime().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by GetRemoteControlPort().
|
protected |
Referenced by GetRemoteDataPort().
|
protected |
|
protected |
Referenced by GetReportTimeInterval(), and SetReportTimeInterval().
|
protected |
|
protected |
|
protected |
Referenced by SetSinglePort().
|
protected |
|
protected |
|
protected |
Referenced by GetJitterTimeUnits().
|
protected |
|
protected |
Referenced by GetMarkerRecvCount().
|
protected |
Referenced by GetMarkerSendCount().
|
protected |
Referenced by GetMaxJitterTime().
|
protected |
Referenced by GetMaximumReceiveTime().
|
protected |
|
protected |
Referenced by GetMaximumSendTime().
|
protected |
|
protected |
Referenced by GetMinimumReceiveTime().
|
protected |
|
protected |
Referenced by GetMinimumSendTime().
|
protected |
|
protected |
Referenced by GetOctetsReceived().
|
protected |
Referenced by GetOctetsSent().
|
protected |
|
protected |
|
protected |
Referenced by GetPacketsLost().
|
protected |
Referenced by GetPacketsLostByRemote().
|
protected |
|
protected |
Referenced by GetPacketsOutOfOrder().
|
protected |
Referenced by GetPacketsReceived().
|
protected |
Referenced by GetPacketsSent().
|
protected |
|
protected |
Referenced by GetRoundTripTime().
|
protected |
|
protected |
|
protected |
Referenced by GetRxStatisticsInterval().
|
protected |
|
protected |
Referenced by GetSyncSourceIn().
|
protected |
Referenced by GetSyncSourceOut().
|
protected |
|
protected |
Referenced by GetTxStatisticsInterval().