I'm trying to report statistics of the amount of data being received by a
ProxyServerMediaSession. I have the following code:
double Total = 0.0;
int NumSubsessions = 0;
int NumSources = 0;
int NumStats = 0;
if (fClientMediaSession)
{
MediaSubsessionIterator SubsessionIterator(*fClientMediaSession);
MediaSubsession *Subsession;
while ((Subsession = SubsessionIterator.next()) != NULL)
{
NumSubsessions++;
RTPSource *Source = Subsession->rtpSource();
if (Source)
{
NumSources++;
RTPReceptionStatsDB::Iterator
StatsIterator(Source->receptionStatsDB());
RTPReceptionStats *Stats;
while ((Stats = StatsIterator.next()) != NULL)
{
NumStats++;
Total += Stats->totNumKBytesReceived();
}
}
}
}
Log << Total << ", sub: " << NumSubsessions << ", source: " << NumSources
<< ", stats: " << NumStats << std::endl;
return Total;
I'm finding that sometimes the total ends up less than the previous time I
called the method. When this happens, I get log lines like the following:
4406.52, sub: 2, source: 2, stats: 2
4464.01, sub: 2, source: 2, stats: 2
4641.45, sub: 2, source: 2, stats: 2
136.921, sub: 2, source: 2, stats: 1
4977.11, sub: 2, source: 2, stats: 2
5035.39, sub: 2, source: 2, stats: 2
5211.74, sub: 2, source: 2, stats: 2
You can see that in the fourth entry, it found 2 subsessions, two sources, but
only one of the sources had stats associated with it. This throws off my
calculations for bytes per second, as it looks like the total number of bytes
received has gone down since the previous sample.
Is there an issue with my code? Is there some reason why the stats should be
'missing' on certain calls?
Thanks
Andy
_______________________________________________
live-devel mailing list
[email protected]
http://lists.live555.com/mailman/listinfo/live-devel