RTP_UDP Class Reference

`#include <rtp.h>`

Inheritance diagram for RTP_UDP:

## Public Member Functions

virtual PBoolean | ModifyQOS (RTP_QOS *rtpqos)
virtual void | Reopen (PBoolean isReading)
virtual int | GetDataSocketHandle () const
virtual int | GetControlSocketHandle () const
virtual int | WaitForPDU (PUDPSocket &dataSocket, PUDPSocket &controlSocket, const PTimeInterval &timer)
virtual int | Internal_WaitForPDU (PUDPSocket &dataSocket, PUDPSocket &controlSocket, const PTimeInterval &timer)
virtual SendReceiveStatus | ReadDataPDU (RTP_DataFrame &frame)
virtual SendReceiveStatus | Internal_ReadDataPDU (RTP_DataFrame &frame)
virtual SendReceiveStatus | OnReadTimeout (RTP_DataFrame &frame)
virtual SendReceiveStatus | Internal_OnReadTimeout (RTP_DataFrame &frame)
virtual SendReceiveStatus | ReadControlPDU ()
virtual SendReceiveStatus | ReadDataOrControlPDU (BYTE *framePtr, PINDEX frameSize, PBoolean fromDataChannel)
virtual bool | WriteDataPDU (RTP_DataFrame &frame)
virtual bool | WriteDataOrControlPDU (const BYTE *framePtr, PINDEX frameSize, bool toDataChannel)
virtual void | SetEncoding (const PString &newEncoding)
Construction
| RTP_UDP (const Params &options)
| ~RTP_UDP ()
| Destroy the RTP. More...
Overrides from class RTP_Session
virtual PBoolean | ReadData (RTP_DataFrame &frame)
virtual PBoolean | Internal_ReadData (RTP_DataFrame &frame)
virtual void | FlushData ()
virtual PBoolean | WriteData (RTP_DataFrame &frame)
virtual PBoolean | Internal_WriteData (RTP_DataFrame &frame)
virtual PBoolean | WriteOOBData (RTP_DataFrame &frame, bool setTimeStamp=true)
virtual PBoolean | WriteControl (RTP_ControlFrame &frame)
virtual bool | Close (PBoolean reading)
virtual PString | GetLocalHostName ()
New functions for class
virtual PBoolean | Open (PIPSocket::Address localAddress, WORD portBase, WORD portMax, BYTE ipTypeOfService, PNatMethod *natMethod=NULL, RTP_QOS *rtpqos=NULL)
Member variable access
virtual PIPSocket::Address | GetLocalAddress () const
virtual void | SetLocalAddress (const PIPSocket::Address &addr)
PIPSocket::Address | GetRemoteAddress () const
virtual WORD | GetLocalDataPort () const
virtual WORD | GetLocalControlPort () const
virtual WORD | GetRemoteDataPort () const
virtual WORD | GetRemoteControlPort () const
virtual PUDPSocket & | GetDataSocket ()
virtual PUDPSocket & | GetControlSocket ()
virtual PBoolean | SetRemoteSocketInfo (PIPSocket::Address address, WORD port, PBoolean isDataPort)
virtual void | ApplyQOS (const PIPSocket::Address &addr)
Public Member Functions inherited from RTP_Session
virtual void | SetCloseOnBYE (PBoolean v)
virtual void | SendIntraFrameRequest (bool rfc2032, bool pictureLoss)
virtual void | SendTemporalSpatialTradeOff (unsigned tradeOff)
void | SetNextSentSequenceNumber (WORD num)
virtual PString | GetEncoding () const
DWORD | GetSyncSourceIn () const
void | SetFailed (bool v)
bool | HasFailed () const
void | AddFilter (const FilterNotifier &filter)
virtual void | SendBYE ()
| RTP_Session (const Params &options)
| ~RTP_Session ()
void | SetJitterBufferSize (unsigned minJitterDelay, unsigned maxJitterDelay, unsigned timeUnits=0, PINDEX packetSize=2048)
unsigned | GetJitterBufferSize () const
unsigned | GetJitterBufferDelay () const
unsigned | GetJitterTimeUnits () const
virtual PBoolean | ReadBufferedData (RTP_DataFrame &frame)
virtual void | GetStatistics (OpalMediaStatistics &statistics, bool receiver) const
virtual SendReceiveStatus | OnSendData (RTP_DataFrame &frame)
virtual SendReceiveStatus | Internal_OnSendData (RTP_DataFrame &frame)
virtual SendReceiveStatus | OnSendControl (RTP_ControlFrame &frame, PINDEX &len)
virtual SendReceiveStatus | Internal_OnSendControl (RTP_ControlFrame &frame, PINDEX &len)
virtual SendReceiveStatus | OnReceiveData (RTP_DataFrame &frame)
virtual SendReceiveStatus | Internal_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 PString &type, unsigned subtype, DWORD src, const BYTE *data, PINDEX size)
unsigned | GetSessionID () const
void | SetSessionID (unsigned id)
bool | IsAudio () const
void | SetAudio (bool aud)
PString | GetCanonicalName () const
void | SetCanonicalName (const PString &name)
PString | GetToolName () const
void | SetToolName (const PString &name)
RTP_UserData * | GetUserData () const
void | SetUserData (RTP_UserData *data, PBoolean autoDeleteUserData=true)
DWORD | GetSyncSourceOut () const
bool | AllowAnySyncSource () const
void | SetAnySyncSource (bool allow)
void | SetIgnorePayloadTypeChanges (PBoolean ignore)
const PTimeInterval & | GetReportTimeInterval ()
void | SetReportTimeInterval (const PTimeInterval &interval)
unsigned | GetTxStatisticsInterval ()
void | SetTxStatisticsInterval (unsigned packets)
unsigned | GetRxStatisticsInterval ()
void | SetRxStatisticsInterval (unsigned packets)
void | ClearStatistics ()
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

