OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // Frames could be both stereo and mono. | 186 // Frames could be both stereo and mono. |
187 for (auto* frame : mix_list) { | 187 for (auto* frame : mix_list) { |
188 RemixFrame(number_of_channels, frame); | 188 RemixFrame(number_of_channels, frame); |
189 } | 189 } |
190 | 190 |
191 // TODO(aleloi): Issue bugs.webrtc.org/3390. | 191 // TODO(aleloi): Issue bugs.webrtc.org/3390. |
192 // Audio frame timestamp. The 'timestamp_' field is set to dummy | 192 // Audio frame timestamp. The 'timestamp_' field is set to dummy |
193 // value '0', because it is only supported in the one channel case and | 193 // value '0', because it is only supported in the one channel case and |
194 // is then updated in the helper functions. | 194 // is then updated in the helper functions. |
195 audio_frame_for_mixing->UpdateFrame( | 195 audio_frame_for_mixing->UpdateFrame( |
196 -1, 0, nullptr, samples_per_channel, sample_rate, AudioFrame::kUndefined, | 196 0, nullptr, samples_per_channel, sample_rate, AudioFrame::kUndefined, |
197 AudioFrame::kVadUnknown, number_of_channels); | 197 AudioFrame::kVadUnknown, number_of_channels); |
198 | 198 |
199 const bool use_limiter_this_round = use_apm_limiter_ && number_of_streams > 1; | 199 const bool use_limiter_this_round = use_apm_limiter_ && number_of_streams > 1; |
200 | 200 |
201 if (mix_list.empty()) { | 201 if (mix_list.empty()) { |
202 CombineZeroFrames(use_limiter_this_round, limiter_.get(), | 202 CombineZeroFrames(use_limiter_this_round, limiter_.get(), |
203 audio_frame_for_mixing); | 203 audio_frame_for_mixing); |
204 } else if (mix_list.size() == 1) { | 204 } else if (mix_list.size() == 1) { |
205 CombineOneFrame(mix_list.front(), use_limiter_this_round, limiter_.get(), | 205 CombineOneFrame(mix_list.front(), use_limiter_this_round, limiter_.get(), |
206 audio_frame_for_mixing); | 206 audio_frame_for_mixing); |
207 } else { | 207 } else { |
208 std::vector<rtc::ArrayView<const int16_t>> input_frames; | 208 std::vector<rtc::ArrayView<const int16_t>> input_frames; |
209 for (size_t i = 0; i < mix_list.size(); ++i) { | 209 for (size_t i = 0; i < mix_list.size(); ++i) { |
210 input_frames.push_back(rtc::ArrayView<const int16_t>( | 210 input_frames.push_back(rtc::ArrayView<const int16_t>( |
211 mix_list[i]->data(), samples_per_channel * number_of_channels)); | 211 mix_list[i]->data(), samples_per_channel * number_of_channels)); |
212 } | 212 } |
213 CombineMultipleFrames(input_frames, use_limiter_this_round, limiter_.get(), | 213 CombineMultipleFrames(input_frames, use_limiter_this_round, limiter_.get(), |
214 audio_frame_for_mixing); | 214 audio_frame_for_mixing); |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 } // namespace webrtc | 218 } // namespace webrtc |
OLD | NEW |