diff options
Diffstat (limited to 'modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h')
-rw-r--r-- | modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h index a28109ce99..6da67e5a13 100644 --- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h +++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h @@ -22,8 +22,8 @@ #include "modules/remote_bitrate_estimator/aimd_rate_control.h" #include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "rtc_base/constructor_magic.h" -#include "rtc_base/critical_section.h" #include "rtc_base/rate_statistics.h" +#include "rtc_base/synchronization/mutex.h" #include "rtc_base/thread_annotations.h" namespace webrtc { @@ -54,26 +54,25 @@ class RemoteBitrateEstimatorSingleStream : public RemoteBitrateEstimator { typedef std::map<uint32_t, Detector*> SsrcOveruseEstimatorMap; // Triggers a new estimate calculation. - void UpdateEstimate(int64_t time_now) - RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + void UpdateEstimate(int64_t time_now) RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_); void GetSsrcs(std::vector<uint32_t>* ssrcs) const - RTC_SHARED_LOCKS_REQUIRED(crit_sect_); + RTC_SHARED_LOCKS_REQUIRED(mutex_); // Returns |remote_rate_| if the pointed to object exists, // otherwise creates it. - AimdRateControl* GetRemoteRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); + AimdRateControl* GetRemoteRate() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_); Clock* const clock_; const FieldTrialBasedConfig field_trials_; - SsrcOveruseEstimatorMap overuse_detectors_ RTC_GUARDED_BY(crit_sect_); - RateStatistics incoming_bitrate_ RTC_GUARDED_BY(crit_sect_); - uint32_t last_valid_incoming_bitrate_ RTC_GUARDED_BY(crit_sect_); - std::unique_ptr<AimdRateControl> remote_rate_ RTC_GUARDED_BY(crit_sect_); - RemoteBitrateObserver* const observer_ RTC_GUARDED_BY(crit_sect_); - rtc::CriticalSection crit_sect_; + SsrcOveruseEstimatorMap overuse_detectors_ RTC_GUARDED_BY(mutex_); + RateStatistics incoming_bitrate_ RTC_GUARDED_BY(mutex_); + uint32_t last_valid_incoming_bitrate_ RTC_GUARDED_BY(mutex_); + std::unique_ptr<AimdRateControl> remote_rate_ RTC_GUARDED_BY(mutex_); + RemoteBitrateObserver* const observer_ RTC_GUARDED_BY(mutex_); + mutable Mutex mutex_; int64_t last_process_time_; - int64_t process_interval_ms_ RTC_GUARDED_BY(crit_sect_); + int64_t process_interval_ms_ RTC_GUARDED_BY(mutex_); bool uma_recorded_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RemoteBitrateEstimatorSingleStream); |