Index: webrtc/video/encoder_state_feedback.cc |
diff --git a/webrtc/video/encoder_state_feedback.cc b/webrtc/video/encoder_state_feedback.cc |
index c0c4b67dbd0d12af3960e76a0c33f25d1d53b7c7..f0b03a13fef4a15f3206d74bd17cd62b7d5ced27 100644 |
--- a/webrtc/video/encoder_state_feedback.cc |
+++ b/webrtc/video/encoder_state_feedback.cc |
@@ -14,7 +14,6 @@ |
#include "webrtc/base/checks.h" |
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
#include "webrtc/video/vie_encoder.h" |
namespace webrtc { |
@@ -47,8 +46,7 @@ class EncoderStateFeedbackObserver : public RtcpIntraFrameObserver { |
}; |
EncoderStateFeedback::EncoderStateFeedback() |
- : crit_(CriticalSectionWrapper::CreateCriticalSection()), |
- observer_(new EncoderStateFeedbackObserver(this)) {} |
+ : observer_(new EncoderStateFeedbackObserver(this)) {} |
EncoderStateFeedback::~EncoderStateFeedback() { |
assert(encoders_.empty()); |
@@ -57,7 +55,7 @@ EncoderStateFeedback::~EncoderStateFeedback() { |
void EncoderStateFeedback::AddEncoder(const std::vector<uint32_t>& ssrcs, |
ViEEncoder* encoder) { |
RTC_DCHECK(!ssrcs.empty()); |
- CriticalSectionScoped lock(crit_.get()); |
+ rtc::CritScope lock(&crit_); |
for (uint32_t ssrc : ssrcs) { |
RTC_DCHECK(encoders_.find(ssrc) == encoders_.end()); |
encoders_[ssrc] = encoder; |
@@ -65,7 +63,7 @@ void EncoderStateFeedback::AddEncoder(const std::vector<uint32_t>& ssrcs, |
} |
void EncoderStateFeedback::RemoveEncoder(const ViEEncoder* encoder) { |
- CriticalSectionScoped lock(crit_.get()); |
+ rtc::CritScope lock(&crit_); |
SsrcEncoderMap::iterator it = encoders_.begin(); |
while (it != encoders_.end()) { |
if (it->second == encoder) { |
@@ -81,7 +79,7 @@ RtcpIntraFrameObserver* EncoderStateFeedback::GetRtcpIntraFrameObserver() { |
} |
void EncoderStateFeedback::OnReceivedIntraFrameRequest(uint32_t ssrc) { |
- CriticalSectionScoped lock(crit_.get()); |
+ rtc::CritScope lock(&crit_); |
SsrcEncoderMap::iterator it = encoders_.find(ssrc); |
if (it == encoders_.end()) |
return; |
@@ -90,7 +88,7 @@ void EncoderStateFeedback::OnReceivedIntraFrameRequest(uint32_t ssrc) { |
} |
void EncoderStateFeedback::OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) { |
- CriticalSectionScoped lock(crit_.get()); |
+ rtc::CritScope lock(&crit_); |
SsrcEncoderMap::iterator it = encoders_.find(ssrc); |
if (it == encoders_.end()) |
return; |
@@ -99,7 +97,7 @@ void EncoderStateFeedback::OnReceivedSLI(uint32_t ssrc, uint8_t picture_id) { |
} |
void EncoderStateFeedback::OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) { |
- CriticalSectionScoped lock(crit_.get()); |
+ rtc::CritScope lock(&crit_); |
SsrcEncoderMap::iterator it = encoders_.find(ssrc); |
if (it == encoders_.end()) |
return; |
@@ -109,7 +107,7 @@ void EncoderStateFeedback::OnReceivedRPSI(uint32_t ssrc, uint64_t picture_id) { |
void EncoderStateFeedback::OnLocalSsrcChanged(uint32_t old_ssrc, |
uint32_t new_ssrc) { |
- CriticalSectionScoped lock(crit_.get()); |
+ rtc::CritScope lock(&crit_); |
SsrcEncoderMap::iterator it = encoders_.find(old_ssrc); |
if (it == encoders_.end() || encoders_.find(new_ssrc) != encoders_.end()) { |
return; |