## Protected Member Functions

| PDECLARE_NOTIFIER (PTimer, RTP_UDP, OnWriteDataIdle)
Protected Member Functions inherited from RTP_Session
RTP_Session::ReceiverReportArray | BuildReceiverReportArray (const RTP_ControlFrame &frame, PINDEX offset)
void | AddReceiverReport (RTP_ControlFrame::ReceiverReport &receiver)
PBoolean | InsertReportPacket (RTP_ControlFrame &report)
void | SaveOutOfOrderPacket (RTP_DataFrame &frame)
| PDECLARE_NOTIFIER (PTimer, RTP_Session, SendReport)

## Protected Attributes

PIPSocket::Address | localAddress
WORD | localDataPort
WORD | localControlPort
PIPSocket::Address | remoteAddress
WORD | remoteDataPort
WORD | remoteControlPort
PIPSocket::Address | remoteTransmitAddress
PUDPSocket * | dataSocket
PUDPSocket * | controlSocket
bool | shutdownRead
bool | shutdownWrite
bool | appliedQOS
bool | remoteIsNAT
bool | localHasNAT
bool | m_firstControl
int | badTransmitCounter
PTime | badTransmitStart
PTimer | timerWriteDataIdle
Protected Attributes inherited from RTP_Session
PString | m_encoding
PMutex | m_encodingMutex
RTP_Encoding * | m_encodingHandler
unsigned | sessionID
bool | isAudio
unsigned | m_timeUnits
PString | canonicalName
PString | toolName
RTP_UserData * | userData
PBoolean | autoDeleteUserData
JitterBufferPtr | m_jitterBuffer
DWORD | syncSourceOut
DWORD | syncSourceIn
DWORD | lastSentTimestamp
bool | allowAnySyncSource
bool | allowOneSyncSourceChange
PBoolean | allowRemoteTransmitAddressChange
PBoolean | allowSequenceChange
unsigned | txStatisticsInterval
unsigned | rxStatisticsInterval
WORD | lastSentSequenceNumber
WORD | expectedSequenceNumber
PTimeInterval | lastSentPacketTime
PTimeInterval | lastReceivedPacketTime
PTime | lastSRTimestamp
PTime | lastSRReceiveTime
PTimeInterval | delaySinceLastSR
WORD | lastRRSequenceNumber
bool | resequenceOutOfOrderPackets
unsigned | consecutiveOutOfOrderPackets
PTimeInterval | outOfOrderWaitTime
PTimeInterval | outOfOrderPacketTime
std::list< RTP_DataFrame > | m_outOfOrderPackets
PMutex | dataMutex
DWORD | timeStampOffs
PBoolean | oobTimeStampBaseEstablished
DWORD | oobTimeStampOutBase
PTimeInterval | oobTimeStampBase
PTime | firstPacketSent
DWORD | packetsSent
DWORD | rtcpPacketsSent
DWORD | octetsSent
PTime | firstPacketReceived
DWORD | packetsReceived
DWORD | senderReportsReceived
DWORD | octetsReceived
DWORD | packetsLost
DWORD | packetsLostByRemote
DWORD | packetsOutOfOrder
DWORD | averageSendTime
DWORD | maximumSendTime
DWORD | minimumSendTime
DWORD | averageReceiveTime
DWORD | maximumReceiveTime
DWORD | minimumReceiveTime
DWORD | jitterLevel
DWORD | jitterLevelOnRemote
DWORD | maximumJitterLevel
DWORD | markerSendCount
DWORD | markerRecvCount
unsigned | txStatisticsCount
unsigned | rxStatisticsCount
DWORD | averageSendTimeAccum
DWORD | maximumSendTimeAccum
DWORD | minimumSendTimeAccum
DWORD | averageReceiveTimeAccum
DWORD | maximumReceiveTimeAccum
DWORD | minimumReceiveTimeAccum
DWORD | packetsLostSinceLastRR
DWORD | lastTransitTime
RTP_DataFrame::PayloadTypes | lastReceivedPayloadType
PBoolean | ignorePayloadTypeChanges
PMutex | m_reportMutex
PTimer | m_reportTimer
PBoolean | closeOnBye
PBoolean | byeSent
bool | failed
| set to true if session has received too many ICMP destination unreachable More...
list< FilterNotifier > | m_filters

