OLD | NEW |
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 #include "media/audio/audio_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 const char AudioManagerBase::kDefaultDeviceName[] = "Default"; | 41 const char AudioManagerBase::kDefaultDeviceName[] = "Default"; |
42 const char AudioManagerBase::kDefaultDeviceId[] = "default"; | 42 const char AudioManagerBase::kDefaultDeviceId[] = "default"; |
43 | 43 |
44 AudioManagerBase::AudioManagerBase() | 44 AudioManagerBase::AudioManagerBase() |
45 : num_active_input_streams_(0), | 45 : num_active_input_streams_(0), |
46 max_num_output_streams_(kDefaultMaxOutputStreams), | 46 max_num_output_streams_(kDefaultMaxOutputStreams), |
47 max_num_input_streams_(kDefaultMaxInputStreams), | 47 max_num_input_streams_(kDefaultMaxInputStreams), |
48 num_output_streams_(0), | 48 num_output_streams_(0), |
49 num_input_streams_(0), | 49 num_input_streams_(0), |
| 50 output_listeners_( |
| 51 ObserverList<AudioDeviceListener>::NOTIFY_EXISTING_ONLY), |
50 audio_thread_(new base::Thread("AudioThread")), | 52 audio_thread_(new base::Thread("AudioThread")), |
51 virtual_audio_input_stream_(NULL) { | 53 virtual_audio_input_stream_(NULL) { |
52 #if defined(OS_WIN) | 54 #if defined(OS_WIN) |
53 audio_thread_->init_com_with_mta(true); | 55 audio_thread_->init_com_with_mta(true); |
54 #endif | 56 #endif |
55 CHECK(audio_thread_->Start()); | 57 CHECK(audio_thread_->Start()); |
56 message_loop_ = audio_thread_->message_loop_proxy(); | 58 message_loop_ = audio_thread_->message_loop_proxy(); |
57 } | 59 } |
58 | 60 |
59 AudioManagerBase::~AudioManagerBase() { | 61 AudioManagerBase::~AudioManagerBase() { |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 output_listeners_.RemoveObserver(listener); | 396 output_listeners_.RemoveObserver(listener); |
395 } | 397 } |
396 | 398 |
397 void AudioManagerBase::NotifyAllOutputDeviceChangeListeners() { | 399 void AudioManagerBase::NotifyAllOutputDeviceChangeListeners() { |
398 DCHECK(message_loop_->BelongsToCurrentThread()); | 400 DCHECK(message_loop_->BelongsToCurrentThread()); |
399 DVLOG(1) << "Firing OnDeviceChange() notifications."; | 401 DVLOG(1) << "Firing OnDeviceChange() notifications."; |
400 FOR_EACH_OBSERVER(AudioDeviceListener, output_listeners_, OnDeviceChange()); | 402 FOR_EACH_OBSERVER(AudioDeviceListener, output_listeners_, OnDeviceChange()); |
401 } | 403 } |
402 | 404 |
403 } // namespace media | 405 } // namespace media |
OLD | NEW |