Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: webrtc/modules/audio_processing/noise_suppression_impl.cc

Issue 1175903002: audio_processing: Create now returns a pointer to the object (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed review comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 probability_average += WebRtcNs_prior_speech_probability(my_handle); 127 probability_average += WebRtcNs_prior_speech_probability(my_handle);
128 } 128 }
129 return probability_average / num_handles(); 129 return probability_average / num_handles();
130 #elif defined(WEBRTC_NS_FIXED) 130 #elif defined(WEBRTC_NS_FIXED)
131 // Currently not available for the fixed point implementation. 131 // Currently not available for the fixed point implementation.
132 return apm_->kUnsupportedFunctionError; 132 return apm_->kUnsupportedFunctionError;
133 #endif 133 #endif
134 } 134 }
135 135
136 void* NoiseSuppressionImpl::CreateHandle() const { 136 void* NoiseSuppressionImpl::CreateHandle() const {
137 Handle* handle = NULL;
138 #if defined(WEBRTC_NS_FLOAT) 137 #if defined(WEBRTC_NS_FLOAT)
139 if (WebRtcNs_Create(&handle) != apm_->kNoError) 138 return WebRtcNs_Create();
140 #elif defined(WEBRTC_NS_FIXED) 139 #elif defined(WEBRTC_NS_FIXED)
141 if (WebRtcNsx_Create(&handle) != apm_->kNoError) 140 return WebRtcNsx_Create();
142 #endif 141 #endif
143 {
144 handle = NULL;
145 } else {
146 assert(handle != NULL);
147 }
148
149 return handle;
150 } 142 }
151 143
152 void NoiseSuppressionImpl::DestroyHandle(void* handle) const { 144 void NoiseSuppressionImpl::DestroyHandle(void* handle) const {
153 #if defined(WEBRTC_NS_FLOAT) 145 #if defined(WEBRTC_NS_FLOAT)
154 WebRtcNs_Free(static_cast<Handle*>(handle)); 146 WebRtcNs_Free(static_cast<Handle*>(handle));
155 #elif defined(WEBRTC_NS_FIXED) 147 #elif defined(WEBRTC_NS_FIXED)
156 WebRtcNsx_Free(static_cast<Handle*>(handle)); 148 WebRtcNsx_Free(static_cast<Handle*>(handle));
157 #endif 149 #endif
158 } 150 }
159 151
(...skipping 20 matching lines...) Expand all
180 int NoiseSuppressionImpl::num_handles_required() const { 172 int NoiseSuppressionImpl::num_handles_required() const {
181 return apm_->num_output_channels(); 173 return apm_->num_output_channels();
182 } 174 }
183 175
184 int NoiseSuppressionImpl::GetHandleError(void* handle) const { 176 int NoiseSuppressionImpl::GetHandleError(void* handle) const {
185 // The NS has no get_error() function. 177 // The NS has no get_error() function.
186 assert(handle != NULL); 178 assert(handle != NULL);
187 return apm_->kUnspecifiedError; 179 return apm_->kUnspecifiedError;
188 } 180 }
189 } // namespace webrtc 181 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/gain_control_impl.cc ('k') | webrtc/modules/audio_processing/ns/include/noise_suppression.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698