Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

QueueRTCPManager Class Reference

Management of RTCP functions. More...

#include <cc++/rtp.h>

Inheritance diagram for QueueRTCPManager::

RTPQueue Thread MembershipControl Members List of all members.

Public Methods

virtual void setControlBandwidth (float fraction)
virtual void setSendersControlFraction (float fraction)
uint32 RTCPSendCount () const
void setNAME (const char *const name)
void setEMAIL (const char *const email)
void setPHONE (const char *const phone)
void setLOC (const char *const loc)
void setTOOL (const char *const tool)
void setNOTE (const char *const note)
void setPRIV (const char *const priv)
void setH323_CADDR (const char *const h323ca)

Protected Methods

 QueueRTCPManager (int pri)
virtual ~QueueRTCPManager ()
void endQueueRTCPManager ()
void RTCPService (microtimeout_t &wait)
void Bye (const char *const reason=NULL)
void gotHello (const char *sdes)
void gotGoodbye (void)
void handleSSRCCollision ()
virtual timeval computeRTCPInterval ()

Private Methods

 QueueRTCPManager (const QueueRTCPManager &o)
QueueRTCPManager & operator= (const QueueRTCPManager &o)
void setSDESItem (sdes_item_type_t type, const char *const value)
void findCNAME ()
void updateAvgRTCPSize (uint16 len)
void ReverseReconsideration ()
bool TimerReconsideration ()
void TimeOutSSRCs ()
bool getSDES_APP (RTCPPacket &pkt, uint16 &pointer, uint16 len)
bool getBYE (RTCPPacket &pkt, uint16 &pointer, uint16 len)
void getOnlyBye ()
virtual uint16 networkHeaderSize ()
virtual uint16 transportHeaderSize ()
size_t sendControl (void)
void recvControl (void)
bool packReportBlock (uint16 &len)
bool tryAnotherRR (RTCPPacket *&pkt, uint16 &len, uint16 &blocks)
void packSDES (uint16 &len)
size_t sendBYE (const char *const reason)
virtual size_t writeControl (const unsigned char *const buffer, size_t len)=0
virtual size_t readControl (unsigned char *buffer, size_t len)=0
virtual bool isPendingControl (microtimeout_t timeout)=0
bool RTCPHeaderCheck (size_t len)

Private Attributes

uint16 pathMTU
unsigned char * rtcpsend_buffer
unsigned char * rtcprecv_buffer
bool rtcp_active
float controlbw
float sendcontrolbw
float recvcontrolbw
uint32 ctrlsendcount
uint16 lower_headers_size
timeval rtcp_tp
timeval rtcp_tc
timeval rtcp_tn
uint32 rtcp_pmembers
uint32 rtcp_bw
bool rtcp_we_sent
uint16 rtcp_avg_size
bool rtcp_initial
timeval rtcp_last_check
timeval rtcp_check_interval
timeval rtcp_next_check
uint32 last_sendcount
uint32 prev_nvalid_sources
timeval rtcp_calculated_interval
size_t CNAME_len
uint32 nprevalid_srcs
uint32 nvalid_srcs
uint32 npredeleted_srcs
uint32 ndeleted_srcs
microtimeout_t rtcp_min_interval

Static Private Attributes

const uint32 NTP_EPOCH_OFFSET = static_cast<uint32>(2208992400u)
const uint16 RTCP_VALID_MASK = (0xc000 | 0x2000 | 0xfe)
const uint16 RTCP_VALID_VALUE
const uint16 TIMEOUT_MULTIPLIER = 5
const double RECONSIDERATION_COMPENSATION = 2.718281828 - 1.5

Detailed Description

Management of RTCP functions.

Extends the RTP queue with the management of RTCP functions:

Author:
Federico Montesino <p5087@quintero.fie.us.es>

Definition at line 1607 of file rtp.h.


Constructor & Destructor Documentation

QueueRTCPManager::QueueRTCPManager int   pri [protected]
 

virtual QueueRTCPManager::~QueueRTCPManager   [protected, virtual]
 

QueueRTCPManager::QueueRTCPManager const QueueRTCPManager &   o [private]
 


Member Function Documentation

void QueueRTCPManager::Bye const char *const   reason = NULL [protected, virtual]
 