## Friends

class | RTP_Encoding

## Additional Inherited Members

Public Types inherited from RTP_Session
typedef PNotifierTemplate< SendReceiveStatus & > | FilterNotifier
enum | SendReceiveStatus { e_ProcessPacket, e_IgnorePacket, e_AbortTransport }
enum | { JitterRoundingGuardBits = 4 }
Protected Types inherited from RTP_Session
typedef PSafePtr< RTP_JitterBuffer, PSafePtrMultiThreaded > | JitterBufferPtr

## Detailed Description

This class is for the IETF Real Time Protocol interface on UDP/IP.

## Constructor & Destructor Documentation

RTP_UDP::RTP_UDP | ( | const Params & | options | ) |

Create a new RTP channel.

Parameters

  options | Parameters to construct with session.

RTP_UDP::~RTP_UDP | ( |  | ) |

Destroy the RTP.

## Member Function Documentation

virtual void RTP_UDP::ApplyQOS | ( | const PIPSocket::Address & | addr | ) |

virtual

Apply QOS - requires address to connect the socket on Windows platforms

virtual bool RTP_UDP::Close | ( | PBoolean | reading | ) |

virtual

Close down the RTP session.

Parameters

  reading | Closing the read side of the session

Implements RTP_Session.

virtual void RTP_UDP::FlushData | ( |  | ) |

virtual

Flush incoming data.

Reimplemented from RTP_Session.

virtual PUDPSocket& RTP_UDP::GetControlSocket | ( |  | ) |

inline virtual

Get control UDP socket of session.

virtual int RTP_UDP::GetControlSocketHandle | ( |  | ) | const

inline virtual

virtual PUDPSocket& RTP_UDP::GetDataSocket | ( |  | ) |

inline virtual

Get data UDP socket of session.

virtual int RTP_UDP::GetDataSocketHandle | ( |  | ) | const

inline virtual

virtual PIPSocket::Address RTP_UDP::GetLocalAddress | ( |  | ) | const

inline virtual

Get local address of session.

virtual WORD RTP_UDP::GetLocalControlPort | ( |  | ) | const

inline virtual

Get local control port of session.

virtual WORD RTP_UDP::GetLocalDataPort | ( |  | ) | const

inline virtual

Get local data port of session.

virtual PString RTP_UDP::GetLocalHostName | ( |  | ) |

virtual

Get the session description name.

Implements RTP_Session.

PIPSocket::Address RTP_UDP::GetRemoteAddress | ( |  | ) | const

inline

Get remote address of session.

virtual WORD RTP_UDP::GetRemoteControlPort | ( |  | ) | const

inline virtual

Get remote control port of session.

virtual WORD RTP_UDP::GetRemoteDataPort | ( |  | ) | const

inline virtual

Get remote data port of session.

virtual SendReceiveStatus RTP_UDP::Internal_OnReadTimeout | ( | RTP_DataFrame & | frame | ) |

virtual

virtual PBoolean RTP_UDP::Internal_ReadData | ( | RTP_DataFrame & | frame | ) |

virtual

virtual SendReceiveStatus RTP_UDP::Internal_ReadDataPDU | ( | RTP_DataFrame & | frame | ) |

virtual

virtual int RTP_UDP::Internal_WaitForPDU | ( | PUDPSocket & | dataSocket,
|  | PUDPSocket & | controlSocket,
|  | const PTimeInterval & | timer
| ) |  |

virtual

virtual PBoolean RTP_UDP::Internal_WriteData | ( | RTP_DataFrame & | frame | ) |

virtual

virtual PBoolean RTP_UDP::ModifyQOS | ( | RTP_QOS * | rtpqos | ) |

virtual

Change the QoS settings

Reimplemented from RTP_Session.

virtual SendReceiveStatus RTP_UDP::OnReadTimeout | ( | RTP_DataFrame & | frame | ) |

virtual

