Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: webrtc/modules/audio_coding/codecs/opus/audio_encoder_opus.cc

Issue 2703353002: Change frame length on very low bandwidth. (Closed)
Patch Set: Responsd to comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/audio_network_adaptor/frame_length_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698