Yate
Public Types | Public Member Functions | Protected Member Functions | List of all members
RTPTransport Class Reference

Low level transport for RTP and RTCP. More...

#include <yatertp.h>

Inheritance diagram for RTPTransport:
RTPProcessor GenObject RTPDebug

Public Types

enum  Activation { Inactive , Bound , Active }
 
enum  Type { Unknown , RTP , UDPTL }
 

Public Member Functions

 RTPTransport (Type type=RTP, DebugEnabler *dbg=0, const char *traceId=0)
 
virtual ~RTPTransport ()
 
virtual void destruct ()
 
void setProcessor (RTPProcessor *processor=0)
 
void setMonitor (RTPProcessor *monitor=0)
 
const SocketAddrlocalAddr () const
 
const SocketAddrremoteAddr () const
 
bool localAddr (SocketAddr &addr, bool rtcp=true)
 
bool remoteAddr (SocketAddr &addr, bool sniff=false)
 
bool setBuffer (int bufLen=4096)
 
bool setTOS (int tos)
 
SocketrtpSock ()
 
SocketrtcpSock ()
 
bool drillHole ()
 
- Public Member Functions inherited from RTPProcessor
 RTPProcessor (DebugEnabler *dbg=0, const char *traceId=0)
 
virtual ~RTPProcessor ()
 
RTPGroupgroup () const
 
virtual void rtpData (const void *data, int len)
 
virtual void rtcpData (const void *data, int len)
 
virtual void getStats (String &stats) const
 
virtual void incWrongSrc ()
 
unsigned int wrongSrc ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
virtual void * getObject (const String &name) const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 
- Public Member Functions inherited from RTPDebug
 RTPDebug (DebugEnabler *dbg, const char *traceId)
 
 RTPDebug (RTPSession *session)
 
DebugEnablerdbg () const
 
const StringdbgTraceId () const
 

Protected Member Functions

virtual void timerTick (const Time &when)
 
virtual void rtpData (const void *data, int len)
 
virtual void rtcpData (const void *data, int len)
 
- Protected Member Functions inherited from RTPProcessor
void group (RTPGroup *newgrp)
 
virtual void timerTick (const Time &when)=0
 
- Protected Member Functions inherited from RTPDebug
void setDebug (DebugEnabler *dbg, const char *traceId)
 

Additional Inherited Members

- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 
- Protected Attributes inherited from RTPProcessor
unsigned int m_wrongSrc
 
- Protected Attributes inherited from RTPDebug
DebugEnablerm_dbg
 
String m_traceId
 

Detailed Description

Low level transport for RTP and RTCP.

Class that holds sockets and addresses for transporting RTP and RTCP packets.

Member Enumeration Documentation

◆ Activation

enum Activation

Activation status of the transport

◆ Type

enum Type

Type of transported data

Constructor & Destructor Documentation

◆ RTPTransport()

RTPTransport ( Type  type = RTP,
DebugEnabler dbg = 0,
const char *  traceId = 0 
)

Constructor, creates an unconnected transport

Parameters
typeType of check to apply to the data
dbgTransport DebugEnabler
traceIdTransport trace ID

◆ ~RTPTransport()

virtual ~RTPTransport ( )
virtual

Destructor

Member Function Documentation

◆ destruct()

virtual void destruct ( )
virtual

Destroys the object, disposes the memory. Do not call delete directly.

Reimplemented from GenObject.

◆ drillHole()

bool drillHole ( )

Drill a hole in a firewall or NAT for the RTP and RTCP sockets

Returns
True if at least a packet was sent for the RTP socket

◆ localAddr() [1/2]

const SocketAddr & localAddr ( ) const
inline

Get the local network address of the RTP transport

Returns
Reference to the local RTP transport address

◆ localAddr() [2/2]

bool localAddr ( SocketAddr addr,
bool  rtcp = true 
)

Set the local network address of the RTP transport

Parameters
addrNew local RTP transport address
rtcpEnable RTCP transport
Returns
True if address set, false if a failure occured

◆ remoteAddr() [1/2]

const SocketAddr & remoteAddr ( ) const
inline

Get the remote network address of the RTP transport

Returns
Reference to the remote RTP transport address

◆ remoteAddr() [2/2]

bool remoteAddr ( SocketAddr addr,
bool  sniff = false 
)

Set the remote network address of the RTP transport

Parameters
addrNew remote RTP transport address
sniffAutomatically adjust the address from the first incoming packet
Returns
True if address set, false if a failure occured

◆ rtcpData()

virtual void rtcpData ( const void *  data,
int  len 
)
protectedvirtual

This method is called to send a RTCP packet

Parameters
dataPointer to raw RTCP data
lenLength of the data packet

Reimplemented from RTPProcessor.

◆ rtcpSock()

Socket * rtcpSock ( )
inline

Get the RTCP socket used by this transport

Returns
Pointer to the RTCP socket

◆ rtpData()

virtual void rtpData ( const void *  data,
int  len 
)
protectedvirtual

This method is called to send a RTP packet

Parameters
dataPointer to raw RTP data
lenLength of the data packet

Reimplemented from RTPProcessor.

◆ rtpSock()

Socket * rtpSock ( )
inline

Get the RTP socket used by this transport

Returns
Pointer to the RTP socket

◆ setBuffer()

bool setBuffer ( int  bufLen = 4096)

Set the size of the operating system's buffers for the RTP and RTCP sockets

Parameters
bufLenRequested length of the buffer
Returns
True if the buffer length was set

◆ setMonitor()

void setMonitor ( RTPProcessor monitor = 0)

Set the RTP/RTCP monitor of data received by this transport

Parameters
monitorA pointer to a second RTPProcessor for this transport

◆ setProcessor()

void setProcessor ( RTPProcessor processor = 0)

Set the RTP/RTCP processor of data received by this transport

Parameters
processorA pointer to the RTPProcessor for this transport

◆ setTOS()

bool setTOS ( int  tos)
inline

Set the Type Of Service for the RTP socket

Parameters
tosType Of Service bits to set
Returns
True if operation was successfull, false if an error occured

◆ timerTick()

virtual void timerTick ( const Time when)
protectedvirtual

Method called periodically to read data out of sockets

Parameters
whenTime to use as base in all computing

Implements RTPProcessor.


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