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

Side by Side Diff: webrtc/voice_engine/channel.cc

Issue 1338833002: Fix the maximum native sample rate in AudioProcessing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Format Created 5 years, 3 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/voice_engine/channel.h ('k') | webrtc/voice_engine/transmit_mixer.h » ('j') | 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 3323 matching lines...) Expand 10 before | Expand all | Expand 10 after
3334 return 0; 3334 return 0;
3335 } 3335 }
3336 3336
3337 void Channel::Demultiplex(const int16_t* audio_data, 3337 void Channel::Demultiplex(const int16_t* audio_data,
3338 int sample_rate, 3338 int sample_rate,
3339 size_t number_of_frames, 3339 size_t number_of_frames,
3340 int number_of_channels) { 3340 int number_of_channels) {
3341 CodecInst codec; 3341 CodecInst codec;
3342 GetSendCodec(codec); 3342 GetSendCodec(codec);
3343 3343
3344 if (!mono_recording_audio_.get()) { 3344 // Never upsample or upmix the capture signal here. This should be done at the
3345 // Temporary space for DownConvertToCodecFormat. 3345 // end of the send chain.
3346 mono_recording_audio_.reset(new int16_t[kMaxMonoDataSizeSamples]); 3346 _audioFrame.sample_rate_hz_ = std::min(codec.plfreq, sample_rate);
3347 } 3347 _audioFrame.num_channels_ = std::min(number_of_channels, codec.channels);
3348 DownConvertToCodecFormat(audio_data, 3348 RemixAndResample(audio_data, number_of_frames, number_of_channels,
3349 number_of_frames, 3349 sample_rate, &input_resampler_, &_audioFrame);
3350 number_of_channels,
3351 sample_rate,
3352 codec.channels,
3353 codec.plfreq,
3354 mono_recording_audio_.get(),
3355 &input_resampler_,
3356 &_audioFrame);
3357 } 3350 }
3358 3351
3359 uint32_t 3352 uint32_t
3360 Channel::PrepareEncodeAndSend(int mixingFrequency) 3353 Channel::PrepareEncodeAndSend(int mixingFrequency)
3361 { 3354 {
3362 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,_channelId), 3355 WEBRTC_TRACE(kTraceStream, kTraceVoice, VoEId(_instanceId,_channelId),
3363 "Channel::PrepareEncodeAndSend()"); 3356 "Channel::PrepareEncodeAndSend()");
3364 3357
3365 if (_audioFrame.samples_per_channel_ == 0) 3358 if (_audioFrame.samples_per_channel_ == 0)
3366 { 3359 {
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
4147 int64_t min_rtt = 0; 4140 int64_t min_rtt = 0;
4148 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) 4141 if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt)
4149 != 0) { 4142 != 0) {
4150 return 0; 4143 return 0;
4151 } 4144 }
4152 return rtt; 4145 return rtt;
4153 } 4146 }
4154 4147
4155 } // namespace voe 4148 } // namespace voe
4156 } // namespace webrtc 4149 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/channel.h ('k') | webrtc/voice_engine/transmit_mixer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698