From cd621a8657c104b2591781bb20fddd367af3b5bc Mon Sep 17 00:00:00 2001 From: "asapersson@webrtc.org" Date: Tue, 11 Nov 2014 09:40:19 +0000 Subject: [PATCH] Add thread annotations to overuse_frame_detector class. R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/29029004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7678 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/video_engine/overuse_frame_detector.h | 37 ++++++++++---------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/webrtc/video_engine/overuse_frame_detector.h b/webrtc/video_engine/overuse_frame_detector.h index f90a4f8250..f92971ea60 100644 --- a/webrtc/video_engine/overuse_frame_detector.h +++ b/webrtc/video_engine/overuse_frame_detector.h @@ -13,6 +13,7 @@ #include "webrtc/base/constructormagic.h" #include "webrtc/base/exp_filter.h" +#include "webrtc/base/thread_annotations.h" #include "webrtc/modules/interface/module.h" #include "webrtc/system_wrappers/interface/scoped_ptr.h" #include "webrtc/video_engine/include/vie_base.h" @@ -107,30 +108,30 @@ class OveruseFrameDetector : public Module { class CaptureQueueDelay; class FrameQueue; - void AddProcessingTime(int elapsed_ms); + void AddProcessingTime(int elapsed_ms) EXCLUSIVE_LOCKS_REQUIRED(crit_); - bool IsOverusing(); - bool IsUnderusing(int64_t time_now); + bool IsOverusing() EXCLUSIVE_LOCKS_REQUIRED(crit_); + bool IsUnderusing(int64_t time_now) EXCLUSIVE_LOCKS_REQUIRED(crit_); - bool FrameTimeoutDetected(int64_t now) const; - bool FrameSizeChanged(int num_pixels) const; + bool FrameTimeoutDetected(int64_t now) const EXCLUSIVE_LOCKS_REQUIRED(crit_); + bool FrameSizeChanged(int num_pixels) const EXCLUSIVE_LOCKS_REQUIRED(crit_); - void ResetAll(int num_pixels); + void ResetAll(int num_pixels) EXCLUSIVE_LOCKS_REQUIRED(crit_); // Protecting all members. scoped_ptr crit_; // Observer getting overuse reports. - CpuOveruseObserver* observer_; + CpuOveruseObserver* observer_ GUARDED_BY(crit_); - CpuOveruseOptions options_; + CpuOveruseOptions options_ GUARDED_BY(crit_); Clock* clock_; int64_t next_process_time_; - int64_t num_process_times_; + int64_t num_process_times_ GUARDED_BY(crit_); - Statistics capture_deltas_; - int64_t last_capture_time_; + Statistics capture_deltas_ GUARDED_BY(crit_); + int64_t last_capture_time_ GUARDED_BY(crit_); int64_t last_overuse_time_; int checks_above_threshold_; @@ -141,15 +142,15 @@ class OveruseFrameDetector : public Module { int current_rampup_delay_ms_; // Number of pixels of last captured frame. - int num_pixels_; + int num_pixels_ GUARDED_BY(crit_); - int64_t last_encode_sample_ms_; - scoped_ptr encode_time_; - scoped_ptr usage_; - scoped_ptr frame_queue_; - int64_t last_sample_time_ms_; + int64_t last_encode_sample_ms_ GUARDED_BY(crit_); + scoped_ptr encode_time_ GUARDED_BY(crit_); + scoped_ptr usage_ GUARDED_BY(crit_); + scoped_ptr frame_queue_ GUARDED_BY(crit_); + int64_t last_sample_time_ms_ GUARDED_BY(crit_); - scoped_ptr capture_queue_delay_; + scoped_ptr capture_queue_delay_ GUARDED_BY(crit_); DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector); };