Yate
RTPReceiver Class Reference

RTP/RTCP packet receiver. More...

#include <yatertp.h>

Inheritance diagram for RTPReceiver:
RTPBaseIO RTPDebug

Public Member Functions

 RTPReceiver (RTPSession *session=0)
 
virtual ~RTPReceiver ()
 
u_int32_t ioPacketsLost () const
 
void setDejitter (RTPDejitter *dejitter)
 
void setDejitter (unsigned int mindelay, unsigned int maxdelay)
 
virtual bool rtpRecv (bool marker, int payload, unsigned int timestamp, const void *data, int len)
 
virtual bool rtpRecvData (bool marker, unsigned int timestamp, const void *data, int len)
 
virtual bool rtpRecvEvent (int event, char key, int duration, int volume, unsigned int timestamp)
 
virtual void rtpNewPayload (int payload, unsigned int timestamp)
 
virtual void rtpNewSSRC (u_int32_t newSsrc, bool marker)
 
virtual void stats (NamedList &stat) const
 
- Public Member Functions inherited from RTPBaseIO
 RTPBaseIO (RTPSession *session=0)
 
virtual ~RTPBaseIO ()
 
int dataPayload () const
 
bool dataPayload (int type)
 
int eventPayload () const
 
bool eventPayload (int type)
 
int silencePayload () const
 
bool silencePayload (int type)
 
unsigned int ssrcInit ()
 
void reset ()
 
unsigned int ssrc () const
 
void ssrc (unsigned int src)
 
u_int16_t seq () const
 
u_int32_t rollover () const
 
u_int64_t fullSeq () const
 
u_int32_t ioPackets () const
 
u_int32_t ioOctets () const
 
unsigned int tsLast () const
 
RTPSessionsession () const
 
RTPSecuresecurity () const
 
void security (RTPSecure *secure)
 
void initDebugData (bool recv, const NamedList &params)
 
- 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 bool rtpDecipher (unsigned char *data, int len, const void *secData, u_int32_t ssrc, u_int64_t seq)
 
virtual bool rtpCheckIntegrity (const unsigned char *data, int len, const void *authData, u_int32_t ssrc, u_int64_t seq)
 
- Protected Member Functions inherited from RTPBaseIO
void secLength (u_int32_t len, u_int32_t key=0)
 
- Protected Member Functions inherited from RTPDebug
void setDebug (DebugEnabler *dbg, const char *traceId)
 

Protected Attributes

u_int32_t m_ioLostPkt
 
- Protected Attributes inherited from RTPBaseIO
RTPSessionm_session
 
RTPSecurem_secure
 
bool m_ssrcInit
 
u_int32_t m_ssrc
 
u_int32_t m_ts
 
u_int16_t m_seq
 
u_int32_t m_rollover
 
u_int16_t m_secLen
 
u_int16_t m_mkiLen
 
u_int32_t m_evTs
 
int m_evNum
 
int m_evVol
 
unsigned int m_evSeq
 
u_int32_t m_ioPackets
 
u_int32_t m_ioOctets
 
unsigned int m_tsLast
 
int m_debugDataLevel
 
bool m_debugData
 
bool m_debugEvent
 
- Protected Attributes inherited from RTPDebug
DebugEnablerm_dbg
 
String m_traceId
 

Friends

class RTPSession
 
class RTPDejitter
 

Detailed Description

RTP/RTCP packet receiver.

Class that handles incoming RTP and RTCP packets

Constructor & Destructor Documentation

◆ RTPReceiver()

RTPReceiver ( RTPSession * session = 0)
inline

Constructor

References RTPBaseIO::RTPBaseIO(), and RTPBaseIO::session().

◆ ~RTPReceiver()

virtual ~RTPReceiver ( )
virtual

Destructor - gets rid of the jitter buffer if present

Member Function Documentation

◆ ioPacketsLost()

u_int32_t ioPacketsLost ( ) const
inline

Retrieve the number of lost packets in current session

Returns
Number of packets in sequence gaps

◆ rtpCheckIntegrity()

