Chromium Code Reviews| 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 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | |
| 10 | 11 |
| 11 #include "base/atomic_ref_count.h" | 12 #include "base/atomic_ref_count.h" |
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 15 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 16 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
| 17 #include "media/audio/audio_manager.h" | 18 #include "media/audio/audio_manager.h" |
| 18 | 19 |
| 19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 AudioDeviceListener* listener) OVERRIDE; | 116 AudioDeviceListener* listener) OVERRIDE; |
| 116 virtual void RemoveOutputDeviceChangeListener( | 117 virtual void RemoveOutputDeviceChangeListener( |
| 117 AudioDeviceListener* listener) OVERRIDE; | 118 AudioDeviceListener* listener) OVERRIDE; |
| 118 | 119 |
| 119 protected: | 120 protected: |
| 120 AudioManagerBase(); | 121 AudioManagerBase(); |
| 121 | 122 |
| 122 // TODO(dalecurtis): This must change to map both input and output parameters | 123 // TODO(dalecurtis): This must change to map both input and output parameters |
| 123 // to a single dispatcher, otherwise on a device state change we'll just get | 124 // to a single dispatcher, otherwise on a device state change we'll just get |
| 124 // the exact same invalid dispatcher. | 125 // the exact same invalid dispatcher. |
| 125 typedef std::map<AudioParameters, scoped_refptr<AudioOutputDispatcher>, | 126 typedef std::map< std::pair<AudioParameters, AudioParameters>, |
|
scherkus (not reviewing)
2012/10/22 23:51:05
nit: we usually don't have the space after the ope
DaleCurtis
2012/10/23 01:49:42
Done.
| |
| 126 AudioParameters::Compare> | 127 scoped_refptr<AudioOutputDispatcher> > |
| 127 AudioOutputDispatchersMap; | 128 AudioOutputDispatchersMap; |
| 128 | 129 |
| 129 // Shuts down the audio thread and releases all the audio output dispatchers | 130 // Shuts down the audio thread and releases all the audio output dispatchers |
| 130 // on the audio thread. All audio streams should be freed before | 131 // on the audio thread. All audio streams should be freed before |
| 131 // Shutdown is called. | 132 // Shutdown is called. |
| 132 // This must be called in the destructor of the AudioManager<Platform>. | 133 // This must be called in the destructor of the AudioManager<Platform>. |
| 133 void Shutdown(); | 134 void Shutdown(); |
| 134 | 135 |
| 135 void ShutdownOnAudioThread(); | 136 void ShutdownOnAudioThread(); |
| 136 | 137 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 | 171 |
| 171 // Track output state change listeners. | 172 // Track output state change listeners. |
| 172 ObserverList<AudioDeviceListener> output_listeners_; | 173 ObserverList<AudioDeviceListener> output_listeners_; |
| 173 | 174 |
| 174 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 175 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
| 175 }; | 176 }; |
| 176 | 177 |
| 177 } // namespace media | 178 } // namespace media |
| 178 | 179 |
| 179 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 180 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
| OLD | NEW |