Try to post a BYE message. It will send a BYE packet as long as at least one RTP or RTCP packet has been sent before. If the number of members in the session is more than 50, the algorithm described in section 6.3.7 of RFC ???? is applied in order to avoid a flood of BYE messages.

Reimplemented from RTPQueue.

bool QueueRTCPManager::RTCPHeaderCheck size_t   len [private]
 

Parameters:
pos   header position in the RTCP recepction buffer
length   length of the RTCP compound packet in the reception buffer
Returns:

uint32 QueueRTCPManager::RTCPSendCount   const [inline]
 

Get the total number of RTCP packets sent until now

Parameters:
total   number of RTCP packets sent

Definition at line 1654 of file rtp.h.

void QueueRTCPManager::RTCPService microtimeout_t &   wait [protected, virtual]
 

A scheduler of RTCP packets.

Parameters:
wait   queue scheduling timeout

Reimplemented from RTPQueue.

void QueueRTCPManager::ReverseReconsideration   [private]
 

Apply reverse reconsideration adjustment to timing parameters when receiving BYE packets and not waiting to send a BYE.

void QueueRTCPManager::TimeOutSSRCs   [private]
 

Purge sources that do not seem active any more.

Note:
MUST be perform at least every RTCP transmission interval
Todo:
implement it

bool QueueRTCPManager::TimerReconsideration   [private]
 

virtual timeval QueueRTCPManager::computeRTCPInterval   [protected, virtual]
 

Computes the interval for sending RTCP compound packets, based on the average size of RTCP packets sent and received, and the current estimated number of participants in the session.

Note:
This currently follows the rules in section 6 of draft-ietf-avt-rtp-new-10

Todo:
make it more flexible as recommended in the draft

Returns:
interval for sending RTCP compound packets

void QueueRTCPManager::endQueueRTCPManager   [protected]
 

void QueueRTCPManager::findCNAME   [private]
 

Find out the local CNAME as user@host and store it as part of the internal state of this class.

bool QueueRTCPManager::getBYE RTCPPacket &   pkt,
uint16 &   pointer,
uint16   len
[private]
 

Process a BYE packet just received and identified.

Parameters:
pkt   previously identified RTCP BYE packet
pointer   octet number in the RTCP reception buffer where the packet is stored
len   total length of the compount RTCP packet the BYE packet to process is contained

void QueueRTCPManager::getOnlyBye   [private]
 

bool QueueRTCPManager::getSDES_APP RTCPPacket &   pkt,
uint16 &   pointer,
uint16   len
[private]
 

Returns:
whether there was a CNAME SDES item

void QueueRTCPManager::gotGoodbye void   [inline, protected]
 

A plugin point for goodbye message.

Definition at line 1730 of file rtp.h.

void QueueRTCPManager::gotHello const char *   sdes [inline, protected]
 

A plugin point for hello message.

Definition at line 1723 of file rtp.h.

void QueueRTCPManager::handleSSRCCollision   [protected]
 

virtual bool QueueRTCPManager::isPendingControl microtimeout_t   timeout [private, pure virtual]
 

Parameters:
timeout  
Returns:

virtual uint16 QueueRTCPManager::networkHeaderSize   [inline, private, virtual]
 

For certain control calculations in RTCP, the size of the underlying network and transport protocols is needed. This method provides the size of the network level header for the default case of IP (20 octets). In case other protocol with different header size is used, this method should be redefined in a new specialized class.

Returns:
size of the headers of the network level. IP (20) by default.

Definition at line 1842 of file rtp.h.

QueueRTCPManager& QueueRTCPManager::operator= const QueueRTCPManager &   o [private]
 

bool QueueRTCPManager::packReportBlock uint16 &   len [private]
 

Returns:
whether there were data to pack a report block or there are no more data

void QueueRTCPManager::packSDES uint16 &   len [private]
 

Parameters:
len   provisionary length of the RTCP compound packet
Returns:

virtual size_t QueueRTCPManager::readControl unsigned char *   buffer,
size_t   len
[private, pure virtual]
 

Returns:

void QueueRTCPManager::recvControl void   [private]
 

