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

Unified Diff: webrtc/video/stream_synchronization_unittest.cc

Issue 2574133003: Make class of static functions in rtp_to_ntp.h: (Closed)
Patch Set: address comments Created 4 years 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/video/stream_synchronization.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/stream_synchronization_unittest.cc
diff --git a/webrtc/video/stream_synchronization_unittest.cc b/webrtc/video/stream_synchronization_unittest.cc
index 770bbf6eebd56aced50f89d394bea406c8718cb1..d5607a8c87c2782cae6f43da2f8b4ca22d37a5ff 100644
--- a/webrtc/video/stream_synchronization_unittest.cc
+++ b/webrtc/video/stream_synchronization_unittest.cc
@@ -34,13 +34,6 @@ class Time {
: kNtpJan1970(2208988800UL),
time_now_ms_(offset) {}
- RtcpMeasurement GenerateRtcp(int frequency, uint32_t offset) const {
- RtcpMeasurement rtcp;
- rtcp.ntp_time = GetNowNtp();
- rtcp.rtp_timestamp = GetNowRtp(frequency, offset);
- return rtcp;
- }
-
NtpTime GetNowNtp() const {
uint32_t ntp_secs = time_now_ms_ / 1000 + kNtpJan1970;
int64_t remainder_ms = time_now_ms_ % 1000;
@@ -104,29 +97,29 @@ class StreamSynchronizationTest : public ::testing::Test {
StreamSynchronization::Measurements audio;
StreamSynchronization::Measurements video;
// Generate NTP/RTP timestamp pair for both streams corresponding to RTCP.
- RtcpMeasurement rtcp =
- send_time_->GenerateRtcp(audio_frequency, audio_offset);
- EXPECT_TRUE(UpdateRtcpList(rtcp.ntp_time.seconds(),
- rtcp.ntp_time.fractions(), rtcp.rtp_timestamp,
- &audio.rtcp, &new_sr));
+ NtpTime ntp_time = send_time_->GetNowNtp();
+ uint32_t rtp_timestamp =
+ send_time_->GetNowRtp(audio_frequency, audio_offset);
+ EXPECT_TRUE(audio.rtp_to_ntp.UpdateMeasurements(
+ ntp_time.seconds(), ntp_time.fractions(), rtp_timestamp, &new_sr));
send_time_->IncreaseTimeMs(100);
receive_time_->IncreaseTimeMs(100);
- rtcp = send_time_->GenerateRtcp(video_frequency, video_offset);
- EXPECT_TRUE(UpdateRtcpList(rtcp.ntp_time.seconds(),
- rtcp.ntp_time.fractions(), rtcp.rtp_timestamp,
- &video.rtcp, &new_sr));
+ ntp_time = send_time_->GetNowNtp();
+ rtp_timestamp = send_time_->GetNowRtp(video_frequency, video_offset);
+ EXPECT_TRUE(video.rtp_to_ntp.UpdateMeasurements(
+ ntp_time.seconds(), ntp_time.fractions(), rtp_timestamp, &new_sr));
send_time_->IncreaseTimeMs(900);
receive_time_->IncreaseTimeMs(900);
- rtcp = send_time_->GenerateRtcp(audio_frequency, audio_offset);
- EXPECT_TRUE(UpdateRtcpList(rtcp.ntp_time.seconds(),
- rtcp.ntp_time.fractions(), rtcp.rtp_timestamp,
- &audio.rtcp, &new_sr));
+ ntp_time = send_time_->GetNowNtp();
+ rtp_timestamp = send_time_->GetNowRtp(audio_frequency, audio_offset);
+ EXPECT_TRUE(audio.rtp_to_ntp.UpdateMeasurements(
+ ntp_time.seconds(), ntp_time.fractions(), rtp_timestamp, &new_sr));
send_time_->IncreaseTimeMs(100);
receive_time_->IncreaseTimeMs(100);
- rtcp = send_time_->GenerateRtcp(video_frequency, video_offset);
- EXPECT_TRUE(UpdateRtcpList(rtcp.ntp_time.seconds(),
- rtcp.ntp_time.fractions(), rtcp.rtp_timestamp,
- &video.rtcp, &new_sr));
+ ntp_time = send_time_->GetNowNtp();
+ rtp_timestamp = send_time_->GetNowRtp(video_frequency, video_offset);
+ EXPECT_TRUE(video.rtp_to_ntp.UpdateMeasurements(
+ ntp_time.seconds(), ntp_time.fractions(), rtp_timestamp, &new_sr));
send_time_->IncreaseTimeMs(900);
receive_time_->IncreaseTimeMs(900);
« no previous file with comments | « webrtc/video/stream_synchronization.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698