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

Unified Diff: webrtc/media/engine/webrtcvideoengine2_unittest.cc

Issue 1865283002: Use microsecond timestamp in cricket::VideoFrame. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Revert conversion, trust that CapturedFrame timestamps are right. Created 4 years, 8 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
Index: webrtc/media/engine/webrtcvideoengine2_unittest.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
index e1f540660f2f87a96b0acbbf9168beb89e9c6a6f..f720d37d003ff597f93ca8e7ddbea6d31b558b5e 100644
--- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc
+++ b/webrtc/media/engine/webrtcvideoengine2_unittest.cc
@@ -483,6 +483,8 @@ TEST_F(WebRtcVideoEngine2Test, PropagatesInputFrameTimestamp) {
EXPECT_TRUE(channel->RemoveSendStream(kSsrc));
}
+// TODO(nisse): This test should be no longer needed when the
perkj_webrtc 2016/04/08 14:52:18 why not?
nisse-webrtc 2016/04/11 06:58:56 Because it should be the responsibility of whoever
+// timestamp_us refactoring is done.
TEST_F(WebRtcVideoEngine2Test,
ProducesIncreasingTimestampsWithResetInputSources) {
cricket::FakeWebRtcVideoEncoderFactory encoder_factory;
@@ -512,8 +514,8 @@ TEST_F(WebRtcVideoEngine2Test,
std::unique_ptr<char[]> data(new char[frame.data_size]);
frame.data = data.get();
memset(frame.data, 1, frame.data_size);
- const int kInitialTimestamp = 123456;
- frame.time_stamp = kInitialTimestamp;
+ int64_t initial_timestamp = rtc::TimeNanos();
+ frame.time_stamp = initial_timestamp;
// Deliver initial frame.
capturer1.SignalCapturedFrame(&frame);
@@ -531,7 +533,7 @@ TEST_F(WebRtcVideoEngine2Test,
rtc::Thread::Current()->SleepMs(1);
// Deliver with a timestamp (10 seconds) before the previous initial one,
// these should not be related at all anymore and it should still work fine.
- frame.time_stamp = kInitialTimestamp - 10000;
+ frame.time_stamp = initial_timestamp - 10 * rtc::kNumNanosecsPerSec;;
capturer2.SignalCapturedFrame(&frame);
// New timestamp should be at least 1ms in the future and not old.

Powered by Google App Engine
This is Rietveld 408576698