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

Issue 2017443003: Implement timestamp translation/filter in VideoCapturer. (Closed)

Created:
4 years, 7 months ago by nisse-webrtc
Modified:
4 years, 6 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, the sun, danilchap, sprang_webrtc
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Implement timestamp translation/filter in VideoCapturer. Use in AndroidVideoCapturer. BUG=webrtc:5740 Committed: https://crrev.com/191b359d0de8cb9d2f05e708bd19bf66c1624805 Cr-Commit-Position: refs/heads/master@{#13254}

Patch Set 1 #

Patch Set 2 : Fix android build. #

Total comments: 8

Patch Set 3 : Fix offset update equation, and nits. #

Total comments: 16

Patch Set 4 : Minor improvements to comments, formatting, etc. #

Patch Set 5 : Fixes for tests. #

Patch Set 6 : Rebase. #

Total comments: 18

Patch Set 7 : Add filter reset. Improve comments and naming. #

Patch Set 8 : Simplify filter reset. Drop hack to detect if camera time and system time are the same. #

Total comments: 4

Patch Set 9 : Reset logic based on error between estimate and measurement. Deleted obsolete test. #

Patch Set 10 : Revert unused VideoFrameFactory changes. Add missing braces. #

Patch Set 11 : Add * operators in comment equations. #

Patch Set 12 : Implement timestamp clipping. #

Patch Set 13 : Formatting. #

Total comments: 12

Patch Set 14 : Parameterize tests of timestamp filter. #

Total comments: 1

Patch Set 15 : Moved timestamp filtering logic to a separate class. #

Total comments: 2

Patch Set 16 : Comment and format fixes. #include <algorithms>. #

Patch Set 17 : Undo left-over change to videocapturer_unittest.cc. #

Patch Set 18 : Rebase. #

Patch Set 19 : Add explicit destructor, required by chromium style. #

