Avoid critsect for protection- and qm setting callbacks in VideoSender.

This CL avoids changing the mentioned callbacks during a call, to avoid
a potential deadlock when acquiring _sendCritSect and calling
_mediaOpt.SetTargetRates.

Moving the critsect revealed a race for the FEC parameters in RtpVideoSender, so the CL grew a bit to avoid this. I also cleaned up some code here at the same time, but tried to keep it at a minimum since this CL had already increased a lot in size.

BUG=769
R=pbos@webrtc.org, stefan@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#8899}
This commit is contained in:
mflodman
2015-03-31 15:07:16 +02:00
parent 738a5b44d0
commit 903c0f2e76
18 changed files with 382 additions and 457 deletions

View File

@ -82,7 +82,9 @@ public:
};
static VideoCodingModule* Create(
VideoEncoderRateObserver* encoder_rate_observer);
Clock* clock,
VideoEncoderRateObserver* encoder_rate_observer,
VCMQMSettingsCallback* qm_settings_callback);
static VideoCodingModule* Create(Clock* clock, EventFactory* event_factory);
@ -267,16 +269,6 @@ public:
virtual int32_t RegisterSendStatisticsCallback(
VCMSendStatisticsCallback* sendStats) = 0;
// Register a video quality settings callback which will be called when
// frame rate/dimensions need to be updated for video quality optimization
//
// Input:
// - videoQMSettings : The callback object to register.
//
// Return value : VCM_OK, on success.
// < 0, on error
virtual int32_t RegisterVideoQMCallback(VCMQMSettingsCallback* videoQMSettings) = 0;
// Register a video protection callback which will be called to deliver
// the requested FEC rate and NACK status (on/off).
//