For picking up incoming RTCP packets if they are waiting. A timeout for the maximum interval since the last RTCP packet had been received is also returned. This is checked once a second.

Returns:
number of microseconds since last RTCP arrival.
Todo:
update doc and clarify purpose

size_t QueueRTCPManager::sendBYE const char *const   reason [private]
 

size_t QueueRTCPManager::sendControl void   [private]
 

Posting of RTCP messages.

Returns:
size_t number of octets sent

virtual void QueueRTCPManager::setControlBandwidth float   fraction [inline, virtual]
 

Specify the bandwith available for control (RTCP) packets.

Parameters:
bw   fraction of the session bandwidth, between 0 and 1
This method sets the global control bandwidth for both sender and receiver reports. As recommended in (RFC XXXX - RTP is currently in transition from Proposed to Draft Standard), 1/4 of the total control bandwidth is dedicated to senders, whereas 3/4 are dedicated to receivers.

Note:
If this method is not called, it is assumed that the control bandwidth is equal to 5% of the session bandwidth.
See also:
setSessionBandwidth , setSendersControlFraction

Definition at line 1628 of file rtp.h.

void QueueRTCPManager::setEMAIL const char *const   email [inline]
 

Definition at line 1666 of file rtp.h.

void QueueRTCPManager::setH323_CADDR const char *const   h323ca [inline]
 

Definition at line 1689 of file rtp.h.

void QueueRTCPManager::setLOC const char *const   loc [inline]
 

Definition at line 1673 of file rtp.h.

void QueueRTCPManager::setNAME const char *const   name [inline]
 

Minimal control information about the local participant

Definition at line 1662 of file rtp.h.

void QueueRTCPManager::setNOTE const char *const   note [inline]
 

Definition at line 1681 of file rtp.h.

void QueueRTCPManager::setPHONE const char *const   phone [inline]
 

Definition at line 1669 of file rtp.h.

void QueueRTCPManager::setPRIV const char *const   priv [inline]
 

Definition at line 1685 of file rtp.h.

void QueueRTCPManager::setSDESItem sdes_item_type_t   type,
const char *const   value
[private]
 

virtual void QueueRTCPManager::setSendersControlFraction float   fraction [inline, virtual]
 

Specify the fraction of the total control bandwith to be dedicated to senders reports.

Parameters:
fraction   fraction of bandwidth, must be between 0 an 1.
This method sets the fraction of the global control bandwidth that will be dedicated to senders reports. Of course, 1 - fraction will be dedicated to receivers reports.

See also:
setControlBandwidth

Definition at line 1645 of file rtp.h.

void QueueRTCPManager::setTOOL const char *const   tool [inline]
 

Definition at line 1677 of file rtp.h.

virtual uint16 QueueRTCPManager::transportHeaderSize   [inline, private, virtual]
 

For certain control calculations in RTCP, the size of the underlying network and transport protocols is needed. This method provides the size of the transport level header for the default case of UDP (8 octets). In case other protocol with different header size is used, this method should be redefined in a new specialized class.

return size of the headers of the transport level. UDP (8) by default

Definition at line 1857 of file rtp.h.

bool QueueRTCPManager::tryAnotherRR RTCPPacket *&   pkt,
uint16 &   len,
uint16 &   blocks
[private]
 

Try to pack a new RR in the RTCP compound packet currently being built. After having packed one or more SR or RR to send in an RTCP compound packet, checks if there are more reports to send and there is room enough in the current packet to include them. If so, the header for a new RR is appended together with the first report block, and true is returned.

Parameters:
fh   Header of the current SR/RR
len   provisionary length of the RTCP compound packet
blocks   number of blocks for the next packet
Returns:
true if a new RR has been appended to the current RTCP compound packet.

void QueueRTCPManager::updateAvgRTCPSize uint16   len [private]
 

Parameters:
len   length in octets of the last RTCP packet received

virtual size_t QueueRTCPManager::writeControl const unsigned char *const   buffer,
size_t   len
[private, pure virtual]
 

Returns:


Member Data Documentation

size_t QueueRTCPManager::CNAME_len [private]
 

Definition at line 1995 of file rtp.h.

const uint32 QueueRTCPManager::NTP_EPOCH_OFFSET = static_cast<uint32>(2208992400u) [static, private]
 

