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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // Maximum number of frames to buffer in the render queue. | 61 // Maximum number of frames to buffer in the render queue. |
62 // TODO(peah): Decrease this once we properly handle hugely unbalanced | 62 // TODO(peah): Decrease this once we properly handle hugely unbalanced |
63 // reverse and forward call numbers. | 63 // reverse and forward call numbers. |
64 static const size_t kMaxNumFramesToBuffer = 100; | 64 static const size_t kMaxNumFramesToBuffer = 100; |
65 } // namespace | 65 } // namespace |
66 | 66 |
67 size_t EchoControlMobile::echo_path_size_bytes() { | 67 size_t EchoControlMobile::echo_path_size_bytes() { |
68 return WebRtcAecm_echo_path_size_bytes(); | 68 return WebRtcAecm_echo_path_size_bytes(); |
69 } | 69 } |
70 | 70 |
71 EchoControlMobileImpl::EchoControlMobileImpl(const AudioProcessing* apm, | 71 EchoControlMobileImpl::EchoControlMobileImpl( |
72 CriticalSectionWrapper* crit) | 72 const AudioProcessing* apm, |
| 73 CriticalSectionWrapper* crit, |
| 74 const rtc::ThreadChecker* render_thread_checker) |
73 : ProcessingComponent(), | 75 : ProcessingComponent(), |
74 apm_(apm), | 76 apm_(apm), |
75 crit_(crit), | 77 crit_(crit), |
| 78 render_thread_checker_(render_thread_checker), |
76 routing_mode_(kSpeakerphone), | 79 routing_mode_(kSpeakerphone), |
77 comfort_noise_enabled_(true), | 80 comfort_noise_enabled_(true), |
78 external_echo_path_(NULL), | 81 external_echo_path_(NULL), |
79 render_queue_element_max_size_(0) {} | 82 render_queue_element_max_size_(0) {} |
80 | 83 |
81 EchoControlMobileImpl::~EchoControlMobileImpl() { | 84 EchoControlMobileImpl::~EchoControlMobileImpl() { |
82 if (external_echo_path_ != NULL) { | 85 if (external_echo_path_ != NULL) { |
83 delete [] external_echo_path_; | 86 delete [] external_echo_path_; |
84 external_echo_path_ = NULL; | 87 external_echo_path_ = NULL; |
85 } | 88 } |
86 } | 89 } |
87 | 90 |
88 int EchoControlMobileImpl::ProcessRenderAudio(const AudioBuffer* audio) { | 91 int EchoControlMobileImpl::ProcessRenderAudio(const AudioBuffer* audio) { |
| 92 RTC_DCHECK(render_thread_checker_->CalledOnValidThread()); |
89 if (!is_component_enabled()) { | 93 if (!is_component_enabled()) { |
90 return apm_->kNoError; | 94 return apm_->kNoError; |
91 } | 95 } |
92 | 96 |
93 assert(audio->num_frames_per_band() <= 160); | 97 assert(audio->num_frames_per_band() <= 160); |
94 assert(audio->num_channels() == apm_->num_reverse_channels()); | 98 assert(audio->num_channels() == apm_->num_reverse_channels()); |
95 | 99 |
96 int err = apm_->kNoError; | 100 int err = apm_->kNoError; |
97 | 101 |
98 // The ordering convention must be followed to pass to the correct AECM. | 102 // The ordering convention must be followed to pass to the correct AECM. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 int EchoControlMobileImpl::num_handles_required() const { | 365 int EchoControlMobileImpl::num_handles_required() const { |
362 return apm_->num_output_channels() * | 366 return apm_->num_output_channels() * |
363 apm_->num_reverse_channels(); | 367 apm_->num_reverse_channels(); |
364 } | 368 } |
365 | 369 |
366 int EchoControlMobileImpl::GetHandleError(void* handle) const { | 370 int EchoControlMobileImpl::GetHandleError(void* handle) const { |
367 assert(handle != NULL); | 371 assert(handle != NULL); |
368 return AudioProcessing::kUnspecifiedError; | 372 return AudioProcessing::kUnspecifiedError; |
369 } | 373 } |
370 } // namespace webrtc | 374 } // namespace webrtc |
OLD | NEW |