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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 bool report_perf_stats) | 410 bool report_perf_stats) |
411 : RampUpTester(num_video_streams, | 411 : RampUpTester(num_video_streams, |
412 num_audio_streams, | 412 num_audio_streams, |
413 num_flexfec_streams, | 413 num_flexfec_streams, |
414 start_bitrate_bps, | 414 start_bitrate_bps, |
415 0, | 415 0, |
416 extension_type, | 416 extension_type, |
417 rtx, | 417 rtx, |
418 red, | 418 red, |
419 report_perf_stats), | 419 report_perf_stats), |
420 link_rates_({GetHighLinkCapacity(), kLowBandwidthLimitBps / 1000, | 420 link_rates_({4 * GetExpectedHighBitrate() / (3 * 1000), |
421 GetHighLinkCapacity(), 0}), | 421 kLowBandwidthLimitBps / 1000, |
| 422 4 * GetExpectedHighBitrate() / (3 * 1000), 0}), |
422 test_state_(kFirstRampup), | 423 test_state_(kFirstRampup), |
423 next_state_(kTransitionToNextState), | 424 next_state_(kTransitionToNextState), |
424 state_start_ms_(clock_->TimeInMilliseconds()), | 425 state_start_ms_(clock_->TimeInMilliseconds()), |
425 interval_start_ms_(clock_->TimeInMilliseconds()), | 426 interval_start_ms_(clock_->TimeInMilliseconds()), |
426 sent_bytes_(0), | 427 sent_bytes_(0), |
427 loss_rates_(loss_rates) { | 428 loss_rates_(loss_rates) { |
428 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_]; | 429 forward_transport_config_.link_capacity_kbps = link_rates_[test_state_]; |
429 forward_transport_config_.queue_delay_ms = 100; | 430 forward_transport_config_.queue_delay_ms = 100; |
430 forward_transport_config_.loss_percent = loss_rates_[test_state_]; | 431 forward_transport_config_.loss_percent = loss_rates_[test_state_]; |
431 } | 432 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 482 |
482 int RampUpDownUpTester::GetExpectedHighBitrate() const { | 483 int RampUpDownUpTester::GetExpectedHighBitrate() const { |
483 int expected_bitrate_bps = 0; | 484 int expected_bitrate_bps = 0; |
484 if (num_audio_streams_ > 0) | 485 if (num_audio_streams_ > 0) |
485 expected_bitrate_bps += kExpectedHighAudioBitrateBps; | 486 expected_bitrate_bps += kExpectedHighAudioBitrateBps; |
486 if (num_video_streams_ > 0) | 487 if (num_video_streams_ > 0) |
487 expected_bitrate_bps += kExpectedHighVideoBitrateBps; | 488 expected_bitrate_bps += kExpectedHighVideoBitrateBps; |
488 return expected_bitrate_bps; | 489 return expected_bitrate_bps; |
489 } | 490 } |
490 | 491 |
491 int RampUpDownUpTester::GetHighLinkCapacity() const { | |
492 return 4 * GetExpectedHighBitrate() / (3 * 1000); | |
493 } | |
494 | |
495 size_t RampUpDownUpTester::GetFecBytes() const { | 492 size_t RampUpDownUpTester::GetFecBytes() const { |
496 size_t flex_fec_bytes = 0; | 493 size_t flex_fec_bytes = 0; |
497 if (num_flexfec_streams_ > 0) { | 494 if (num_flexfec_streams_ > 0) { |
498 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats(); | 495 webrtc::VideoSendStream::Stats stats = send_stream_->GetStats(); |
499 for (const auto& kv : stats.substreams) | 496 for (const auto& kv : stats.substreams) |
500 flex_fec_bytes += kv.second.rtp_stats.fec.TotalBytes(); | 497 flex_fec_bytes += kv.second.rtp_stats.fec.TotalBytes(); |
501 } | 498 } |
502 return flex_fec_bytes; | 499 return flex_fec_bytes; |
503 } | 500 } |
504 | 501 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 RunBaseTest(&test); | 661 RunBaseTest(&test); |
665 } | 662 } |
666 | 663 |
667 TEST_F(RampUpTest, AudioTransportSequenceNumber) { | 664 TEST_F(RampUpTest, AudioTransportSequenceNumber) { |
668 RampUpTester test(0, 1, 0, 300000, 10000, | 665 RampUpTester test(0, 1, 0, 300000, 10000, |
669 RtpExtension::kTransportSequenceNumberUri, false, false, | 666 RtpExtension::kTransportSequenceNumberUri, false, false, |
670 false); | 667 false); |
671 RunBaseTest(&test); | 668 RunBaseTest(&test); |
672 } | 669 } |
673 } // namespace webrtc | 670 } // namespace webrtc |
OLD | NEW |