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

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

Issue 2528933002: Adding OnReceivedOverhead to AudioEncoder. (Closed)
Patch Set: Created 4 years 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
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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 ApplyAudioNetworkAdaptor(); 319 ApplyAudioNetworkAdaptor();
320 } 320 }
321 321
322 void AudioEncoderOpus::OnReceivedRtt(int rtt_ms) { 322 void AudioEncoderOpus::OnReceivedRtt(int rtt_ms) {
323 if (!audio_network_adaptor_) 323 if (!audio_network_adaptor_)
324 return; 324 return;
325 audio_network_adaptor_->SetRtt(rtt_ms); 325 audio_network_adaptor_->SetRtt(rtt_ms);
326 ApplyAudioNetworkAdaptor(); 326 ApplyAudioNetworkAdaptor();
327 } 327 }
328 328
329 void AudioEncoderOpus::OnReceivedOverhead(size_t overhead_bytes_per_packet) {
330 if (!audio_network_adaptor_)
331 return;
332 audio_network_adaptor_->SetOverhead(overhead_bytes_per_packet);
333 ApplyAudioNetworkAdaptor();
334 }
335
329 void AudioEncoderOpus::SetReceiverFrameLengthRange(int min_frame_length_ms, 336 void AudioEncoderOpus::SetReceiverFrameLengthRange(int min_frame_length_ms,
330 int max_frame_length_ms) { 337 int max_frame_length_ms) {
331 // Ensure that |SetReceiverFrameLengthRange| is called before 338 // Ensure that |SetReceiverFrameLengthRange| is called before
332 // |EnableAudioNetworkAdaptor|, otherwise we need to recreate 339 // |EnableAudioNetworkAdaptor|, otherwise we need to recreate
333 // |audio_network_adaptor_|, which is not a needed use case. 340 // |audio_network_adaptor_|, which is not a needed use case.
334 RTC_DCHECK(!audio_network_adaptor_); 341 RTC_DCHECK(!audio_network_adaptor_);
335 342
336 config_.supported_frame_lengths_ms.clear(); 343 config_.supported_frame_lengths_ms.clear();
337 std::copy_if(std::begin(kSupportedFrameLengths), 344 std::copy_if(std::begin(kSupportedFrameLengths),
338 std::end(kSupportedFrameLengths), 345 std::end(kSupportedFrameLengths),
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 AudioNetworkAdaptorImpl::Config config; 497 AudioNetworkAdaptorImpl::Config config;
491 config.clock = clock; 498 config.clock = clock;
492 return std::unique_ptr<AudioNetworkAdaptor>(new AudioNetworkAdaptorImpl( 499 return std::unique_ptr<AudioNetworkAdaptor>(new AudioNetworkAdaptorImpl(
493 config, ControllerManagerImpl::Create( 500 config, ControllerManagerImpl::Create(
494 config_string, NumChannels(), supported_frame_lengths_ms(), 501 config_string, NumChannels(), supported_frame_lengths_ms(),
495 num_channels_to_encode_, next_frame_length_ms_, 502 num_channels_to_encode_, next_frame_length_ms_,
496 GetTargetBitrate(), config_.fec_enabled, GetDtx(), clock))); 503 GetTargetBitrate(), config_.fec_enabled, GetDtx(), clock)));
497 } 504 }
498 505
499 } // namespace webrtc 506 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698