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

Side by Side Diff: content/browser/speech/speech_recognizer_impl.h

Issue 2941773002: Added initial muted state to stream creation callback, to avoid races. (Closed)
Patch Set: Added mute information to DoCompleteCreation log message. Created 3 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 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Calculates the input volume to be displayed in the UI, triggering the 136 // Calculates the input volume to be displayed in the UI, triggering the
137 // OnAudioLevelsChange event accordingly. 137 // OnAudioLevelsChange event accordingly.
138 void UpdateSignalAndNoiseLevels(const float& rms, bool clip_detected); 138 void UpdateSignalAndNoiseLevels(const float& rms, bool clip_detected);
139 139
140 void CloseAudioControllerAsynchronously(); 140 void CloseAudioControllerAsynchronously();
141 141
142 // Callback called on IO thread by audio_controller->Close(). 142 // Callback called on IO thread by audio_controller->Close().
143 void OnAudioClosed(media::AudioInputController*); 143 void OnAudioClosed(media::AudioInputController*);
144 144
145 // AudioInputController::EventHandler methods. 145 // AudioInputController::EventHandler methods.
146 void OnCreated(media::AudioInputController* controller) override {} 146 void OnCreated(media::AudioInputController* controller,
147 bool initially_muted) override {}
147 void OnError(media::AudioInputController* controller, 148 void OnError(media::AudioInputController* controller,
148 media::AudioInputController::ErrorCode error_code) override; 149 media::AudioInputController::ErrorCode error_code) override;
149 void OnLog(media::AudioInputController* controller, 150 void OnLog(media::AudioInputController* controller,
150 const std::string& message) override {} 151 const std::string& message) override {}
151 void OnMuted(media::AudioInputController* controller, 152 void OnMuted(media::AudioInputController* controller,
152 bool is_muted) override {} 153 bool is_muted) override {}
153 154
154 // AudioInputController::SyncWriter methods. 155 // AudioInputController::SyncWriter methods.
155 void Write(const media::AudioBus* data, 156 void Write(const media::AudioBus* data,
156 double volume, 157 double volume,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // output format. 193 // output format.
193 std::unique_ptr<SpeechRecognizerImpl::OnDataConverter> audio_converter_; 194 std::unique_ptr<SpeechRecognizerImpl::OnDataConverter> audio_converter_;
194 195
195 base::WeakPtrFactory<SpeechRecognizerImpl> weak_ptr_factory_; 196 base::WeakPtrFactory<SpeechRecognizerImpl> weak_ptr_factory_;
196 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl); 197 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizerImpl);
197 }; 198 };
198 199
199 } // namespace content 200 } // namespace content
200 201
201 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_ 202 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_input_renderer_host_unittest.cc ('k') | content/common/media/audio_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698