diff --git a/webrtc/video_engine/vie_capturer.cc b/webrtc/video_engine/vie_capturer.cc index c976c45f68..1e49f4eb4f 100644 --- a/webrtc/video_engine/vie_capturer.cc +++ b/webrtc/video_engine/vie_capturer.cc @@ -511,7 +511,7 @@ bool ViECapturer::ViECaptureThreadFunction(void* obj) { bool ViECapturer::ViECaptureProcess() { if (capture_event_.Wait(kThreadWaitTimeMs) == kEventSignaled) { deliver_cs_->Enter(); - if (MaybeUpdateDeliverFrame()) { + if (SwapCapturedAndDeliverFrameIfAvailable()) { DeliverI420Frame(&deliver_frame_); } deliver_cs_->Leave(); @@ -646,7 +646,7 @@ void ViECapturer::OnNoPictureAlarm(const int32_t id, observer_->NoPictureAlarm(id, vie_alarm); } -bool ViECapturer::MaybeUpdateDeliverFrame() { +bool ViECapturer::SwapCapturedAndDeliverFrameIfAvailable() { CriticalSectionScoped cs(capture_cs_.get()); if (captured_frame_.IsZeroSize()) return false; diff --git a/webrtc/video_engine/vie_capturer.h b/webrtc/video_engine/vie_capturer.h index afb358ddeb..59c59b9446 100644 --- a/webrtc/video_engine/vie_capturer.h +++ b/webrtc/video_engine/vie_capturer.h @@ -144,7 +144,7 @@ class ViECapturer void DeliverCodedFrame(VideoFrame* video_frame); private: - bool MaybeUpdateDeliverFrame(); + bool SwapCapturedAndDeliverFrameIfAvailable(); // Never take capture_cs_ before deliver_cs_! scoped_ptr capture_cs_;