OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 std::unique_ptr<AudioNetworkAdaptor> | 540 std::unique_ptr<AudioNetworkAdaptor> |
541 AudioEncoderOpus::DefaultAudioNetworkAdaptorCreator( | 541 AudioEncoderOpus::DefaultAudioNetworkAdaptorCreator( |
542 const std::string& config_string, | 542 const std::string& config_string, |
543 RtcEventLog* event_log, | 543 RtcEventLog* event_log, |
544 const Clock* clock) const { | 544 const Clock* clock) const { |
545 AudioNetworkAdaptorImpl::Config config; | 545 AudioNetworkAdaptorImpl::Config config; |
546 config.clock = clock; | 546 config.clock = clock; |
547 config.event_log = event_log; | 547 config.event_log = event_log; |
548 return std::unique_ptr<AudioNetworkAdaptor>(new AudioNetworkAdaptorImpl( | 548 return std::unique_ptr<AudioNetworkAdaptor>(new AudioNetworkAdaptorImpl( |
549 config, ControllerManagerImpl::Create( | 549 config, |
550 config_string, NumChannels(), supported_frame_lengths_ms(), | 550 ControllerManagerImpl::Create( |
551 num_channels_to_encode_, next_frame_length_ms_, | 551 config_string, NumChannels(), supported_frame_lengths_ms(), |
552 GetTargetBitrate(), config_.fec_enabled, GetDtx(), clock))); | 552 kMinBitrateBps, num_channels_to_encode_, next_frame_length_ms_, |
| 553 GetTargetBitrate(), config_.fec_enabled, GetDtx(), clock))); |
553 } | 554 } |
554 | 555 |
555 void AudioEncoderOpus::MaybeUpdateUplinkBandwidth() { | 556 void AudioEncoderOpus::MaybeUpdateUplinkBandwidth() { |
556 if (audio_network_adaptor_) { | 557 if (audio_network_adaptor_) { |
557 int64_t now_ms = rtc::TimeMillis(); | 558 int64_t now_ms = rtc::TimeMillis(); |
558 if (!bitrate_smoother_last_update_time_ || | 559 if (!bitrate_smoother_last_update_time_ || |
559 now_ms - *bitrate_smoother_last_update_time_ >= | 560 now_ms - *bitrate_smoother_last_update_time_ >= |
560 config_.uplink_bandwidth_update_interval_ms) { | 561 config_.uplink_bandwidth_update_interval_ms) { |
561 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage(); | 562 rtc::Optional<float> smoothed_bitrate = bitrate_smoother_->GetAverage(); |
562 if (smoothed_bitrate) | 563 if (smoothed_bitrate) |
563 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate); | 564 audio_network_adaptor_->SetUplinkBandwidth(*smoothed_bitrate); |
564 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms); | 565 bitrate_smoother_last_update_time_ = rtc::Optional<int64_t>(now_ms); |
565 } | 566 } |
566 } | 567 } |
567 } | 568 } |
568 | 569 |
569 } // namespace webrtc | 570 } // namespace webrtc |
OLD | NEW |