jrtplib  3.7.0
Public Member Functions | List of all members
RTCPPacketBuilder Class Reference

This class can be used to build RTCP compound packets, on a higher level than the RTCPCompoundPacketBuilder. More...

#include <rtcppacketbuilder.h>

Inherits RTPMemoryObject.

Public Member Functions

 RTCPPacketBuilder (RTPSources &sources, RTPPacketBuilder &rtppackbuilder, RTPMemoryManager *mgr=0)
 Creates an RTCPPacketBuilder instance. More...
 
int Init (size_t maxpacksize, double timestampunit, const void *cname, size_t cnamelen)
 Initializes the builder. More...
 
void Destroy ()
 Cleans up the builder. More...
 
int SetTimestampUnit (double tsunit)
 Sets the timestamp unit to be used to tsunit. More...
 
int SetMaximumPacketSize (size_t maxpacksize)
 Sets the maximum size allowed size of an RTCP compound packet to maxpacksize. More...
 
int SetPreTransmissionDelay (const RTPTime &delay)
 This function allows you to inform RTCP packet builder about the delay between sampling the first sample of a packet and sending the packet. More...
 
int BuildNextPacket (RTCPCompoundPacket **pack)
 Builds the next RTCP compound packet which should be sent and stores it in pack. More...
 
int BuildBYEPacket (RTCPCompoundPacket **pack, const void *reason, size_t reasonlength, bool useSRifpossible=true)
 Builds a BYE packet with reason for leaving specified by reason and length reasonlength. More...
 
void SetNameInterval (int count)
 Sets the RTCP interval for the SDES name item. More...
 
void SetEMailInterval (int count)
 Sets the RTCP interval for the SDES e-mail item. More...
 
void SetLocationInterval (int count)
 Sets the RTCP interval for the SDES location item. More...
 
void SetPhoneInterval (int count)
 Sets the RTCP interval for the SDES phone item. More...
 
void SetToolInterval (int count)
 Sets the RTCP interval for the SDES tool item. More...
 
void SetNoteInterval (int count)
 Sets the RTCP interval for the SDES note item. More...
 
int SetLocalName (const void *s, size_t len)
 Sets the SDES name item for the local participant to the value s with length len. More...
 
int SetLocalEMail (const void *s, size_t len)
 Sets the SDES e-mail item for the local participant to the value s with length len. More...
 
int SetLocalLocation (const void *s, size_t len)
 Sets the SDES location item for the local participant to the value s with length len. More...
 
int SetLocalPhone (const void *s, size_t len)
 Sets the SDES phone item for the local participant to the value s with length len. More...
 
int SetLocalTool (const void *s, size_t len)
 Sets the SDES tool item for the local participant to the value s with length len. More...
 
int SetLocalNote (const void *s, size_t len)
 Sets the SDES note item for the local participant to the value s with length len. More...
 
uint8_t * GetLocalCNAME (size_t *len) const
 Returns the own CNAME item with length len.
 

Detailed Description

The class RTCPPacketBuilder can be used to build RTCP compound packets. This class is more high-level than the RTCPCompoundPacketBuilder class: it uses the information of an RTPPacketBuilder instance and of an RTPSources instance to automatically generate the next compound packet which should be sent. It also provides functions to determine when SDES items other than the CNAME item should be sent.

Constructor & Destructor Documentation

RTCPPacketBuilder::RTCPPacketBuilder ( RTPSources sources,
RTPPacketBuilder rtppackbuilder,
RTPMemoryManager mgr = 0 
)

Creates an instance which will use the source table sources and the RTP packet builder rtppackbuilder to determine the information for the next RTCP compound packet. Optionally, the memory manager mgr can be installed.

Member Function Documentation

int RTCPPacketBuilder::BuildBYEPacket ( RTCPCompoundPacket **  pack,
const void *  reason,
size_t  reasonlength,
bool  useSRifpossible = true 
)

Builds a BYE packet with reason for leaving specified by reason and length reasonlength. If useSRifpossible is set to true, the RTCP compound packet will start with a sender report if allowed. Otherwise, a receiver report is used.

int RTCPPacketBuilder::BuildNextPacket ( RTCPCompoundPacket **  pack)
void RTCPPacketBuilder::Destroy ( )
int RTCPPacketBuilder::Init ( size_t  maxpacksize,
double  timestampunit,
const void *  cname,
size_t  cnamelen 
)

Initializes the builder to use the maximum allowed packet size maxpacksize, timestamp unit timestampunit and the SDES CNAME item specified by cname with length cnamelen. The timestamp unit is defined as a time interval divided by the timestamp interval corresponding to that interval: for 8000 Hz audio this would be 1/8000.

void RTCPPacketBuilder::SetEMailInterval ( int  count)
inline

After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES e-mail item will be added after the sources in the source table have been processed count times.

int RTCPPacketBuilder::SetLocalEMail ( const void *  s,
size_t  len 
)
inline
int RTCPPacketBuilder::SetLocalLocation ( const void *  s,
size_t  len 
)
inline
int RTCPPacketBuilder::SetLocalName ( const void *  s,
size_t  len 
)
inline
int RTCPPacketBuilder::SetLocalNote ( const void *  s,
size_t  len 
)
inline
int RTCPPacketBuilder::SetLocalPhone ( const void *  s,
size_t  len 
)
inline
int RTCPPacketBuilder::SetLocalTool ( const void *  s,
size_t  len 
)
inline
void RTCPPacketBuilder::SetLocationInterval ( int  count)
inline

After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES location item will be added after the sources in the source table have been processed count times.

int RTCPPacketBuilder::SetMaximumPacketSize ( size_t  maxpacksize)
inline
void RTCPPacketBuilder::SetNameInterval ( int  count)
inline

After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES name item will be added after the sources in the source table have been processed count times.

void RTCPPacketBuilder::SetNoteInterval ( int  count)
inline

After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES note item will be added after the sources in the source table have been processed count times.

void RTCPPacketBuilder::SetPhoneInterval ( int  count)
inline

After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES phone item will be added after the sources in the source table have been processed count times.

int RTCPPacketBuilder::SetPreTransmissionDelay ( const RTPTime delay)
inline

This function allows you to inform RTCP packet builder about the delay between sampling the first sample of a packet and sending the packet. This delay is taken into account when calculating the relation between RTP timestamp and wallclock time, used for inter-media synchronization.

int RTCPPacketBuilder::SetTimestampUnit ( double  tsunit)
inline

Sets the timestamp unit to be used to tsunit. The timestamp unit is defined as a time interval divided by the timestamp interval corresponding to that interval: for 8000 Hz audio this would be 1/8000.

void RTCPPacketBuilder::SetToolInterval ( int  count)
inline

After all possible sources in the source table have been processed, the class will check if other SDES items need to be sent. If count is zero or negative, nothing will happen. If count is positive, an SDES tool item will be added after the sources in the source table have been processed count times.


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