OLD | NEW |
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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); | 112 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); |
113 } | 113 } |
114 | 114 |
115 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) { | 115 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) { |
116 const char* kName = "decoderName"; | 116 const char* kName = "decoderName"; |
117 statistics_proxy_->OnDecoderImplementationName(kName); | 117 statistics_proxy_->OnDecoderImplementationName(kName); |
118 EXPECT_STREQ( | 118 EXPECT_STREQ( |
119 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str()); | 119 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str()); |
120 } | 120 } |
121 | 121 |
122 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsIncomingRate) { | 122 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnCompleteFrame) { |
123 const int kFramerate = 28; | 123 const int kFrameSizeBytes = 1000; |
124 const int kBitrateBps = 311000; | 124 statistics_proxy_->OnCompleteFrame(true, kFrameSizeBytes); |
125 statistics_proxy_->OnIncomingRate(kFramerate, kBitrateBps); | 125 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); |
126 EXPECT_EQ(kFramerate, statistics_proxy_->GetStats().network_frame_rate); | 126 EXPECT_EQ(1, stats.network_frame_rate); |
127 EXPECT_EQ(kBitrateBps, statistics_proxy_->GetStats().total_bitrate_bps); | 127 EXPECT_EQ(kFrameSizeBytes * 8, stats.total_bitrate_bps); |
| 128 EXPECT_EQ(1, stats.frame_counts.key_frames); |
| 129 EXPECT_EQ(0, stats.frame_counts.delta_frames); |
128 } | 130 } |
129 | 131 |
130 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { | 132 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { |
131 const int kDecodeMs = 1; | 133 const int kDecodeMs = 1; |
132 const int kMaxDecodeMs = 2; | 134 const int kMaxDecodeMs = 2; |
133 const int kCurrentDelayMs = 3; | 135 const int kCurrentDelayMs = 3; |
134 const int kTargetDelayMs = 4; | 136 const int kTargetDelayMs = 4; |
135 const int kJitterBufferMs = 5; | 137 const int kJitterBufferMs = 5; |
136 const int kMinPlayoutDelayMs = 6; | 138 const int kMinPlayoutDelayMs = 6; |
137 const int kRenderDelayMs = 7; | 139 const int kRenderDelayMs = 7; |
138 const int64_t kRttMs = 8; | 140 const int64_t kRttMs = 8; |
139 statistics_proxy_->OnDecoderTiming( | 141 statistics_proxy_->OnRttUpdate(kRttMs, 0); |
| 142 statistics_proxy_->OnFrameBufferTimingsUpdated( |
140 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs, | 143 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs, |
141 kMinPlayoutDelayMs, kRenderDelayMs, kRttMs); | 144 kMinPlayoutDelayMs, kRenderDelayMs); |
142 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); | 145 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); |
143 EXPECT_EQ(kDecodeMs, stats.decode_ms); | 146 EXPECT_EQ(kDecodeMs, stats.decode_ms); |
144 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms); | 147 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms); |
145 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms); | 148 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms); |
146 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms); | 149 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms); |
147 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms); | 150 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms); |
148 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms); | 151 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms); |
149 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); | 152 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); |
150 } | 153 } |
151 | 154 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 codec_info.codecType = kVideoCodecVP8; | 389 codec_info.codecType = kVideoCodecVP8; |
387 | 390 |
388 for (int i = 0; i < kMinRequiredSamples; ++i) | 391 for (int i = 0; i < kMinRequiredSamples; ++i) |
389 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); | 392 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); |
390 | 393 |
391 statistics_proxy_.reset(); | 394 statistics_proxy_.reset(); |
392 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); | 395 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); |
393 } | 396 } |
394 | 397 |
395 } // namespace webrtc | 398 } // namespace webrtc |
OLD | NEW |