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

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

Issue 1422013002: Preparational work for an upcoming addition of a threadchecking scheme for APM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@bundling_of_state_CL
Patch Set: Changes in response to user comments Created 5 years, 1 month 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 21 matching lines...) Expand all
32 case VoiceDetection::kHighLikelihood: 32 case VoiceDetection::kHighLikelihood:
33 return 0; 33 return 0;
34 } 34 }
35 assert(false); 35 assert(false);
36 return -1; 36 return -1;
37 } 37 }
38 } // namespace 38 } // namespace
39 39
40 VoiceDetectionImpl::VoiceDetectionImpl(const AudioProcessing* apm, 40 VoiceDetectionImpl::VoiceDetectionImpl(const AudioProcessing* apm,
41 CriticalSectionWrapper* crit) 41 CriticalSectionWrapper* crit)
42 : ProcessingComponent(), 42 : ProcessingComponent(),
hlundin-webrtc 2015/11/05 13:08:55 Not in this CL.
peah-webrtc 2015/11/06 07:31:14 It was initially included, but changes along the w
43 apm_(apm), 43 apm_(apm),
44 crit_(crit), 44 crit_(crit),
45 stream_has_voice_(false), 45 stream_has_voice_(false),
46 using_external_vad_(false), 46 using_external_vad_(false),
47 likelihood_(kLowLikelihood), 47 likelihood_(kLowLikelihood),
48 frame_size_ms_(10), 48 frame_size_ms_(10),
49 frame_size_samples_(0) {} 49 frame_size_samples_(0) {}
50 50
51 VoiceDetectionImpl::~VoiceDetectionImpl() {} 51 VoiceDetectionImpl::~VoiceDetectionImpl() {}
52 52
53 int VoiceDetectionImpl::ProcessCaptureAudio(AudioBuffer* audio) { 53 int VoiceDetectionImpl::ProcessCaptureAudio(AudioBuffer* audio) {
54 if (!is_component_enabled()) { 54 if (!is_component_enabled()) {
55 return apm_->kNoError; 55 return apm_->kNoError;
56 } 56 }
57 57
58 if (using_external_vad_) { 58 if (using_external_vad_) {
59 using_external_vad_ = false; 59 using_external_vad_ = false;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 int VoiceDetectionImpl::num_handles_required() const { 167 int VoiceDetectionImpl::num_handles_required() const {
168 return 1; 168 return 1;
169 } 169 }
170 170
171 int VoiceDetectionImpl::GetHandleError(void* handle) const { 171 int VoiceDetectionImpl::GetHandleError(void* handle) const {
172 // The VAD has no get_error() function. 172 // The VAD has no get_error() function.
173 assert(handle != NULL); 173 assert(handle != NULL);
174 return apm_->kUnspecifiedError; 174 return apm_->kUnspecifiedError;
175 } 175 }
176 } // namespace webrtc 176 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698