Yate
RTPSender Class Reference

RTP/RTCP packet sender. More...

#include <yatertp.h>

Inheritance diagram for RTPSender:
RTPBaseIO RTPDebug

Public Member Functions

 RTPSender (RTPSession *session=0, bool randomTs=true)
 
virtual ~RTPSender ()
 
bool rtpSend (bool marker, int payload, unsigned int timestamp, const void *data, int len)
 
bool rtpSendData (bool marker, unsigned int timestamp, const void *data, int len)
 
bool rtpSendEvent (int event, int duration, int volume=0, unsigned int timestamp=0)
 
bool rtpSendKey (char key, int duration, int volume=0, unsigned int timestamp=0)
 
int padding () const
 
bool padding (int chunk)
 
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 void rtpEncipher (unsigned char *data, int len)
 
virtual void rtpAddIntegrity (const unsigned char *data, int len, unsigned char *authData)
 
- 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)
 

Additional Inherited Members

- 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
 

Detailed Description

RTP/RTCP packet sender.

Class that builds and sends RTP and RTCP packets

Constructor & Destructor Documentation

◆ RTPSender()

RTPSender ( RTPSession * session = 0,
bool randomTs = true )

Constructor

Parameters
sessionRTP session the sender belongs
randomTsInitialize a random timestamp offset

References RTPBaseIO::session().

◆ ~RTPSender()

virtual ~RTPSender ( )
inlinevirtual

Do-nothing destructor

Member Function Documentation

◆ padding() [1/2]

int padding ( ) const
inline

Get the payload padding size

Returns
Chunk size to pad the payload to a multiple of

◆ padding() [2/2]

bool padding ( int chunk)

Set the padding to a multiple of a data chunk

Parameters
chunkSize to pad the payload to a multiple of
Returns
True if the new chunk size is valid

◆ rtpAddIntegrity()

virtual void rtpAddIntegrity ( const unsigned char * data,
int len,
unsigned char * authData )
protectedvirtual

Method called to add integrity information to the RTP packet. The default implementation calls session's rtpAddIntegrity()

Parameters
dataPointer to the RTP packet to protect
lenLength of RTP data to be encrypted including header and padding
authDataAddress to write the integrity data to

◆ rtpEncipher()

virtual void rtpEncipher ( unsigned char * data,
int len )
protectedvirtual

Method called to encipher RTP payload data in-place. The default implementation calls session's rtpEncipher()

Parameters
dataPointer to data block to encipher
lenLength of payload data to be encrypted including any padding

◆ rtpSend()

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

Send one RTP payload packet

Parameters
markerSet to true if the marker bit must be set
payloadPayload number
timestampSampling instant of the packet data
dataPointer to data block to send
lenLength of the data block
Returns
True if data sending was attempted

◆ rtpSendData()

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

Send one RTP data packet

Parameters
markerSet to true if the marker bit must be set
timestampSampling instant of the packet data
dataPointer to data block to send
lenLength of the data block
Returns
True if data sending was attempted

◆ rtpSendEvent()

bool rtpSendEvent ( int event,
int duration,
int volume = 0,
unsigned int timestamp = 0 )

Send one RTP event

Parameters
eventEvent code to send
durationDuration of the event as number of samples
volumeAttenuation of the tone, zero for don't care
timestampSampling instant of the packet data, zero to use current
Returns
True if data sending was attempted

◆ rtpSendKey()

bool rtpSendKey ( char key,
int duration,
int volume = 0,
unsigned int timestamp = 0 )

Send one RTP key event

Parameters
keyKey to send
durationDuration of the event as number of samples
volumeAttenuation of the tone, zero for don't care
timestampSampling instant of the packet data, zero to use current
Returns
True if data sending was attempted

◆ 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 send events and buffered data

Parameters
whenTime to use as base in all computing

Implements RTPBaseIO.


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