virtual bool rtpCheckIntegrity ( const unsigned char * data,
int len,
const void * authData,
u_int32_t ssrc,
u_int64_t seq )
protectedvirtual

Method called to check the integrity of the RTP packet. The default implementation calls session's rtpCheckIntegrity()

Parameters
dataPointer to RTP header and data
lenLength of header, data and padding
authDataPointer to authentication data
ssrcSSRC of the packet to validate
seqFull (48 bit) seqence number of the packet including rollovers
Returns
True is the packet passed integrity checks

References RTPBaseIO::seq(), and RTPBaseIO::ssrc().

◆ rtpDecipher()

virtual bool rtpDecipher ( unsigned char * data,
int len,
const void * secData,
u_int32_t ssrc,
u_int64_t seq )
protectedvirtual

Method called to decipher RTP data in-place. The default implementation calls session's rtpDecipher()

Parameters
dataPointer to data block to decipher
lenLength of data including any padding
secDataPointer to security data if applicable
ssrcSSRC of the packet to decipher
seqFull (48 bit) seqence number of the packet including rollovers
Returns
True is the packet was deciphered correctly or can't tell

References RTPBaseIO::seq(), and RTPBaseIO::ssrc().

◆ rtpNewPayload()

virtual void rtpNewPayload ( int payload,
unsigned int timestamp )
virtual

Method called for unknown payload types just before attempting to call rtpRecvData(). This is a good opportunity to change the payload type and continue.

Parameters
payloadPayload number
timestampSampling instant of the unexpected packet data

◆ rtpNewSSRC()

virtual void rtpNewSSRC ( u_int32_t newSsrc,
bool marker )
virtual

Method called when a packet with an unexpected SSRC is received just before processing further. This is a good opportunity to change the SSRC and continue

Parameters
newSsrcSSRC received in packet
markerTrue if marker bit is set in the RTP packet

◆ rtpRecv()

virtual bool rtpRecv ( bool marker,
int payload,
unsigned int timestamp,
const void * data,
int len )
virtual

Process one RTP payload packet. Default behaviour is to call rtpRecvData() or rtpRecvEvent().

Parameters
markerSet to true if the marker bit is set
payloadPayload number
timestampSampling instant of the packet data
dataPointer to data block to process
lenLength of the data block in bytes
Returns
True if data was handled

◆ rtpRecvData()

virtual bool rtpRecvData ( bool marker,
unsigned int timestamp,
const void * data,
int len )
virtual

Process one RTP data packet

Parameters
markerSet to true if the marker bit is set
timestampSampling instant of the packet data
dataPointer to data block to process
lenLength of the data block in bytes
Returns
True if data was handled

◆ rtpRecvEvent()

virtual bool rtpRecvEvent ( int event,
char key,
int duration,
int volume,
unsigned int timestamp )
virtual

Process one RTP event

Parameters
eventReceived event code
keyReceived key (for events 0-16) or zero
durationDuration of the event as number of samples
volumeAttenuation of the tone, zero for don't care
timestampSampling instant of the initial packet data
Returns
True if data was handled

◆ setDejitter() [1/2]

void setDejitter ( RTPDejitter * dejitter)

Set a new dejitter buffer in this receiver

Parameters
dejitterNew dejitter buffer to set, NULL to remove

Referenced by setDejitter().

◆ setDejitter() [2/2]

void setDejitter ( unsigned int mindelay,
unsigned int maxdelay )
inline

Allocate and set a new dejitter buffer in this receiver

Parameters
mindelayMinimum length of the dejitter buffer in microseconds
maxdelayMaximum length of the dejitter buffer in microseconds

References RTPDebug::dbg(), and setDejitter().

◆ stats()

virtual void stats ( NamedList & stat) const
virtual

Retrieve the statistical data from this receiver in a NamedList. Reset all the data.

Parameters
statNamedList to populate with the values for different counters

◆ timerTick()

virtual void timerTick ( const Time & when)
protectedvirtual

Method called periodically to finish lingering events

Parameters
whenTime to use as base in all computing

Implements RTPBaseIO.


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