Index: webrtc/modules/rtp_rtcp/source/bitrate.cc |
diff --git a/webrtc/modules/rtp_rtcp/source/bitrate.cc b/webrtc/modules/rtp_rtcp/source/bitrate.cc |
index 4e9fc72c1f8ae79f4f2f631b3841848e581bccca..49a23592bfe8c4a988835f0ca09a211f62f8fbdf 100644 |
--- a/webrtc/modules/rtp_rtcp/source/bitrate.cc |
+++ b/webrtc/modules/rtp_rtcp/source/bitrate.cc |
@@ -11,13 +11,11 @@ |
#include "webrtc/modules/rtp_rtcp/source/bitrate.h" |
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
namespace webrtc { |
Bitrate::Bitrate(Clock* clock, Observer* observer) |
: clock_(clock), |
- crit_(CriticalSectionWrapper::CreateCriticalSection()), |
packet_rate_(0), |
bitrate_(0), |
bitrate_next_idx_(0), |
@@ -33,23 +31,23 @@ Bitrate::Bitrate(Clock* clock, Observer* observer) |
Bitrate::~Bitrate() {} |
void Bitrate::Update(const size_t bytes) { |
- CriticalSectionScoped cs(crit_.get()); |
+ rtc::CritScope cs(&crit_); |
bytes_count_ += bytes; |
packet_count_++; |
} |
uint32_t Bitrate::PacketRate() const { |
- CriticalSectionScoped cs(crit_.get()); |
+ rtc::CritScope cs(&crit_); |
return packet_rate_; |
} |
uint32_t Bitrate::BitrateLast() const { |
- CriticalSectionScoped cs(crit_.get()); |
+ rtc::CritScope cs(&crit_); |
return bitrate_; |
} |
uint32_t Bitrate::BitrateNow() const { |
- CriticalSectionScoped cs(crit_.get()); |
+ rtc::CritScope cs(&crit_); |
int64_t now = clock_->TimeInMilliseconds(); |
int64_t diff_ms = now - time_last_rate_update_; |
@@ -67,7 +65,7 @@ uint32_t Bitrate::BitrateNow() const { |
} |
int64_t Bitrate::time_last_rate_update() const { |
- CriticalSectionScoped cs(crit_.get()); |
+ rtc::CritScope cs(&crit_); |
return time_last_rate_update_; |
} |
@@ -75,7 +73,7 @@ int64_t Bitrate::time_last_rate_update() const { |
void Bitrate::Process() { |
BitrateStatistics stats; |
{ |
- CriticalSectionScoped cs(crit_.get()); |
+ rtc::CritScope cs(&crit_); |
int64_t now = clock_->CurrentNtpInMilliseconds(); |
int64_t diff_ms = now - time_last_rate_update_; |