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

Side by Side Diff: webrtc/video/receive_statistics_proxy_unittest.cc

Issue 2627463004: Make the new jitter buffer the default jitter buffer. (Closed)
Patch Set: Feedback fixes. Created 3 years, 11 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
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); 67 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type);
68 } 68 }
69 69
70 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) { 70 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) {
71 const char* kName = "decoderName"; 71 const char* kName = "decoderName";
72 statistics_proxy_->OnDecoderImplementationName(kName); 72 statistics_proxy_->OnDecoderImplementationName(kName);
73 EXPECT_STREQ( 73 EXPECT_STREQ(
74 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str()); 74 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str());
75 } 75 }
76 76
77 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsIncomingRate) { 77 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnCompleteFrame) {
78 const int kFramerate = 28; 78 const int kFrameSizeBytes = 1000;
79 const int kBitrateBps = 311000; 79 statistics_proxy_->OnCompleteFrame(true, kFrameSizeBytes);
80 statistics_proxy_->OnIncomingRate(kFramerate, kBitrateBps); 80 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats();
81 EXPECT_EQ(kFramerate, statistics_proxy_->GetStats().network_frame_rate); 81 EXPECT_EQ(1, stats.network_frame_rate);
82 EXPECT_EQ(kBitrateBps, statistics_proxy_->GetStats().total_bitrate_bps); 82 EXPECT_EQ(kFrameSizeBytes * 8, stats.total_bitrate_bps);
83 EXPECT_EQ(1, stats.frame_counts.key_frames);
84 EXPECT_EQ(0, stats.frame_counts.delta_frames);
83 } 85 }
84 86
85 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { 87 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) {
86 const int kDecodeMs = 1; 88 const int kDecodeMs = 1;
87 const int kMaxDecodeMs = 2; 89 const int kMaxDecodeMs = 2;
88 const int kCurrentDelayMs = 3; 90 const int kCurrentDelayMs = 3;
89 const int kTargetDelayMs = 4; 91 const int kTargetDelayMs = 4;
90 const int kJitterBufferMs = 5; 92 const int kJitterBufferMs = 5;
91 const int kMinPlayoutDelayMs = 6; 93 const int kMinPlayoutDelayMs = 6;
92 const int kRenderDelayMs = 7; 94 const int kRenderDelayMs = 7;
93 const int64_t kRttMs = 8; 95 const int64_t kRttMs = 8;
94 statistics_proxy_->OnDecoderTiming( 96 statistics_proxy_->OnRttUpdate(kRttMs, 0);
97 statistics_proxy_->OnFrameBufferTimingsUpdated(
95 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs, 98 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs,
96 kMinPlayoutDelayMs, kRenderDelayMs, kRttMs); 99 kMinPlayoutDelayMs, kRenderDelayMs);
97 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); 100 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats();
98 EXPECT_EQ(kDecodeMs, stats.decode_ms); 101 EXPECT_EQ(kDecodeMs, stats.decode_ms);
99 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms); 102 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms);
100 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms); 103 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms);
101 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms); 104 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms);
102 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms); 105 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms);
103 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms); 106 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms);
104 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); 107 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms);
105 } 108 }
106 109
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 codec_info.codecType = kVideoCodecVP8; 315 codec_info.codecType = kVideoCodecVP8;
313 316
314 for (int i = 0; i < kMinRequiredSamples; ++i) 317 for (int i = 0; i < kMinRequiredSamples; ++i)
315 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); 318 statistics_proxy_->OnPreDecode(encoded_image, &codec_info);
316 319
317 statistics_proxy_.reset(); 320 statistics_proxy_.reset();
318 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); 321 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp"));
319 } 322 }
320 323
321 } // namespace webrtc 324 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698