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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 void AudioMixerImpl::Mix(size_t number_of_channels, | 135 void AudioMixerImpl::Mix(size_t number_of_channels, |
136 AudioFrame* audio_frame_for_mixing) { | 136 AudioFrame* audio_frame_for_mixing) { |
137 RTC_DCHECK(number_of_channels == 1 || number_of_channels == 2); | 137 RTC_DCHECK(number_of_channels == 1 || number_of_channels == 2); |
138 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); | 138 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); |
139 | 139 |
140 CalculateOutputFrequency(); | 140 CalculateOutputFrequency(); |
141 | 141 |
142 { | 142 { |
143 rtc::CritScope lock(&crit_); | 143 rtc::CritScope lock(&crit_); |
| 144 const int number_of_streams = audio_source_list_.size(); |
144 frame_combiner_.Combine(GetAudioFromSources(), number_of_channels, | 145 frame_combiner_.Combine(GetAudioFromSources(), number_of_channels, |
145 OutputFrequency(), audio_frame_for_mixing); | 146 OutputFrequency(), number_of_streams, |
| 147 audio_frame_for_mixing); |
146 } | 148 } |
147 | 149 |
148 return; | 150 return; |
149 } | 151 } |
150 | 152 |
151 void AudioMixerImpl::CalculateOutputFrequency() { | 153 void AudioMixerImpl::CalculateOutputFrequency() { |
152 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); | 154 RTC_DCHECK_RUNS_SERIALIZED(&race_checker_); |
153 rtc::CritScope lock(&crit_); | 155 rtc::CritScope lock(&crit_); |
154 | 156 |
155 std::vector<int> preferred_rates; | 157 std::vector<int> preferred_rates; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 | 245 |
244 const auto iter = FindSourceInList(audio_source, &audio_source_list_); | 246 const auto iter = FindSourceInList(audio_source, &audio_source_list_); |
245 if (iter != audio_source_list_.end()) { | 247 if (iter != audio_source_list_.end()) { |
246 return (*iter)->is_mixed; | 248 return (*iter)->is_mixed; |
247 } | 249 } |
248 | 250 |
249 LOG(LS_ERROR) << "Audio source unknown"; | 251 LOG(LS_ERROR) << "Audio source unknown"; |
250 return false; | 252 return false; |
251 } | 253 } |
252 } // namespace webrtc | 254 } // namespace webrtc |
OLD | NEW |