OLD | NEW |
---|---|
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 Loading... | |
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 the capture signal here. This should be done at the |
Andrew MacDonald
2015/09/23 17:31:47
add "or upmix"
aluebs-webrtc
2015/09/23 19:48:54
Good point. Done.
| |
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 Loading... | |
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 |
OLD | NEW |