| 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 ? kMaxAcceptableTransmitBitrate | 542 ? kMaxAcceptableTransmitBitrate |
| 543 : (kMaxEncodeBitrateKbps + | 543 : (kMaxEncodeBitrateKbps + |
| 544 kAcceptableBitrateErrorMargin / 2)), | 544 kAcceptableBitrateErrorMargin / 2)), |
| 545 num_bitrate_observations_in_range_(0) {} | 545 num_bitrate_observations_in_range_(0) {} |
| 546 | 546 |
| 547 private: | 547 private: |
| 548 // TODO(holmer): Run this with a timer instead of once per packet. | 548 // TODO(holmer): Run this with a timer instead of once per packet. |
| 549 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 549 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
| 550 VideoSendStream::Stats stats = send_stream_->GetStats(); | 550 VideoSendStream::Stats stats = send_stream_->GetStats(); |
| 551 if (stats.substreams.size() > 0) { | 551 if (stats.substreams.size() > 0) { |
| 552 RTC_DCHECK_EQ(1u, stats.substreams.size()); | 552 RTC_DCHECK_EQ(1, stats.substreams.size()); |
| 553 int bitrate_kbps = | 553 int bitrate_kbps = |
| 554 stats.substreams.begin()->second.total_bitrate_bps / 1000; | 554 stats.substreams.begin()->second.total_bitrate_bps / 1000; |
| 555 if (bitrate_kbps > min_acceptable_bitrate_ && | 555 if (bitrate_kbps > min_acceptable_bitrate_ && |
| 556 bitrate_kbps < max_acceptable_bitrate_) { | 556 bitrate_kbps < max_acceptable_bitrate_) { |
| 557 converged_ = true; | 557 converged_ = true; |
| 558 ++num_bitrate_observations_in_range_; | 558 ++num_bitrate_observations_in_range_; |
| 559 if (num_bitrate_observations_in_range_ == | 559 if (num_bitrate_observations_in_range_ == |
| 560 kNumBitrateObservationsInRange) | 560 kNumBitrateObservationsInRange) |
| 561 observation_complete_.Set(); | 561 observation_complete_.Set(); |
| 562 } | 562 } |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 uint32_t last_set_bitrate_kbps_; | 729 uint32_t last_set_bitrate_kbps_; |
| 730 VideoSendStream* send_stream_; | 730 VideoSendStream* send_stream_; |
| 731 test::FrameGeneratorCapturer* frame_generator_; | 731 test::FrameGeneratorCapturer* frame_generator_; |
| 732 VideoEncoderConfig encoder_config_; | 732 VideoEncoderConfig encoder_config_; |
| 733 } test; | 733 } test; |
| 734 | 734 |
| 735 RunBaseTest(&test); | 735 RunBaseTest(&test); |
| 736 } | 736 } |
| 737 | 737 |
| 738 } // namespace webrtc | 738 } // namespace webrtc |
| OLD | NEW |