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

Side by Side Diff: webrtc/base/timestampaligner.h

Issue 2325563002: New method TimestampAligner::TranslateTimestamp (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/base/timestampaligner.cc » ('j') | webrtc/base/timestampaligner.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC Project Authors. All rights reserved. 2 * Copyright (c) 2016 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_BASE_TIMESTAMPALIGNER_H_ 11 #ifndef WEBRTC_BASE_TIMESTAMPALIGNER_H_
12 #define WEBRTC_BASE_TIMESTAMPALIGNER_H_ 12 #define WEBRTC_BASE_TIMESTAMPALIGNER_H_
13 13
14 #include "webrtc/base/basictypes.h" 14 #include "webrtc/base/basictypes.h"
15 #include "webrtc/base/constructormagic.h" 15 #include "webrtc/base/constructormagic.h"
16 #include "webrtc/base/optional.h" 16 #include "webrtc/base/optional.h"
17 17
18 namespace rtc { 18 namespace rtc {
19 19
20 // This class is not thread safe, so all calls to it must be synchronized 20 // This class is not thread safe, so all calls to it must be synchronized
21 // externally. 21 // externally.
22 class TimestampAligner { 22 class TimestampAligner {
perkj_webrtc 2016/09/08 07:25:23 Can you add a comment about how to use this. And
nisse-webrtc 2016/09/08 08:14:09 Regardless of my other comment, I agree it makes s
23 public: 23 public:
24 TimestampAligner(); 24 TimestampAligner();
25 ~TimestampAligner(); 25 ~TimestampAligner();
26 26
27 public: 27 public:
28 // Update the estimated offset between camera time and system monotonic time. 28 // Update the estimated offset between camera time and system monotonic time.
29 int64_t UpdateOffset(int64_t camera_time_us, int64_t system_time_us); 29 int64_t UpdateOffset(int64_t camera_time_us, int64_t system_time_us);
30 30
31 // Clip timestamp, it should larger than the previous timestamp but
perkj_webrtc 2016/09/08 07:25:23 please clarify this sentence. change should to to
nisse-webrtc 2016/09/08 08:14:09 Done.
32 // no larger than current system time.
31 int64_t ClipTimestamp(int64_t filtered_time_us, int64_t system_time_us); 33 int64_t ClipTimestamp(int64_t filtered_time_us, int64_t system_time_us);
32 34
33 private: 35 private:
34 // State for the timestamp translation. 36 // State for the timestamp translation.
35 int frames_seen_; 37 int frames_seen_;
36 // Estimated offset between camera time and system monotonic time. 38 // Estimated offset between camera time and system monotonic time.
37 int64_t offset_us_; 39 int64_t offset_us_;
38 40
39 // State for timestamp clipping, applied after the filter, to ensure 41 // State for timestamp clipping, applied after the filter, to ensure
40 // that translated timestamps are monotonic and not in the future. 42 // that translated timestamps are monotonic and not in the future.
41 // Subtracted from the translated timestamps. 43 // Subtracted from the translated timestamps.
42 int64_t clip_bias_us_; 44 int64_t clip_bias_us_;
43 rtc::Optional<int64_t> prev_translated_time_us_; 45 rtc::Optional<int64_t> prev_translated_time_us_;
44 RTC_DISALLOW_COPY_AND_ASSIGN(TimestampAligner); 46 RTC_DISALLOW_COPY_AND_ASSIGN(TimestampAligner);
45 }; 47 };
46 48
47 } // namespace rtc 49 } // namespace rtc
48 50
49 #endif // WEBRTC_BASE_TIMESTAMPALIGNER_H_ 51 #endif // WEBRTC_BASE_TIMESTAMPALIGNER_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/timestampaligner.cc » ('j') | webrtc/base/timestampaligner.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698