| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "media/audio/audio_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
| 6 #include "media/audio/audio_output_dispatcher.h" | 6 #include "media/audio/audio_output_dispatcher.h" |
| 7 #include "media/audio/audio_output_proxy.h" | 7 #include "media/audio/audio_output_proxy.h" |
| 8 | 8 |
| 9 static const int kStreamCloseDelayMs = 5000; | 9 static const int kStreamCloseDelayMs = 5000; |
| 10 | 10 |
| 11 const char AudioManagerBase::kDefaultDeviceName[] = "Default"; | 11 const char AudioManagerBase::kDefaultDeviceName[] = "Default"; |
| 12 const char AudioManagerBase::kDefaultDeviceId[] = "default"; |
| 12 | 13 |
| 13 AudioManagerBase::AudioManagerBase() | 14 AudioManagerBase::AudioManagerBase() |
| 14 : audio_thread_("AudioThread"), | 15 : audio_thread_("AudioThread"), |
| 15 initialized_(false), | 16 initialized_(false), |
| 16 num_active_input_streams_(0) { | 17 num_active_input_streams_(0) { |
| 17 } | 18 } |
| 18 | 19 |
| 19 AudioManagerBase::~AudioManagerBase() { | 20 AudioManagerBase::~AudioManagerBase() { |
| 20 DCHECK(!audio_thread_.IsRunning()); | 21 DCHECK(!audio_thread_.IsRunning()); |
| 21 } | 22 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void AudioManagerBase::DecreaseActiveInputStreamCount() { | 73 void AudioManagerBase::DecreaseActiveInputStreamCount() { |
| 73 base::AutoLock auto_lock(active_input_streams_lock_); | 74 base::AutoLock auto_lock(active_input_streams_lock_); |
| 74 DCHECK_GT(num_active_input_streams_, 0); | 75 DCHECK_GT(num_active_input_streams_, 0); |
| 75 --num_active_input_streams_; | 76 --num_active_input_streams_; |
| 76 } | 77 } |
| 77 | 78 |
| 78 bool AudioManagerBase::IsRecordingInProcess() { | 79 bool AudioManagerBase::IsRecordingInProcess() { |
| 79 base::AutoLock auto_lock(active_input_streams_lock_); | 80 base::AutoLock auto_lock(active_input_streams_lock_); |
| 80 return num_active_input_streams_ > 0; | 81 return num_active_input_streams_ > 0; |
| 81 } | 82 } |
| OLD | NEW |