liveMedia/RTCP.cpp File Reference

#include "RTCP.hh"
#include "GroupsockHelper.hh"
#include "rtcp_from_spec.h"

Include dependency graph for RTCP.cpp:

Go to the source code of this file.

Data Structures

class  RTCPMemberDatabase
struct  RRHandlerRecord

Defines

#define ADVANCE(n)   pkt += (n); packetSize -= (n)

Functions

static double dTimeNow ()
void Schedule (double nextTime, event e)
void Reschedule (double nextTime, event e)
void SendRTCPReport (event e)
void SendBYEPacket (event e)
int TypeOfEvent (event e)
int SentPacketSize (event e)
int PacketType (packet p)
int ReceivedPacketSize (packet p)
int NewMember (packet p)
int NewSender (packet)
void AddMember (packet)
void AddSender (packet)
void RemoveMember (packet p)
void RemoveSender (packet)
double drand30 ()

Variables

static unsigned const maxPacketSize = 1450
static unsigned const preferredPacketSize = 1000
static unsigned const IP_UDP_HDR_SIZE = 28


Define Documentation

#define ADVANCE (  )     pkt += (n); packetSize -= (n)

Definition at line 314 of file RTCP.cpp.


Function Documentation

void AddMember ( packet   ) 

Definition at line 981 of file RTCP.cpp.

Referenced by OnReceive().

00981                                         {
00982   // Do nothing; all of the real work was done when NewMember() was called
00983 }

void AddSender ( packet   ) 

Definition at line 985 of file RTCP.cpp.

Referenced by OnReceive().

00985                                         {
00986   // we don't yet recognize senders other than ourselves #####
00987 }

double drand30 (  ) 

Definition at line 1000 of file RTCP.cpp.

References our_random().

01000                             {
01001   unsigned tmp = our_random()&0x3FFFFFFF; // a random 30-bit integer
01002   return tmp/(double)(1024*1024*1024);
01003 }

static double dTimeNow (  )  [static]

Definition at line 110 of file RTCP.cpp.

References NULL.

Referenced by RTCPInstance::onExpire1(), RTCPInstance::RTCPInstance(), and RTCPInstance::schedule().

00110                          {
00111     struct timeval timeNow;
00112     gettimeofday(&timeNow, NULL);
00113     return (double) (timeNow.tv_sec + timeNow.tv_usec/1000000.0);
00114 }

int NewMember ( packet  p  ) 

Definition at line 970 of file RTCP.cpp.

References RTCPInstance::checkNewSSRC(), and NULL.

Referenced by OnReceive().

00970                                    {
00971   RTCPInstance* instance = (RTCPInstance*)p;
00972   if (instance == NULL) return 0;
00973 
00974   return instance->checkNewSSRC();
00975 }

int NewSender ( packet   ) 

Definition at line 977 of file RTCP.cpp.

Referenced by OnReceive().

00977                                        {
00978   return 0; // we don't yet recognize senders other than ourselves #####
00979 }

int PacketType ( packet  p  ) 

Definition at line 956 of file RTCP.cpp.

References NULL, PACKET_UNKNOWN_TYPE, and RTCPInstance::packetType().

Referenced by OnReceive().

00956                                     {
00957   RTCPInstance* instance = (RTCPInstance*)p;
00958   if (instance == NULL) return PACKET_UNKNOWN_TYPE;
00959 
00960   return instance->packetType();
00961 }

int ReceivedPacketSize ( packet  p  ) 

Definition at line 963 of file RTCP.cpp.

References NULL, and RTCPInstance::receivedPacketSize().

Referenced by OnReceive().

00963                                             {
00964   RTCPInstance* instance = (RTCPInstance*)p;
00965   if (instance == NULL) return 0;
00966 
00967   return instance->receivedPacketSize();
00968 }

void RemoveMember ( packet  p  ) 

Definition at line 989 of file RTCP.cpp.

References NULL, and RTCPInstance::removeLastReceivedSSRC().

Referenced by OnReceive().

00989                                        {
00990   RTCPInstance* instance = (RTCPInstance*)p;
00991   if (instance == NULL) return;
00992 
00993   instance->removeLastReceivedSSRC();
00994 }

void RemoveSender ( packet   ) 

Definition at line 996 of file RTCP.cpp.

Referenced by OnReceive().

00996                                            {
00997   // we don't yet recognize senders other than ourselves #####
00998 }

void Reschedule ( double  nextTime,
event  e 
)

Definition at line 921 of file RTCP.cpp.

References NULL, and RTCPInstance::reschedule().

Referenced by OnReceive().

00921                                                      {
00922   RTCPInstance* instance = (RTCPInstance*)e;
00923   if (instance == NULL) return;
00924 
00925   instance->reschedule(nextTime);
00926 }

void Schedule ( double  nextTime,
event  e 
)

Definition at line 914 of file RTCP.cpp.

References NULL, and RTCPInstance::schedule().

Referenced by OnExpire().

00914                                                    {
00915   RTCPInstance* instance = (RTCPInstance*)e;
00916   if (instance == NULL) return;
00917 
00918   instance->schedule(nextTime);
00919 }

void SendBYEPacket ( event  e  ) 

Definition at line 935 of file RTCP.cpp.

References NULL, and RTCPInstance::sendBYE().

Referenced by OnExpire().

00935                                        {
00936   RTCPInstance* instance = (RTCPInstance*)e;
00937   if (instance == NULL) return;
00938 
00939   instance->sendBYE();
00940 }

void SendRTCPReport ( event  e  ) 

Definition at line 928 of file RTCP.cpp.

References NULL, and RTCPInstance::sendReport().

Referenced by OnExpire().

00928                                         {
00929   RTCPInstance* instance = (RTCPInstance*)e;
00930   if (instance == NULL) return;
00931 
00932   instance->sendReport();
00933 }

int SentPacketSize ( event  e  ) 

Definition at line 949 of file RTCP.cpp.

References NULL, and RTCPInstance::sentPacketSize().

Referenced by OnExpire().

00949                                        {
00950   RTCPInstance* instance = (RTCPInstance*)e;
00951   if (instance == NULL) return 0;
00952 
00953   return instance->sentPacketSize();
00954 }

int TypeOfEvent ( event  e  ) 

Definition at line 942 of file RTCP.cpp.

References EVENT_UNKNOWN, NULL, and RTCPInstance::typeOfEvent().

Referenced by OnExpire(), and OnReceive().

00942                                     {
00943   RTCPInstance* instance = (RTCPInstance*)e;
00944   if (instance == NULL) return EVENT_UNKNOWN;
00945 
00946   return instance->typeOfEvent();
00947 }


Variable Documentation

unsigned const IP_UDP_HDR_SIZE = 28 [static]

Definition at line 311 of file RTCP.cpp.

Referenced by RTCPInstance::incomingReportHandler1(), and RTCPInstance::sendBuiltPacket().

unsigned const maxPacketSize = 1450 [static]

Definition at line 116 of file RTCP.cpp.

Referenced by RTCPInstance::incomingReportHandler1(), main(), RTCPInstance::RTCPInstance(), and SubsessionIOState::useFrameForHinting().

unsigned const preferredPacketSize = 1000 [static]

Definition at line 118 of file RTCP.cpp.

Referenced by RTCPInstance::RTCPInstance().


Generated on Tue Oct 7 15:39:13 2008 for live by  doxygen 1.5.2