return md_32((char *)&s, sizeof(s));
} /* random32 */
A.7 Computing the RTCP Transmission Interval
The following function returns the time between transmissions of RTCP
packets, measured in seconds. It should be called after sending one
compound RTCP packet to calculate the delay until the next should be
sent. This function should also be called to calculate the delay
before sending the first RTCP packet upon startup rather than send
the packet immediately. This avoids any burst of RTCP packets if an
application is started at many sites simultaneously, for example as a
result of a session announcement.
The parameters have the following meaning:
rtcp_bw: The target RTCP bandwidth, i.e., the total bandwidth that
will be used for RTCP packets by all members of this session, in
octets per second. This should be 5% of the "session bandwidth"
parameter supplied to the application at startup.
senders: Number of active senders since sending last report, known
from construction of receiver reports for this RTCP packet.
Includes ourselves, if we also sent during this interval.
members: The estimated number of session members, including
ourselves. Incremented as we discover new session members from
the receipt of RTP or RTCP packets, and decremented as session
members leave (via RTCP BYE) or their state is timed out (30
minutes is recommended). On the first call, this parameter
should have the value 1.
Schulzrinne, et al Standards Track [Page 68]
RFC 1889 RTP January 1996
we_sent: Flag that is true if we have sent data during the last two
RTCP intervals. If the flag is true, the compound RTCP packet
just sent contained an SR packet.
packet_size: The size of the compound RTCP packet just sent, in
octets, including the network encapsulation (e.g., 28 octets for
UDP over IP).
avg_rtcp_size: Pointer to estimator for compound RTCP packet size;
initialized and updated by this function for the packet just
sent, and also updated by an identical line of code in the RTCP
receive routine for every RTCP packet received from other
participants in the session.
initial: Flag that is true for the first call upon startup to
calculate the time until the first report should be sent.
#include <math.h>