virtual PBoolean RTP_UDP::Open | ( | PIPSocket::Address | localAddress,
|  | WORD | portBase,
|  | WORD | portMax,
|  | BYTE | ipTypeOfService,
|  | PNatMethod * | natMethod = `NULL`,
|  | RTP_QOS * | rtpqos = `NULL`
| ) |  |

virtual

Open the UDP ports for the RTP session.

Parameters

  localAddress | Local interface to bind to
  portBase | Base of ports to search
  portMax | end of ports to search (inclusive)
  ipTypeOfService | Type of Service byte
  natMethod | NAT traversal method to use createing sockets
  rtpqos | QOS spec (or NULL if no QoS)

RTP_UDP::PDECLARE_NOTIFIER | ( | PTimer | ,
|  | RTP_UDP | ,
|  | OnWriteDataIdle |
| ) |  |

protected

virtual SendReceiveStatus RTP_UDP::ReadControlPDU | ( |  | ) |

virtual

virtual PBoolean RTP_UDP::ReadData | ( | RTP_DataFrame & | frame | ) |

virtual

Read a data frame from the RTP channel. Any control frames received are dispatched to callbacks and are not returned by this function. It will block until a data frame is available or an error occurs.

Implements RTP_Session.

virtual SendReceiveStatus RTP_UDP::ReadDataOrControlPDU | ( | BYTE * | framePtr,
|  | PINDEX | frameSize,
|  | PBoolean | fromDataChannel
| ) |  |

virtual

virtual SendReceiveStatus RTP_UDP::ReadDataPDU | ( | RTP_DataFrame & | frame | ) |

virtual

virtual void RTP_UDP::Reopen | ( | PBoolean | isReading | ) |

virtual

Reopens an existing session in the given direction.

Implements RTP_Session.

virtual void RTP_UDP::SetEncoding | ( | const PString & | newEncoding | ) |

virtual

Reimplemented from RTP_Session.

virtual void RTP_UDP::SetLocalAddress | ( | const PIPSocket::Address & | addr | ) |

inline virtual

Set local address of session.

virtual PBoolean RTP_UDP::SetRemoteSocketInfo | ( | PIPSocket::Address | address,
|  | WORD | port,
|  | PBoolean | isDataPort
| ) |  |

virtual

Set the remote address and port information for session.

Parameters

  address | Addre ss of remote
  port | Port on remote
  isDataPort | Flag for data or control channel

virtual int RTP_UDP::WaitForPDU | ( | PUDPSocket & | dataSocket,
|  | PUDPSocket & | controlSocket,
|  | const PTimeInterval & | timer
| ) |  |

virtual

virtual PBoolean RTP_UDP::WriteControl | ( | RTP_ControlFrame & | frame | ) |

virtual

Write a control frame from the RTP channel.

Implements RTP_Session.

virtual PBoolean RTP_UDP::WriteData | ( | RTP_DataFrame & | frame | ) |

virtual

Write a data frame to the RTP channel.

Implements RTP_Session.

virtual bool RTP_UDP::WriteDataOrControlPDU | ( | const BYTE * | framePtr,
|  | PINDEX | frameSize,
|  | bool | toDataChannel
| ) |  |

virtual

virtual bool RTP_UDP::WriteDataPDU | ( | RTP_DataFrame & | frame | ) |

virtual

virtual PBoolean RTP_UDP::WriteOOBData | ( | RTP_DataFrame & | frame,
|  | bool | setTimeStamp = `true`
| ) |  |

virtual

Write data frame to the RTP channel outside the normal stream of media Used for RFC2833 packets

Reimplemented from RTP_Session.

## Friends And Related Function Documentation

friend class RTP_Encoding

friend

## Field Documentation

bool RTP_UDP::appliedQOS

protected

int RTP_UDP::badTransmitCounter

protected

PTime RTP_UDP::badTransmitStart

protected

PUDPSocket* RTP_UDP::controlSocket

protected

PUDPSocket* RTP_UDP::dataSocket

protected

PIPSocket::Address RTP_UDP::localAddress

protected

WORD RTP_UDP::localControlPort

protected

WORD RTP_UDP::localDataPort

protected

bool RTP_UDP::localHasNAT

protected

bool RTP_UDP::m_firstControl

protected

PIPSocket::Address RTP_UDP::remoteAddress

protected

WORD RTP_UDP::remoteControlPort

protected

WORD RTP_UDP::remoteDataPort

protected

bool RTP_UDP::remoteIsNAT

protected

PIPSocket::Address RTP_UDP::remoteTransmitAddress

protected

bool RTP_UDP::shutdownRead

protected

bool RTP_UDP::shutdownWrite

protected

PTimer RTP_UDP::timerWriteDataIdle

protected

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

- rtp.h