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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); | 79 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); |
80 } | 80 } |
81 | 81 |
82 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) { | 82 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) { |
83 const char* kName = "decoderName"; | 83 const char* kName = "decoderName"; |
84 statistics_proxy_->OnDecoderImplementationName(kName); | 84 statistics_proxy_->OnDecoderImplementationName(kName); |
85 EXPECT_STREQ( | 85 EXPECT_STREQ( |
86 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str()); | 86 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str()); |
87 } | 87 } |
88 | 88 |
89 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsIncomingRate) { | 89 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnCompleteFrame) { |
90 const int kFramerate = 28; | 90 const int kFrameSizeBytes = 1000; |
91 const int kBitrateBps = 311000; | 91 statistics_proxy_->OnCompleteFrame(true, kFrameSizeBytes); |
92 statistics_proxy_->OnIncomingRate(kFramerate, kBitrateBps); | 92 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); |
93 EXPECT_EQ(kFramerate, statistics_proxy_->GetStats().network_frame_rate); | 93 EXPECT_EQ(1, stats.network_frame_rate); |
94 EXPECT_EQ(kBitrateBps, statistics_proxy_->GetStats().total_bitrate_bps); | 94 EXPECT_EQ(kFrameSizeBytes * 8, stats.total_bitrate_bps); |
| 95 EXPECT_EQ(1, stats.frame_counts.key_frames); |
| 96 EXPECT_EQ(0, stats.frame_counts.delta_frames); |
95 } | 97 } |
96 | 98 |
97 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { | 99 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { |
98 const int kDecodeMs = 1; | 100 const int kDecodeMs = 1; |
99 const int kMaxDecodeMs = 2; | 101 const int kMaxDecodeMs = 2; |
100 const int kCurrentDelayMs = 3; | 102 const int kCurrentDelayMs = 3; |
101 const int kTargetDelayMs = 4; | 103 const int kTargetDelayMs = 4; |
102 const int kJitterBufferMs = 5; | 104 const int kJitterBufferMs = 5; |
103 const int kMinPlayoutDelayMs = 6; | 105 const int kMinPlayoutDelayMs = 6; |
104 const int kRenderDelayMs = 7; | 106 const int kRenderDelayMs = 7; |
105 const int64_t kRttMs = 8; | 107 const int64_t kRttMs = 8; |
106 statistics_proxy_->OnDecoderTiming( | 108 statistics_proxy_->OnRttUpdate(kRttMs, 0); |
| 109 statistics_proxy_->OnFrameBufferTimingsUpdated( |
107 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs, | 110 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs, |
108 kMinPlayoutDelayMs, kRenderDelayMs, kRttMs); | 111 kMinPlayoutDelayMs, kRenderDelayMs); |
109 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); | 112 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); |
110 EXPECT_EQ(kDecodeMs, stats.decode_ms); | 113 EXPECT_EQ(kDecodeMs, stats.decode_ms); |
111 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms); | 114 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms); |
112 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms); | 115 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms); |
113 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms); | 116 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms); |
114 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms); | 117 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms); |
115 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms); | 118 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms); |
116 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); | 119 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); |
117 } | 120 } |
118 | 121 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 codec_info.codecType = kVideoCodecVP8; | 356 codec_info.codecType = kVideoCodecVP8; |
354 | 357 |
355 for (int i = 0; i < kMinRequiredSamples; ++i) | 358 for (int i = 0; i < kMinRequiredSamples; ++i) |
356 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); | 359 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); |
357 | 360 |
358 statistics_proxy_.reset(); | 361 statistics_proxy_.reset(); |
359 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); | 362 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); |
360 } | 363 } |
361 | 364 |
362 } // namespace webrtc | 365 } // namespace webrtc |
OLD | NEW |