Migrate modules/video_coding to webrtc::Mutex.

Bug: webrtc:11567
Change-Id: I8023fbe7595f7ba8ae7c7db3583fc2e560ec3df2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178803
Commit-Queue: Markus Handell <handellm@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31644}
diff --git a/modules/video_coding/frame_buffer2.cc b/modules/video_coding/frame_buffer2.cc
index 64d3699..88ac09c 100644
--- a/modules/video_coding/frame_buffer2.cc
+++ b/modules/video_coding/frame_buffer2.cc
@@ -82,7 +82,7 @@
   int64_t latest_return_time_ms =
       clock_->TimeInMilliseconds() + max_wait_time_ms;
 
-  rtc::CritScope lock(&crit_);
+  MutexLock lock(&mutex_);
   if (stopped_) {
     return;
   }
@@ -102,7 +102,7 @@
         RTC_DCHECK_RUN_ON(&callback_checker_);
         // If this task has not been cancelled, we did not get any new frames
         // while waiting. Continue with frame delivery.
-        rtc::CritScope lock(&crit_);
+        MutexLock lock(&mutex_);
         if (!frames_to_decode_.empty()) {
           // We have frames, deliver!
           frame_handler_(absl::WrapUnique(GetNextFrame()), kFrameFound);
@@ -329,19 +329,19 @@
 
 void FrameBuffer::SetProtectionMode(VCMVideoProtection mode) {
   TRACE_EVENT0("webrtc", "FrameBuffer::SetProtectionMode");
-  rtc::CritScope lock(&crit_);
+  MutexLock lock(&mutex_);
   protection_mode_ = mode;
 }
 
 void FrameBuffer::Start() {
   TRACE_EVENT0("webrtc", "FrameBuffer::Start");
-  rtc::CritScope lock(&crit_);
+  MutexLock lock(&mutex_);
   stopped_ = false;
 }
 
 void FrameBuffer::Stop() {
   TRACE_EVENT0("webrtc", "FrameBuffer::Stop");
-  rtc::CritScope lock(&crit_);
+  MutexLock lock(&mutex_);
   if (stopped_)
     return;
   stopped_ = true;
@@ -350,12 +350,12 @@
 }
 
 void FrameBuffer::Clear() {
-  rtc::CritScope lock(&crit_);
+  MutexLock lock(&mutex_);
   ClearFramesAndHistory();
 }
 
 void FrameBuffer::UpdateRtt(int64_t rtt_ms) {
-  rtc::CritScope lock(&crit_);
+  MutexLock lock(&mutex_);
   jitter_estimator_.UpdateRtt(rtt_ms);
 }
 
@@ -431,7 +431,7 @@
   TRACE_EVENT0("webrtc", "FrameBuffer::InsertFrame");
   RTC_DCHECK(frame);
 
-  rtc::CritScope lock(&crit_);
+  MutexLock lock(&mutex_);
 
   const VideoLayerFrameId& id = frame->id;
   int64_t last_continuous_picture_id =
@@ -529,7 +529,7 @@
     // to return from NextFrame.
     if (callback_queue_) {
       callback_queue_->PostTask([this] {
-        rtc::CritScope lock(&crit_);
+        MutexLock lock(&mutex_);
         if (!callback_task_.Running())
           return;
         RTC_CHECK(frame_handler_);