RTPTransmissionStatsDB Class Reference

#include <RTPSink.hh>

Collaboration diagram for RTPTransmissionStatsDB:

Collaboration graph
[legend]

Public Member Functions

unsigned numReceivers () const
void noteIncomingRR (u_int32_t SSRC, struct sockaddr_in const &lastFromAddress, unsigned lossStats, unsigned lastPacketNumReceived, unsigned jitter, unsigned lastSRTime, unsigned diffSR_RRTime)
void removeRecord (u_int32_t SSRC)
RTPTransmissionStatslookup (u_int32_t SSRC) const

Private Member Functions

 RTPTransmissionStatsDB (RTPSink &rtpSink)
virtual ~RTPTransmissionStatsDB ()
void add (u_int32_t SSRC, RTPTransmissionStats *stats)

Private Attributes

unsigned fNumReceivers
RTPSinkfOurRTPSink
HashTablefTable

Friends

class RTPSink
class Iterator

Data Structures

class  Iterator

Detailed Description

Definition at line 136 of file RTPSink.hh.


Constructor & Destructor Documentation

RTPTransmissionStatsDB::RTPTransmissionStatsDB ( RTPSink rtpSink  )  [private]

Definition at line 163 of file RTPSink.cpp.

References fNumReceivers.

00164   : fOurRTPSink(rtpSink),
00165     fTable(HashTable::create(ONE_WORD_HASH_KEYS)) {
00166   fNumReceivers=0;
00167 }

RTPTransmissionStatsDB::~RTPTransmissionStatsDB (  )  [private, virtual]

Definition at line 169 of file RTPSink.cpp.

References fTable, NULL, and HashTable::RemoveNext().

00169                                                 {
00170   // First, remove and delete all stats records from the table:
00171   RTPTransmissionStats* stats;
00172   while ((stats = (RTPTransmissionStats*)fTable->RemoveNext()) != NULL) {
00173     delete stats;
00174   }
00175 
00176   // Then, delete the table itself:
00177   delete fTable;
00178 }


Member Function Documentation

unsigned RTPTransmissionStatsDB::numReceivers (  )  const [inline]

Definition at line 138 of file RTPSink.hh.

References fNumReceivers.

00138 { return fNumReceivers; }

void RTPTransmissionStatsDB::noteIncomingRR ( u_int32_t  SSRC,
struct sockaddr_in const &  lastFromAddress,
unsigned  lossStats,
unsigned  lastPacketNumReceived,
unsigned  jitter,
unsigned  lastSRTime,
unsigned  diffSR_RRTime 
)

Definition at line 181 of file RTPSink.cpp.

References fOurRTPSink, lookup(), RTPTransmissionStats::noteIncomingRR(), and NULL.

Referenced by RTCPInstance::processIncomingReport().

00183                                                                                {
00184   RTPTransmissionStats* stats = lookup(SSRC);
00185   if (stats == NULL) {
00186     // This is the first time we've heard of this SSRC.
00187     // Create a new record for it:
00188     stats = new RTPTransmissionStats(fOurRTPSink, SSRC);
00189     if (stats == NULL) return;
00190     add(SSRC, stats);
00191 #ifdef DEBUG_RR
00192     fprintf(stderr, "Adding new entry for SSRC %x in RTPTransmissionStatsDB\n", SSRC);
00193 #endif
00194   }
00195 
00196   stats->noteIncomingRR(lastFromAddress,
00197                         lossStats, lastPacketNumReceived, jitter,
00198                         lastSRTime, diffSR_RRTime);
00199 }

void RTPTransmissionStatsDB::removeRecord ( u_int32_t  SSRC  ) 

Definition at line 201 of file RTPSink.cpp.

References fNumReceivers, fTable, lookup(), NULL, and HashTable::Remove().

Referenced by RTCPInstance::removeSSRC().

00201                                                         {
00202   RTPTransmissionStats* stats = lookup(SSRC);
00203   if (stats != NULL) {
00204     long SSRC_long = (long)SSRC;
00205     fTable->Remove((char const*)SSRC_long);
00206     --fNumReceivers;
00207     delete stats;
00208   }
00209 }

RTPTransmissionStats * RTPTransmissionStatsDB::lookup ( u_int32_t  SSRC  )  const

Definition at line 227 of file RTPSink.cpp.

References fTable, and HashTable::Lookup().

Referenced by noteIncomingRR(), RTCPInstance::processIncomingReport(), and removeRecord().

00227                                                                          {
00228   long SSRC_long = (long)SSRC;
00229   return (RTPTransmissionStats*)(fTable->Lookup((char const*)SSRC_long));
00230 }

void RTPTransmissionStatsDB::add ( u_int32_t  SSRC,
RTPTransmissionStats stats 
) [private]

Definition at line 232 of file RTPSink.cpp.

References HashTable::Add(), fNumReceivers, and fTable.

00232                                                                             {
00233   long SSRC_long = (long)SSRC;
00234   fTable->Add((char const*)SSRC_long, stats);
00235   ++fNumReceivers;
00236 }


Friends And Related Function Documentation

friend class RTPSink [friend]

Definition at line 163 of file RTPSink.hh.

friend class Iterator [friend]

Definition at line 171 of file RTPSink.hh.


Field Documentation

unsigned RTPTransmissionStatsDB::fNumReceivers [private]

Definition at line 172 of file RTPSink.hh.

Referenced by add(), numReceivers(), removeRecord(), and RTPTransmissionStatsDB().

RTPSink& RTPTransmissionStatsDB::fOurRTPSink [private]

Definition at line 173 of file RTPSink.hh.

Referenced by noteIncomingRR().

HashTable* RTPTransmissionStatsDB::fTable [private]

Definition at line 174 of file RTPSink.hh.

Referenced by add(), lookup(), removeRecord(), and ~RTPTransmissionStatsDB().


The documentation for this class was generated from the following files:
Generated on Tue Mar 25 14:40:44 2014 for live by  doxygen 1.5.2