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

Unified Diff: webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc

Issue 2385763002: Add stats for frequency offset when converting RTP timestamp to NTP time. (Closed)
Patch Set: Created 4 years, 2 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/system_wrappers/source/rtp_to_ntp_unittest.cc
diff --git a/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc b/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc
index 5ba3353f43cb60112ac6d0b6419273a9d41a9e16..f9f9fb71928f876de15f32092c7aa2549b348cde 100644
--- a/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc
+++ b/webrtc/system_wrappers/source/rtp_to_ntp_unittest.cc
@@ -150,6 +150,23 @@ TEST(RtpToNtpTests, FailsForDecreasingRtpTimestamp) {
EXPECT_FALSE(RtpToNtpMs(kTimestamp1, rtcp, &timestamp_in_ms));
}
+TEST(RtpToNtpTests, RtpToNtpMsWithReturnedFrequency) {
+ const uint32_t kNtpSec1 = 3683354930;
+ const uint32_t kNtpFrac1 = 699925050;
+ const uint32_t kTimestamp1 = 2192705742;
+ const uint32_t kNtpSec2 = kNtpSec1;
+ const uint32_t kNtpFrac2 = kNtpFrac1 + kOneMsInNtpFrac;
+ const uint32_t kTimestamp2 = kTimestamp1 + kTimestampTicksPerMs;
+ RtcpList rtcp;
+ rtcp.push_front(RtcpMeasurement(kNtpSec1, kNtpFrac1, kTimestamp1));
+ rtcp.push_front(RtcpMeasurement(kNtpSec2, kNtpFrac2, kTimestamp2));
+ int64_t timestamp_in_ms;
+ double freq_khz;
+ EXPECT_TRUE(
+ RtpToNtpMsAndReturnFreq(kTimestamp1, rtcp, &timestamp_in_ms, &freq_khz));
+ EXPECT_DOUBLE_EQ(90.0, freq_khz);
+}
+
TEST(UpdateRtcpListTests, InjectRtcpSrWithEqualNtp) {
RtcpList rtcp;
uint32_t ntp_sec = 0;

Powered by Google App Engine
This is Rietveld 408576698