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 315 of file RTCP.cpp.


Function Documentation

void AddMember ( packet   ) 

Definition at line 1004 of file RTCP.cpp.

Referenced by OnReceive().

01004                                         {
01005   // Do nothing; all of the real work was done when NewMember() was called
01006 }

void AddSender ( packet   ) 

Definition at line 1008 of file RTCP.cpp.

Referenced by OnReceive().

01008                                         {
01009   // we don't yet recognize senders other than ourselves #####
01010 }

double drand30 (  ) 

Definition at line 1023 of file RTCP.cpp.

References our_random().

01023                             {
01024   unsigned tmp = our_random()&0x3FFFFFFF; // a random 30-bit integer
01025   return tmp/(double)(1024*1024*1024);
01026 }

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 993 of file RTCP.cpp.

References RTCPInstance::checkNewSSRC(), and NULL.

Referenced by OnReceive().

00993                                    {
00994   RTCPInstance* instance = (RTCPInstance*)p;
00995   if (instance == NULL) return 0;
00996 
00997   return instance->checkNewSSRC();
00998 }

int NewSender ( packet   ) 

Definition at line 1000 of file RTCP.cpp.

Referenced by OnReceive().

01000                                        {
01001   return 0; // we don't yet recognize senders other than ourselves #####
01002 }

int PacketType ( packet  p  ) 

Definition at line 979 of file RTCP.cpp.

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

Referenced by OnReceive().

00979                                     {
00980   RTCPInstance* instance = (RTCPInstance*)p;
00981   if (instance == NULL) return PACKET_UNKNOWN_TYPE;
00982 
00983   return instance->packetType();
00984 }

int ReceivedPacketSize ( packet  p  ) 

Definition at line 986 of file RTCP.cpp.

References NULL, and RTCPInstance::receivedPacketSize().

Referenced by OnReceive().

00986                                             {
00987   RTCPInstance* instance = (RTCPInstance*)p;
00988   if (instance == NULL) return 0;
00989 
00990   return instance->receivedPacketSize();
00991 }

void RemoveMember ( packet  p  ) 

Definition at line 1012 of file RTCP.cpp.

References NULL, and RTCPInstance::removeLastReceivedSSRC().

Referenced by OnReceive().

01012                                        {
01013   RTCPInstance* instance = (RTCPInstance*)p;
01014   if (instance == NULL) return;
01015 
01016   instance->removeLastReceivedSSRC();
01017 }

void RemoveSender ( packet   ) 

Definition at line 1019 of file RTCP.cpp.

Referenced by OnReceive().

01019                                            {
01020   // we don't yet recognize senders other than ourselves #####
01021 }

void Reschedule ( double  nextTime,
event  e 
)

Definition at line 944 of file RTCP.cpp.

References NULL, and RTCPInstance::reschedule().

Referenced by OnReceive().

00944                                                      {
00945   RTCPInstance* instance = (RTCPInstance*)e;
00946   if (instance == NULL) return;
00947 
00948   instance->reschedule(nextTime);
00949 }

void Schedule ( double  nextTime,
event  e 
)

Definition at line 937 of file RTCP.cpp.

References NULL, and RTCPInstance::schedule().

Referenced by OnExpire().

00937                                                    {
00938   RTCPInstance* instance = (RTCPInstance*)e;
00939   if (instance == NULL) return;
00940 
00941   instance->schedule(nextTime);
00942 }

void SendBYEPacket ( event  e  ) 

Definition at line 958 of file RTCP.cpp.

References NULL, and RTCPInstance::sendBYE().

Referenced by OnExpire().

00958                                        {
00959   RTCPInstance* instance = (RTCPInstance*)e;
00960   if (instance == NULL) return;
00961 
00962   instance->sendBYE();
00963 }

void SendRTCPReport ( event  e  ) 

Definition at line 951 of file RTCP.cpp.

References NULL, and RTCPInstance::sendReport().

Referenced by OnExpire().

00951                                         {
00952   RTCPInstance* instance = (RTCPInstance*)e;
00953   if (instance == NULL) return;
00954 
00955   instance->sendReport();
00956 }

int SentPacketSize ( event  e  ) 

Definition at line 972 of file RTCP.cpp.

References NULL, and RTCPInstance::sentPacketSize().

Referenced by OnExpire().

00972                                        {
00973   RTCPInstance* instance = (RTCPInstance*)e;
00974   if (instance == NULL) return 0;
00975 
00976   return instance->sentPacketSize();
00977 }

int TypeOfEvent ( event  e  ) 

Definition at line 965 of file RTCP.cpp.

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

Referenced by OnExpire(), and OnReceive().

00965                                     {
00966   RTCPInstance* instance = (RTCPInstance*)e;
00967   if (instance == NULL) return EVENT_UNKNOWN;
00968 
00969   return instance->typeOfEvent();
00970 }


Variable Documentation

unsigned const IP_UDP_HDR_SIZE = 28 [static]

Definition at line 312 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(), startReplicaUDPSink(), and SubsessionIOState::useFrameForHinting().

unsigned const preferredPacketSize = 1000 [static]

Definition at line 118 of file RTCP.cpp.

Referenced by RTCPInstance::RTCPInstance().


Generated on Thu May 17 07:14:19 2012 for live by  doxygen 1.5.2