Definition at line 2012 of file rtp.h.

const double QueueRTCPManager::RECONSIDERATION_COMPENSATION = 2.718281828 - 1.5 [static, private]
 

Definition at line 2025 of file rtp.h.

const uint16 QueueRTCPManager::RTCP_VALID_MASK = (0xc000 | 0x2000 | 0xfe) [static, private]
 

Definition at line 2020 of file rtp.h.

const uint16 QueueRTCPManager::RTCP_VALID_VALUE [static, private]
 

Initial value:

 ((RTP_VERSION << 14) | 
                                                RTCP_TYPE_SR)

Definition at line 2021 of file rtp.h.

const uint16 QueueRTCPManager::TIMEOUT_MULTIPLIER = 5 [static, private]
 

Definition at line 2024 of file rtp.h.

float QueueRTCPManager::controlbw [private]
 

Definition at line 1967 of file rtp.h.

uint32 QueueRTCPManager::ctrlsendcount [private]
 

Definition at line 1969 of file rtp.h.

uint32 QueueRTCPManager::last_sendcount [private]
 

Definition at line 1989 of file rtp.h.

uint16 QueueRTCPManager::lower_headers_size [private]
 

Definition at line 1973 of file rtp.h.

uint32 QueueRTCPManager::ndeleted_srcs [private]
 

Definition at line 2007 of file rtp.h.

uint32 QueueRTCPManager::npredeleted_srcs [private]
 

Definition at line 2005 of file rtp.h.

uint32 QueueRTCPManager::nprevalid_srcs [private]
 

Definition at line 2001 of file rtp.h.

uint32 QueueRTCPManager::nvalid_srcs [private]
 

Definition at line 2003 of file rtp.h.

uint16 QueueRTCPManager::pathMTU [private]
 

Definition at line 1954 of file rtp.h.

uint32 QueueRTCPManager::prev_nvalid_sources [private]
 

Definition at line 1991 of file rtp.h.

float QueueRTCPManager::recvcontrolbw [private]
 

Definition at line 1967 of file rtp.h.

bool QueueRTCPManager::rtcp_active [private]
 

Definition at line 1965 of file rtp.h.

uint16 QueueRTCPManager::rtcp_avg_size [private]
 

Definition at line 1979 of file rtp.h.

uint32 QueueRTCPManager::rtcp_bw [private]
 

Definition at line 1977 of file rtp.h.

timeval QueueRTCPManager::rtcp_calculated_interval [private]
 

Definition at line 1992 of file rtp.h.

timeval QueueRTCPManager::rtcp_check_interval [private]
 

Definition at line 1984 of file rtp.h.

bool QueueRTCPManager::rtcp_initial [private]
 

Definition at line 1980 of file rtp.h.

timeval QueueRTCPManager::rtcp_last_check [private]
 

Definition at line 1982 of file rtp.h.

microtimeout_t QueueRTCPManager::rtcp_min_interval [private]
 

Definition at line 2009 of file rtp.h.

timeval QueueRTCPManager::rtcp_next_check [private]
 

Definition at line 1986 of file rtp.h.

uint32 QueueRTCPManager::rtcp_pmembers [private]
 

Definition at line 1976 of file rtp.h.

timeval QueueRTCPManager::rtcp_tc [private]
 

Definition at line 1975 of file rtp.h.

timeval QueueRTCPManager::rtcp_tn [private]
 

Definition at line 1975 of file rtp.h.

timeval QueueRTCPManager::rtcp_tp [private]
 

Definition at line 1975 of file rtp.h.

bool QueueRTCPManager::rtcp_we_sent [private]
 

Definition at line 1978 of file rtp.h.

unsigned char* QueueRTCPManager::rtcprecv_buffer [private]
 

Definition at line 1962 of file rtp.h.

unsigned char* QueueRTCPManager::rtcpsend_buffer [private]
 

Definition at line 1958 of file rtp.h.

float QueueRTCPManager::sendcontrolbw [private]
 

Definition at line 1967 of file rtp.h.


The documentation for this class was generated from the following file:
Generated at Tue Oct 16 11:17:52 2001 for ccRTP by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001