# RTP_UDP Class Reference

`#include <rtp.h>`

Inheritance diagram for RTP_UDP:

[legend]
Collaboration diagram for RTP_UDP:
[legend]

## 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.
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)

## Protected Member Functions

| PDECLARE_NOTIFIER (PTimer, RTP_UDP, OnWriteDataIdle)

## 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

## Friends

class | RTP_Encoding

## 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