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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, GetStatsReportsOnCompleteFrame) { | 77 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsIncomingRate) { |
78 const int kFrameSizeBytes = 1000; | 78 const int kFramerate = 28; |
79 statistics_proxy_->OnCompleteFrame(true, kFrameSizeBytes); | 79 const int kBitrateBps = 311000; |
80 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); | 80 statistics_proxy_->OnIncomingRate(kFramerate, kBitrateBps); |
81 EXPECT_EQ(1, stats.network_frame_rate); | 81 EXPECT_EQ(kFramerate, statistics_proxy_->GetStats().network_frame_rate); |
82 EXPECT_EQ(kFrameSizeBytes * 8, stats.total_bitrate_bps); | 82 EXPECT_EQ(kBitrateBps, statistics_proxy_->GetStats().total_bitrate_bps); |
83 EXPECT_EQ(1, stats.frame_counts.key_frames); | |
84 EXPECT_EQ(0, stats.frame_counts.delta_frames); | |
85 } | 83 } |
86 | 84 |
87 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { | 85 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { |
88 const int kDecodeMs = 1; | 86 const int kDecodeMs = 1; |
89 const int kMaxDecodeMs = 2; | 87 const int kMaxDecodeMs = 2; |
90 const int kCurrentDelayMs = 3; | 88 const int kCurrentDelayMs = 3; |
91 const int kTargetDelayMs = 4; | 89 const int kTargetDelayMs = 4; |
92 const int kJitterBufferMs = 5; | 90 const int kJitterBufferMs = 5; |
93 const int kMinPlayoutDelayMs = 6; | 91 const int kMinPlayoutDelayMs = 6; |
94 const int kRenderDelayMs = 7; | 92 const int kRenderDelayMs = 7; |
95 const int64_t kRttMs = 8; | 93 const int64_t kRttMs = 8; |
96 statistics_proxy_->OnRttUpdate(kRttMs, 0); | 94 statistics_proxy_->OnDecoderTiming( |
97 statistics_proxy_->OnFrameBufferTimingsUpdated( | |
98 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs, | 95 kDecodeMs, kMaxDecodeMs, kCurrentDelayMs, kTargetDelayMs, kJitterBufferMs, |
99 kMinPlayoutDelayMs, kRenderDelayMs); | 96 kMinPlayoutDelayMs, kRenderDelayMs, kRttMs); |
100 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); | 97 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); |
101 EXPECT_EQ(kDecodeMs, stats.decode_ms); | 98 EXPECT_EQ(kDecodeMs, stats.decode_ms); |
102 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms); | 99 EXPECT_EQ(kMaxDecodeMs, stats.max_decode_ms); |
103 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms); | 100 EXPECT_EQ(kCurrentDelayMs, stats.current_delay_ms); |
104 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms); | 101 EXPECT_EQ(kTargetDelayMs, stats.target_delay_ms); |
105 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms); | 102 EXPECT_EQ(kJitterBufferMs, stats.jitter_buffer_ms); |
106 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms); | 103 EXPECT_EQ(kMinPlayoutDelayMs, stats.min_playout_delay_ms); |
107 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); | 104 EXPECT_EQ(kRenderDelayMs, stats.render_delay_ms); |
108 } | 105 } |
109 | 106 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 codec_info.codecType = kVideoCodecVP8; | 341 codec_info.codecType = kVideoCodecVP8; |
345 | 342 |
346 for (int i = 0; i < kMinRequiredSamples; ++i) | 343 for (int i = 0; i < kMinRequiredSamples; ++i) |
347 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); | 344 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); |
348 | 345 |
349 statistics_proxy_.reset(); | 346 statistics_proxy_.reset(); |
350 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); | 347 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); |
351 } | 348 } |
352 | 349 |
353 } // namespace webrtc | 350 } // namespace webrtc |
OLD | NEW |