OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 283 matching lines...) Loading... | |
294 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); | 294 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); |
295 EXPECT_EQ(0, stats.preferred_media_bitrate_bps); | 295 EXPECT_EQ(0, stats.preferred_media_bitrate_bps); |
296 const int kPreferredMediaBitrateBps = 50; | 296 const int kPreferredMediaBitrateBps = 50; |
297 | 297 |
298 VideoEncoderConfig config; | 298 VideoEncoderConfig config; |
299 statistics_proxy_->OnEncoderReconfigured(config, kPreferredMediaBitrateBps); | 299 statistics_proxy_->OnEncoderReconfigured(config, kPreferredMediaBitrateBps); |
300 stats = statistics_proxy_->GetStats(); | 300 stats = statistics_proxy_->GetStats(); |
301 EXPECT_EQ(kPreferredMediaBitrateBps, stats.preferred_media_bitrate_bps); | 301 EXPECT_EQ(kPreferredMediaBitrateBps, stats.preferred_media_bitrate_bps); |
302 } | 302 } |
303 | 303 |
304 TEST_F(SendStatisticsProxyTest, OnSendEncodedImageIncreasesFramesEncoded) { | |
305 EncodedImage encoded_image; | |
306 CodecSpecificInfo codec_info; | |
307 EXPECT_EQ(0, statistics_proxy_->GetStats().frames_encoded); | |
308 for (int i = 1; i <= 3; i++) { | |
tommi
2016/10/17 22:54:36
++i
sakal
2016/10/18 07:59:50
Done.
| |
309 statistics_proxy_->OnSendEncodedImage(encoded_image, &codec_info); | |
310 EXPECT_EQ(i, statistics_proxy_->GetStats().frames_encoded); | |
311 } | |
312 } | |
313 | |
304 TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) { | 314 TEST_F(SendStatisticsProxyTest, SwitchContentTypeUpdatesHistograms) { |
305 const int kWidth = 640; | 315 const int kWidth = 640; |
306 const int kHeight = 480; | 316 const int kHeight = 480; |
307 | 317 |
308 for (int i = 0; i < kMinRequiredSamples; ++i) | 318 for (int i = 0; i < kMinRequiredSamples; ++i) |
309 statistics_proxy_->OnIncomingFrame(kWidth, kHeight); | 319 statistics_proxy_->OnIncomingFrame(kWidth, kHeight); |
310 | 320 |
311 // No switch, stats should not be updated. | 321 // No switch, stats should not be updated. |
312 VideoEncoderConfig config; | 322 VideoEncoderConfig config; |
313 config.content_type = VideoEncoderConfig::ContentType::kRealtimeVideo; | 323 config.content_type = VideoEncoderConfig::ContentType::kRealtimeVideo; |
(...skipping 443 matching lines...) Loading... | |
757 | 767 |
758 EXPECT_EQ( | 768 EXPECT_EQ( |
759 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); | 769 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); |
760 EXPECT_EQ(1, metrics::NumEvents( | 770 EXPECT_EQ(1, metrics::NumEvents( |
761 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", | 771 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", |
762 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / | 772 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / |
763 metrics::kMinRunTimeInSeconds / 1000))); | 773 metrics::kMinRunTimeInSeconds / 1000))); |
764 } | 774 } |
765 | 775 |
766 } // namespace webrtc | 776 } // namespace webrtc |
OLD | NEW |