Patch Set 20 : Add missing include of math.h. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+356 lines, -19 lines) Patch
M webrtc/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/api/java/jni/androidvideocapturer_jni.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +19 lines, -11 lines 0 comments Download
M webrtc/base/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/base/base.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
A webrtc/base/timestampaligner.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +47 lines, -0 lines 0 comments Download
A webrtc/base/timestampaligner.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +107 lines, -0 lines 0 comments Download
A webrtc/base/timestampaligner_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +133 lines, -0 lines 0 comments Download
M webrtc/media/base/videocapturer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +20 lines, -2 lines 0 comments Download
M webrtc/media/base/videocapturer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +24 lines, -6 lines 0 comments Download
M webrtc/webrtc_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 77 (23 generated)
nisse-webrtc
Please have a first look. This is the timestamp translation filter. I think it's both ...
4 years, 7 months ago (2016-05-26 12:31:41 UTC) #2
stefan-webrtc
+qiangchen who this likely is interesting to as well.
4 years, 7 months ago (2016-05-26 18:27:06 UTC) #4
qiangchen
I think I found a math error in the code. Can you double check that? ...
4 years, 7 months ago (2016-05-26 20:01:35 UTC) #5
stefan-webrtc
https://codereview.webrtc.org/2017443003/diff/20001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/20001/webrtc/media/base/videocapturer.cc#newcode266 webrtc/media/base/videocapturer.cc:266: static const int64_t kDelayLimit = 50 * rtc::kNumMicrosecsPerMillisec; Maybe ...
4 years, 6 months ago (2016-05-27 00:49:10 UTC) #6
stefan-webrtc
4 years, 6 months ago (2016-05-27 00:49:11 UTC) #7
nisse-webrtc
On 2016/05/26 20:01:35, qiangchenC wrote: > I think I found a math error in the ...
4 years, 6 months ago (2016-05-27 07:22:14 UTC) #8
nisse-webrtc
Fixed the error in the averaging. I wonder how to go about fixing (and extending) ...
4 years, 6 months ago (2016-05-27 09:47:33 UTC) #9
qiangchen
lgtm https://codereview.webrtc.org/2017443003/diff/20001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/20001/webrtc/media/base/videocapturer.cc#newcode278 webrtc/media/base/videocapturer.cc:278: offset_us_ += diff_us / frames_seen_; On 2016/05/27 09:47:32, ...
4 years, 6 months ago (2016-05-27 15:43:50 UTC) #10
stefan-webrtc
I would have used the Clock/SimulatedClock for testing.
4 years, 6 months ago (2016-05-27 16:21:25 UTC) #11
pthatcher1
On 2016/05/27 16:21:25, stefan-webrtc (holmer) wrote: > I would have used the Clock/SimulatedClock for testing. ...
4 years, 6 months ago (2016-05-27 22:26:37 UTC) #12
pthatcher1
https://codereview.webrtc.org/2017443003/diff/40001/webrtc/api/java/jni/androidvideocapturer_jni.cc File webrtc/api/java/jni/androidvideocapturer_jni.cc (right): https://codereview.webrtc.org/2017443003/diff/40001/webrtc/api/java/jni/androidvideocapturer_jni.cc#newcode183 webrtc/api/java/jni/androidvideocapturer_jni.cc:183: int64_t time_us; Can you be a little more specific ...
4 years, 6 months ago (2016-05-27 22:47:44 UTC) #14
nisse-webrtc
On 2016/05/27 16:21:25, stefan-webrtc (holmer) wrote: > I would have used the Clock/SimulatedClock for testing. ...
4 years, 6 months ago (2016-05-30 07:06:41 UTC) #15
nisse-webrtc
I've addressed the simpler formatting and comment suggestions. https://codereview.webrtc.org/2017443003/diff/40001/webrtc/api/java/jni/androidvideocapturer_jni.cc File webrtc/api/java/jni/androidvideocapturer_jni.cc (right): https://codereview.webrtc.org/2017443003/diff/40001/webrtc/api/java/jni/androidvideocapturer_jni.cc#newcode183 webrtc/api/java/jni/androidvideocapturer_jni.cc:183: int64_t ...
4 years, 6 months ago (2016-05-30 08:57:30 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017443003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2017443003/80001
4 years, 6 months ago (2016-05-31 12:25:16 UTC) #18
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_compile_x86_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_compile_x86_dbg/builds/4306) ios64_gn_dbg on ...
4 years, 6 months ago (2016-05-31 12:26:28 UTC) #20
nisse-webrtc
Another update, where tests hopefully pass. Changes: 1. I disable use of the timestamp translator ...
4 years, 6 months ago (2016-05-31 12:33:45 UTC) #21
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017443003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2017443003/100001
4 years, 6 months ago (2016-05-31 12:45:03 UTC) #23
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_x64_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/win_x64_rel/builds/15134)
4 years, 6 months ago (2016-05-31 12:49:33 UTC) #25
stefan-webrtc
https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc#newcode270 webrtc/media/base/videocapturer.cc:270: } Why do we have to do this? https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc#newcode274 ...
4 years, 6 months ago (2016-06-08 11:28:42 UTC) #26
nisse-webrtc
https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc#newcode270 webrtc/media/base/videocapturer.cc:270: } On 2016/06/08 11:28:42, stefan-webrtc (holmer) wrote: > Why ...
4 years, 6 months ago (2016-06-09 10:02:58 UTC) #27
stefan-webrtc
https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc#newcode270 webrtc/media/base/videocapturer.cc:270: } On 2016/06/09 10:02:58, nisse-webrtc wrote: > On 2016/06/08 ...
4 years, 6 months ago (2016-06-09 11:59:09 UTC) #28
nisse-webrtc
https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/100001/webrtc/media/base/videocapturer.cc#newcode270 webrtc/media/base/videocapturer.cc:270: } On 2016/06/09 11:59:09, stefan-webrtc (holmer) wrote: > On ...
4 years, 6 months ago (2016-06-10 12:37:57 UTC) #29
stefan-webrtc
https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc#newcode263 webrtc/media/base/videocapturer.cc:263: || camera_time_us > prev_camera_time_us_ + kResetLimitUs) { Hm, what ...
4 years, 6 months ago (2016-06-10 13:13:31 UTC) #30
nisse-webrtc
https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc#newcode263 webrtc/media/base/videocapturer.cc:263: || camera_time_us > prev_camera_time_us_ + kResetLimitUs) { On 2016/06/10 ...
4 years, 6 months ago (2016-06-13 06:52:49 UTC) #31
stefan-webrtc
https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc#newcode263 webrtc/media/base/videocapturer.cc:263: || camera_time_us > prev_camera_time_us_ + kResetLimitUs) { On 2016/06/13 ...
4 years, 6 months ago (2016-06-13 08:56:01 UTC) #32
nisse-webrtc
https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/140001/webrtc/media/base/videocapturer.cc#newcode263 webrtc/media/base/videocapturer.cc:263: || camera_time_us > prev_camera_time_us_ + kResetLimitUs) { On 2016/06/13 ...
4 years, 6 months ago (2016-06-13 09:33:04 UTC) #33
stefan-webrtc
lgtm
4 years, 6 months ago (2016-06-13 21:10:24 UTC) #34
nisse-webrtc
Peter and peter: Please have a look, I'd like to get this landed in reasonable ...
4 years, 6 months ago (2016-06-14 08:17:51 UTC) #35
nisse-webrtc
+ mflodman Discussed with pbos. There are two potential problems with the filter: 1. There's ...
4 years, 6 months ago (2016-06-14 10:56:42 UTC) #37
nisse-webrtc
On 2016/06/14 10:56:42, nisse-webrtc wrote: > For (2), I'm pretty sure it can happen consistently ...
4 years, 6 months ago (2016-06-15 13:25:12 UTC) #38
nisse-webrtc
On 2016/06/15 13:25:12, nisse-webrtc wrote: > Discussed offline with sprang, and decided to start with ...
4 years, 6 months ago (2016-06-16 14:43:55 UTC) #39
sprang_webrtc
Just some minor comments https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer.cc File webrtc/media/base/videocapturer.cc (right): https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer.cc#newcode283 webrtc/media/base/videocapturer.cc:283: } Wow, quite extensive commenting ...
4 years, 6 months ago (2016-06-17 13:10:52 UTC) #42
nisse-webrtc
https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer.h File webrtc/media/base/videocapturer.h (right): https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer.h#newcode284 webrtc/media/base/videocapturer.h:284: // Access intended only for testing. On 2016/06/17 13:10:52, ...
4 years, 6 months ago (2016-06-17 13:43:01 UTC) #43
sprang_webrtc
https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer.h File webrtc/media/base/videocapturer.h (right): https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer.h#newcode284 webrtc/media/base/videocapturer.h:284: // Access intended only for testing. On 2016/06/17 13:43:01, ...
4 years, 6 months ago (2016-06-17 14:35:38 UTC) #44
nisse-webrtc
https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer_unittest.cc File webrtc/media/base/videocapturer_unittest.cc (right): https://codereview.webrtc.org/2017443003/diff/240001/webrtc/media/base/videocapturer_unittest.cc#newcode818 webrtc/media/base/videocapturer_unittest.cc:818: const int nframes = 2 * window_size; On 2016/06/17 ...
4 years, 6 months ago (2016-06-20 11:47:49 UTC) #45
pbos-webrtc
Consider breaking out this to a separate TimestampAligner class, perhaps in webrtc/base, we might want ...
4 years, 6 months ago (2016-06-21 12:18:31 UTC) #46
nisse-webrtc
On 2016/06/21 12:18:31, pbos-webrtc wrote: > Consider breaking out this to a separate TimestampAligner class, ...
4 years, 6 months ago (2016-06-21 13:44:43 UTC) #47
pbos-webrtc
Is there a test that makes sense that verifies that we're handling the case well ...
4 years, 6 months ago (2016-06-21 14:49:50 UTC) #48
nisse-webrtc
On 2016/06/21 14:49:50, pbos-webrtc wrote: > Is there a test that makes sense that verifies ...
4 years, 6 months ago (2016-06-22 07:03:13 UTC) #49
nisse-webrtc
https://codereview.webrtc.org/2017443003/diff/280001/webrtc/base/timestampaligner_unittest.cc File webrtc/base/timestampaligner_unittest.cc (right): https://codereview.webrtc.org/2017443003/diff/280001/webrtc/base/timestampaligner_unittest.cc#newcode20 webrtc/base/timestampaligner_unittest.cc:20: // by exponential averaging with weight 1/|window_size| for each ...
4 years, 6 months ago (2016-06-22 07:11:15 UTC) #50
sprang_webrtc
lgtm
4 years, 6 months ago (2016-06-22 08:26:44 UTC) #51
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017443003/320001
4 years, 6 months ago (2016-06-22 09:23:04 UTC) #53
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_clang_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_clang_dbg/builds/13997) android_gn_rel on ...
4 years, 6 months ago (2016-06-22 09:24:17 UTC) #55
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017443003/340001
4 years, 6 months ago (2016-06-22 09:35:19 UTC) #57
nisse-webrtc
Tommi: Please have a look. OWNER's approval needed.
4 years, 6 months ago (2016-06-22 09:37:47 UTC) #59
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_arm64_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios_arm64_dbg/builds/10756) ios_arm64_rel on ...
4 years, 6 months ago (2016-06-22 09:37:51 UTC) #61
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017443003/360001
4 years, 6 months ago (2016-06-22 09:44:39 UTC) #63
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: ios_arm64_dbg on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/ios_arm64_dbg/builds/10757) ios_dbg on ...
4 years, 6 months ago (2016-06-22 09:47:11 UTC) #65
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017443003/380001
4 years, 6 months ago (2016-06-22 10:15:15 UTC) #67
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-22 10:59:19 UTC) #69
tommi
Rs lgtm
4 years, 6 months ago (2016-06-22 14:53:50 UTC) #70
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017443003/380001
4 years, 6 months ago (2016-06-22 15:35:09 UTC) #73
commit-bot: I haz the power
Committed patchset #20 (id:380001)
4 years, 6 months ago (2016-06-22 15:36:59 UTC) #75
commit-bot: I haz the power
4 years, 6 months ago (2016-06-22 15:37:15 UTC) #77
Message was sent while issue was closed.
Patchset 20 (id:??) landed as
https://crrev.com/191b359d0de8cb9d2f05e708bd19bf66c1624805
Cr-Commit-Position: refs/heads/master@{#13254}

Powered by Google App Engine
This is Rietveld 408576698