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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 bool use_limiter) | 106 bool use_limiter) |
107 : output_rate_calculator_(std::move(output_rate_calculator)), | 107 : output_rate_calculator_(std::move(output_rate_calculator)), |
108 output_frequency_(0), | 108 output_frequency_(0), |
109 sample_size_(0), | 109 sample_size_(0), |
110 audio_source_list_(), | 110 audio_source_list_(), |
111 frame_combiner_(use_limiter) {} | 111 frame_combiner_(use_limiter) {} |
112 | 112 |
113 AudioMixerImpl::~AudioMixerImpl() {} | 113 AudioMixerImpl::~AudioMixerImpl() {} |
114 | 114 |
115 rtc::scoped_refptr<AudioMixerImpl> AudioMixerImpl::Create() { | 115 rtc::scoped_refptr<AudioMixerImpl> AudioMixerImpl::Create() { |
116 return CreateWithOutputRateCalculatorAndLimiter( | 116 return Create(std::unique_ptr<DefaultOutputRateCalculator>( |
117 std::unique_ptr<DefaultOutputRateCalculator>( | 117 new DefaultOutputRateCalculator()), |
118 new DefaultOutputRateCalculator()), | 118 true); |
119 true); | |
120 } | 119 } |
121 | 120 |
122 rtc::scoped_refptr<AudioMixerImpl> | 121 rtc::scoped_refptr<AudioMixerImpl> |
123 AudioMixerImpl::CreateWithOutputRateCalculator( | 122 AudioMixerImpl::CreateWithOutputRateCalculator( |
124 std::unique_ptr<OutputRateCalculator> output_rate_calculator) { | 123 std::unique_ptr<OutputRateCalculator> output_rate_calculator) { |
125 return CreateWithOutputRateCalculatorAndLimiter( | 124 return Create(std::move(output_rate_calculator), true); |
126 std::move(output_rate_calculator), true); | |
127 } | 125 } |
128 | 126 |
129 rtc::scoped_refptr<AudioMixerImpl> | 127 rtc::scoped_refptr<AudioMixerImpl> AudioMixerImpl::Create( |
130 AudioMixerImpl::CreateWithOutputRateCalculatorAndLimiter( | |
131 std::unique_ptr<OutputRateCalculator> output_rate_calculator, | 128 std::unique_ptr<OutputRateCalculator> output_rate_calculator, |
132 bool use_limiter) { | 129 bool use_limiter) { |
133 return rtc::scoped_refptr<AudioMixerImpl>( | 130 return rtc::scoped_refptr<AudioMixerImpl>( |
134 new rtc::RefCountedObject<AudioMixerImpl>( | 131 new rtc::RefCountedObject<AudioMixerImpl>( |
135 std::move(output_rate_calculator), use_limiter)); | 132 std::move(output_rate_calculator), use_limiter)); |
136 } | 133 } |
137 | 134 |
138 void AudioMixerImpl::Mix(size_t number_of_channels, | 135 void AudioMixerImpl::Mix(size_t number_of_channels, |
139 AudioFrame* audio_frame_for_mixing) { | 136 AudioFrame* audio_frame_for_mixing) { |
140 RTC_DCHECK(number_of_channels == 1 || number_of_channels == 2); | 137 RTC_DCHECK(number_of_channels == 1 || number_of_channels == 2); |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 243 |
247 const auto iter = FindSourceInList(audio_source, &audio_source_list_); | 244 const auto iter = FindSourceInList(audio_source, &audio_source_list_); |
248 if (iter != audio_source_list_.end()) { | 245 if (iter != audio_source_list_.end()) { |
249 return (*iter)->is_mixed; | 246 return (*iter)->is_mixed; |
250 } | 247 } |
251 | 248 |
252 LOG(LS_ERROR) << "Audio source unknown"; | 249 LOG(LS_ERROR) << "Audio source unknown"; |
253 return false; | 250 return false; |
254 } | 251 } |
255 } // namespace webrtc | 252 } // namespace webrtc |
OLD | NEW |