#include <rtp.h>
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 | |
RTPSession * | session_ |
double | lastpkttime_ |
int | seqno_ |
int | running_ |
int | random_ |
int | maxpkts_ |
double | interval_ |
RTPTimer | rtp_timer_ |
double | timestamp_ |
Definition at line 373 of file rtp.h.
RTPAgent::RTPAgent | ( | ) |
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 | ) |
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] |