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

Side by Side Diff: media/audio/audio_input_controller.h

Issue 10911067: Make initial reset period configurable for audio input no data timer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 #include "base/atomicops.h" 9 #include "base/atomicops.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 EventHandler* handler_; 223 EventHandler* handler_;
224 224
225 // Pointer to the audio input stream object. 225 // Pointer to the audio input stream object.
226 AudioInputStream* stream_; 226 AudioInputStream* stream_;
227 227
228 // |no_data_timer_| is used to call OnError() when we stop receiving 228 // |no_data_timer_| is used to call OnError() when we stop receiving
229 // OnData() calls without an OnClose() call. This can occur 229 // OnData() calls without an OnClose() call. This can occur
230 // when an audio input device is unplugged whilst recording on Windows. 230 // when an audio input device is unplugged whilst recording on Windows.
231 // See http://crbug.com/79936 for details. 231 // See http://crbug.com/79936 for details.
232 // This member is only touched by the audio thread. 232 // This member is only touched by the audio thread.
233 scoped_ptr<base::DelayTimer<AudioInputController> > no_data_timer_; 233 scoped_ptr<base::Timer> no_data_timer_;
234 234
235 // This flag is used to signal that we are receiving OnData() calls, i.e, 235 // This flag is used to signal that we are receiving OnData() calls, i.e,
236 // that data is active. It can be touched by the audio thread and by the 236 // that data is active. It can be touched by the audio thread and by the
237 // low-level audio thread which calls OnData(). E.g. on Windows, the 237 // low-level audio thread which calls OnData(). E.g. on Windows, the
238 // low-level audio thread is called wasapi_capture_thread. 238 // low-level audio thread is called wasapi_capture_thread.
239 base::subtle::Atomic32 data_is_active_; 239 base::subtle::Atomic32 data_is_active_;
240 240
241 // |state_| is written on the audio thread and is read on the hardware audio 241 // |state_| is written on the audio thread and is read on the hardware audio
242 // thread. These operations need to be locked. But lock is not required for 242 // thread. These operations need to be locked. But lock is not required for
243 // reading on the audio input controller thread. 243 // reading on the audio input controller thread.
244 State state_; 244 State state_;
245 245
246 base::Lock lock_; 246 base::Lock lock_;
247 247
248 // SyncWriter is used only in low-latency mode for synchronous writing. 248 // SyncWriter is used only in low-latency mode for synchronous writing.
249 SyncWriter* sync_writer_; 249 SyncWriter* sync_writer_;
250 250
251 static Factory* factory_; 251 static Factory* factory_;
252 252
253 double max_volume_; 253 double max_volume_;
254 254
255 DISALLOW_COPY_AND_ASSIGN(AudioInputController); 255 DISALLOW_COPY_AND_ASSIGN(AudioInputController);
256 }; 256 };
257 257
258 } // namespace media 258 } // namespace media
259 259
260 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 260 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_input_controller.cc » ('j') | media/audio/audio_input_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698