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

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

Issue 2017443003: Implement timestamp translation/filter in VideoCapturer. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Moved timestamp filtering logic to a separate class. Created 4 years, 6 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
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC Project Authors. All rights reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_BASE_TIMESTAMPALIGNER_H_
12 #define WEBRTC_BASE_TIMESTAMPALIGNER_H_
13
14 #include "webrtc/base/basictypes.h"
15 #include "webrtc/base/constructormagic.h"
16 #include "webrtc/base/optional.h"
17
18 namespace rtc {
19
20 class TimestampAligner {
21 public:
22 TimestampAligner();
23
24 public:
25 // Update the estimated offset between camera time and system monotonic time.
26 int64_t UpdateOffset(int64_t camera_time_us, int64_t system_time_us);
27
28 int64_t ClipTimestamp(int64_t filtered_time_us, int64_t system_time_us);
29
30 private:
31 // State for the timestamp translation.
32 int frames_seen_;
33 // Estimated offset between camera time and system monotonic time.
34 int64_t offset_us_;
35
36 // State for timestamp clipping, applied after the filter, to ensure
37 // that translated timestamps are monotonic and not in the future.
38 // Subtracted from the translated timestamps.
39 int64_t clip_bias_us_;
40 rtc::Optional<int64_t> prev_translated_time_us_;
41 RTC_DISALLOW_COPY_AND_ASSIGN(TimestampAligner);
42 };
43
44 } // namespace rtc
45
46 #endif // WEBRTC_BASE_TIMESTAMPALIGNER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698