| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 // Find the max channels over all mixing lists. | 299 // Find the max channels over all mixing lists. |
| 300 const int num_mixed_channels = std::max(MaxNumChannels(&mixList), | 300 const int num_mixed_channels = std::max(MaxNumChannels(&mixList), |
| 301 std::max(MaxNumChannels(&additionalFramesList), | 301 std::max(MaxNumChannels(&additionalFramesList), |
| 302 MaxNumChannels(&rampOutList))); | 302 MaxNumChannels(&rampOutList))); |
| 303 | 303 |
| 304 mixedAudio->UpdateFrame(-1, _timeStamp, NULL, 0, _outputFrequency, | 304 mixedAudio->UpdateFrame(-1, _timeStamp, NULL, 0, _outputFrequency, |
| 305 AudioFrame::kNormalSpeech, | 305 AudioFrame::kNormalSpeech, |
| 306 AudioFrame::kVadPassive, num_mixed_channels); | 306 AudioFrame::kVadPassive, num_mixed_channels); |
| 307 | 307 |
| 308 _timeStamp += _sampleSize; | 308 _timeStamp += static_cast<uint32_t>(_sampleSize); |
| 309 | 309 |
| 310 // We only use the limiter if it supports the output sample rate and | 310 // We only use the limiter if it supports the output sample rate and |
| 311 // we're actually mixing multiple streams. | 311 // we're actually mixing multiple streams. |
| 312 use_limiter_ = _numMixedParticipants > 1 && | 312 use_limiter_ = _numMixedParticipants > 1 && |
| 313 _outputFrequency <= kAudioProcMaxNativeSampleRateHz; | 313 _outputFrequency <= kAudioProcMaxNativeSampleRateHz; |
| 314 | 314 |
| 315 MixFromList(*mixedAudio, &mixList); | 315 MixFromList(*mixedAudio, &mixList); |
| 316 MixAnonomouslyFromList(*mixedAudio, &additionalFramesList); | 316 MixAnonomouslyFromList(*mixedAudio, &additionalFramesList); |
| 317 MixAnonomouslyFromList(*mixedAudio, &rampOutList); | 317 MixAnonomouslyFromList(*mixedAudio, &rampOutList); |
| 318 | 318 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } | 394 } |
| 395 _mixReceiver = NULL; | 395 _mixReceiver = NULL; |
| 396 return 0; | 396 return 0; |
| 397 } | 397 } |
| 398 | 398 |
| 399 int32_t AudioConferenceMixerImpl::SetOutputFrequency( | 399 int32_t AudioConferenceMixerImpl::SetOutputFrequency( |
| 400 const Frequency frequency) { | 400 const Frequency frequency) { |
| 401 CriticalSectionScoped cs(_crit.get()); | 401 CriticalSectionScoped cs(_crit.get()); |
| 402 | 402 |
| 403 _outputFrequency = frequency; | 403 _outputFrequency = frequency; |
| 404 _sampleSize = (_outputFrequency*kProcessPeriodicityInMs) / 1000; | 404 _sampleSize = |
| 405 static_cast<size_t>((_outputFrequency*kProcessPeriodicityInMs) / 1000); |
| 405 | 406 |
| 406 return 0; | 407 return 0; |
| 407 } | 408 } |
| 408 | 409 |
| 409 AudioConferenceMixer::Frequency | 410 AudioConferenceMixer::Frequency |
| 410 AudioConferenceMixerImpl::OutputFrequency() const { | 411 AudioConferenceMixerImpl::OutputFrequency() const { |
| 411 CriticalSectionScoped cs(_crit.get()); | 412 CriticalSectionScoped cs(_crit.get()); |
| 412 return _outputFrequency; | 413 return _outputFrequency; |
| 413 } | 414 } |
| 414 | 415 |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 | 1026 |
| 1026 if(error != _limiter->kNoError) { | 1027 if(error != _limiter->kNoError) { |
| 1027 WEBRTC_TRACE(kTraceError, kTraceAudioMixerServer, _id, | 1028 WEBRTC_TRACE(kTraceError, kTraceAudioMixerServer, _id, |
| 1028 "Error from AudioProcessing: %d", error); | 1029 "Error from AudioProcessing: %d", error); |
| 1029 assert(false); | 1030 assert(false); |
| 1030 return false; | 1031 return false; |
| 1031 } | 1032 } |
| 1032 return true; | 1033 return true; |
| 1033 } | 1034 } |
| 1034 } // namespace webrtc | 1035 } // namespace webrtc |
| OLD | NEW |