Callback for send bitrate estimates - new roll

Issue https://webrtc-codereview.appspot.com/4459004/ was commited as
r5259, after which flakiness was detected and a rollback was performed
at r5261.

Patch Set 1 of this issue is the code submitted in r5259. Subsequent
patch sets fixes a race condition which caused the seen problems.

The root cause was a dead lock between a thread sending rtp packets and
and a timed module processing thread:

webrtc::RTPSender::BitrateUpdated()  // Get RTPSender stats lock
webrtc::Bitrate::Process()  // Get Bitrate lock
webrtc::RTPSender::ProcessBitrate()
webrtc::ModuleRtpRtcpImpl::Process()
...

webrtc::Bitrate::Update()  // Get Bitrate lock
webrtc::RTPSender::UpdateRtpStats()  // Get RTPSender stats lock
webrtc::RTPSender::SendToNetwork()
...

This is fixed in Bitrate::Process() by releasing the lock before
calling the callback.

BUG=2235
R=mflodman@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5281 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
sprang@webrtc.org
2013-12-13 09:46:59 +00:00
parent f3973e81d5
commit 6811b6e308
15 changed files with 322 additions and 97 deletions

View File

@ -349,6 +349,11 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
uint32_t* fec_rate,
uint32_t* nackRate) const OVERRIDE;
virtual void RegisterVideoBitrateObserver(BitrateStatisticsObserver* observer)
OVERRIDE;
virtual BitrateStatisticsObserver* GetVideoBitrateObserver() const OVERRIDE;
virtual uint32_t SendTimeOfSendReport(const uint32_t send_report);
virtual bool SendTimeOfXrRrReport(uint32_t mid_ntp, int64_t* time_ms) const;