Fixed incorrect packet loss reported to encoder.

BUG=275

Review URL: https://webrtc-codereview.appspot.com/394004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@1669 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
mflodman@webrtc.org 2012-02-10 12:41:57 +00:00
parent 6b3bb89f12
commit 8224e19dd9
2 changed files with 18 additions and 27 deletions

View File

@ -2724,14 +2724,11 @@ void ModuleRtpRtcpImpl::ProcessDefaultModuleBandwidth() {
{
// get min and max for the sending channels
CriticalSectionScoped lock(_criticalSectionModulePtrs);
std::list<ModuleRtpRtcpImpl*>::iterator it =
_childModules.begin();
while (it != _childModules.end()) {
// Get child RTP sender and ask for bitrate estimate
for (std::list<ModuleRtpRtcpImpl*>::iterator it = _childModules.begin();
it != _childModules.end(); ++ it) {
// Get child RTP sender and ask for bitrate estimate.
ModuleRtpRtcpImpl* childModule = *it;
if (childModule->Sending()) {
count++;
RTPSender& childRtpSender = (*it)->_rtpSender;
const WebRtc_UWord32 childEstimateBps =
1000 * childRtpSender.TargetSendBitrateKbit();
@ -2741,27 +2738,19 @@ void ModuleRtpRtcpImpl::ProcessDefaultModuleBandwidth() {
if (childEstimateBps > maxBitrateBps) {
maxBitrateBps = childEstimateBps;
}
WebRtc_UWord16 RTT = 0;
WebRtc_UWord8 fractionLost = 0;
RTPReceiver& childRtpReceiver = (*it)->_rtpReceiver;
RTCPReceiver& childRtcpReceiver = (*it)->_rtcpReceiver;
childRtpReceiver.Statistics(&fractionLost,
NULL,
NULL,
NULL,
NULL,
NULL,
false);
fractionLostAcc += fractionLost;
childRtcpReceiver.RTT(childRtpReceiver.SSRC(),
&RTT,
NULL,
NULL,
NULL);
maxRoundTripTime =
(RTT > maxRoundTripTime) ? RTT : maxRoundTripTime;
std::vector<RTCPReportBlock> rtcp_blocks;
childRtcpReceiver.StatisticsReceived(&rtcp_blocks);
for (std::vector<RTCPReportBlock>::iterator rit = rtcp_blocks.begin();
rit != rtcp_blocks.end(); ++rit) {
count++;
fractionLostAcc += rit->fractionLost;
WebRtc_UWord16 RTT = 0;
childRtcpReceiver.RTT(rit->remoteSSRC, &RTT, NULL, NULL, NULL);
maxRoundTripTime = (RTT > maxRoundTripTime) ? RTT : maxRoundTripTime;
}
}
it++;
}
} // end critsect

View File

@ -210,7 +210,8 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
bool sender,
bool receiver) = 0;
// The function gets statistics from the received RTCP report.
// This function returns our locally created statistics of the received RTP
// stream.
virtual int GetReceivedRTCPStatistics(
const int video_channel,
unsigned short& fraction_lost,
@ -219,7 +220,8 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
unsigned int& jitter,
int& rtt_ms) const = 0;
// The function gets statistics from the RTCP report sent to the receiver.
// This function returns statistics reported by the remote client in a RTCP
// packet.
virtual int GetSentRTCPStatistics(const int video_channel,
unsigned short& fraction_lost,
unsigned int& cumulative_lost,