Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: webrtc/base/timestampaligner.cc

Issue 2270773002: Add ThreadChecker to the TimestampAligner class. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/timestampaligner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/timestampaligner.cc
diff --git a/webrtc/base/timestampaligner.cc b/webrtc/base/timestampaligner.cc
index e03e4fb04eb9ca85a891c580f6335a46be46e8f8..66724399fe6daebdfc7fe118a29210921577bfa0 100644
--- a/webrtc/base/timestampaligner.cc
+++ b/webrtc/base/timestampaligner.cc
@@ -13,11 +13,16 @@
namespace rtc {
-TimestampAligner::TimestampAligner() : frames_seen_(0), offset_us_(0) {}
+TimestampAligner::TimestampAligner() : frames_seen_(0), offset_us_(0) {
+ thread_checker_.DetachFromThread();
+}
+
TimestampAligner::~TimestampAligner() {}
int64_t TimestampAligner::UpdateOffset(int64_t camera_time_us,
int64_t system_time_us) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+
// Estimate the offset between system monotonic time and the capture
// time from the camera. The camera is assumed to provide more
// accurate timestamps than we get from the system time. But the
@@ -86,6 +91,8 @@ int64_t TimestampAligner::UpdateOffset(int64_t camera_time_us,
int64_t TimestampAligner::ClipTimestamp(int64_t time_us,
int64_t system_time_us) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+
// Make timestamps monotonic.
if (!prev_translated_time_us_) {
// Initialize.
« no previous file with comments | « webrtc/base/timestampaligner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698