RTPAgent Class Reference

#include <rtp.h>

List of all members.

Public Member Functions

 RTPAgent ()
virtual void timeout (int)
virtual void recv (Packet *p, Handler *)
virtual int command (int argc, const char *const *argv)
void advanceby (int delta)
virtual void sendmsg (int nbytes, const char *flags=0)

Protected Member Functions

virtual void sendpkt ()
virtual void makepkt (Packet *)
void rate_change ()
virtual void start ()
virtual void stop ()
virtual void finish ()

Protected Attributes

RTPSessionsession_
double lastpkttime_
int seqno_
int running_
int random_
int maxpkts_
double interval_
RTPTimer rtp_timer_
double timestamp_


Detailed Description

this class generates the RTP packets and controls the transmission rate through the RTP timer and the update rate function

Definition at line 373 of file rtp.h.


Constructor & Destructor Documentation

RTPAgent::RTPAgent (  ) 

constructor initializes the RTPAgent intance

Definition at line 66 of file rtp.cc.

References interval_, maxpkts_, random_, seqno_, and timestamp_.


Member Function Documentation

void RTPAgent::timeout ( int   )  [virtual]

when the RTPTimer times out the RTP Agent sends an RTP packet when there is a session (multicast session) the sending source is apdating the number of RTP packets that sends

Definition at line 132 of file rtp.cc.

References interval_, RTPSession::localsrc_update(), RTPSession::localsrc_update_nbytes(), random_, rtp_timer_, running_, sendpkt(), and session_.

Referenced by RTPTimer::expire().

void RTPAgent::recv ( Packet *  p,
Handler *   
) [virtual]

the receive method for RTP packets. It simples passes the packet to the instance of the RTPSession class. Ottherwise the mothod does nothing

Definition at line 173 of file rtp.cc.

References RTPSession::recv(), and session_.

void RTPAgent::advanceby ( int  delta  ) 

Parameters:
delta 

Definition at line 162 of file rtp.cc.

References maxpkts_, running_, seqno_, and start().

Referenced by command().

void RTPAgent::sendmsg ( int  nbytes,
const char *  flags = 0 
) [virtual]

sends the packets

Definition at line 94 of file rtp.cc.

References hdr_rtp::access(), finish(), maxpkts_, hdr_rtp::seqno(), seqno_, and start().

void RTPAgent::sendpkt (  )  [protected, virtual]

allocates the RTP packet that has to be sent

Definition at line 231 of file rtp.cc.

References lastpkttime_, makepkt(), and timestamp_.

Referenced by rate_change(), start(), and timeout().

void RTPAgent::makepkt ( Packet *  p  )  [protected, virtual]

creates the RTP packet and fills in the packet header fields

Definition at line 240 of file rtp.cc.

References hdr_rtp::access(), hdr_rtp::seqno(), seqno_, session_, RTPSession::srcid(), hdr_rtp::srcid(), hdr_rtp::timestamp(), and timestamp_.

Referenced by sendpkt().

void RTPAgent::rate_change (  )  [protected]

We modify the rate in this way to get a faster reaction to the a rate change since a rate change from a very low rate to a very fast rate may take an undesireably long time if we have to wait for timeout at the old rate before we can send at the new (faster) rate.

Definition at line 216 of file rtp.cc.

References interval_, lastpkttime_, rtp_timer_, and sendpkt().

Referenced by command().

void RTPAgent::start (  )  [protected, virtual]

starts the RTP Agent

Definition at line 78 of file rtp.cc.

References interval_, rtp_timer_, running_, and sendpkt().

Referenced by advanceby(), command(), and sendmsg().

void RTPAgent::stop (  )  [protected, virtual]

stops the RTP Agent

Definition at line 86 of file rtp.cc.

References finish(), and rtp_timer_.

Referenced by command().

void RTPAgent::finish (  )  [protected, virtual]

finish() is called when we must stop (either by request or because we're out of packets to send.

Definition at line 152 of file rtp.cc.

References running_.

Referenced by sendmsg(), and stop().


The documentation for this class was generated from the following files:
Generated on Sat Mar 8 18:04:09 2008 for RTP by  doxygen 1.5.1