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_MAC_AUDIO_MANAGER_MAC_H_ | 5 #ifndef MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ |
| 6 #define MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ | 6 #define MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #include <AudioUnit/AudioUnit.h> | 8 #include <AudioUnit/AudioUnit.h> |
| 9 #include <CoreAudio/AudioHardware.h> | 9 #include <CoreAudio/AudioHardware.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 void InitializeOnAudioThread(); | 120 void InitializeOnAudioThread(); |
| 121 | 121 |
| 122 int ChooseBufferSize(bool is_input, int sample_rate); | 122 int ChooseBufferSize(bool is_input, int sample_rate); |
| 123 | 123 |
| 124 // Notify streams of a device change if the default output device or its | 124 // Notify streams of a device change if the default output device or its |
| 125 // sample rate has changed, otherwise does nothing. | 125 // sample rate has changed, otherwise does nothing. |
| 126 void HandleDeviceChanges(); | 126 void HandleDeviceChanges(); |
| 127 | 127 |
| 128 scoped_ptr<AudioDeviceListenerMac> output_device_listener_; | 128 std::unique_ptr<AudioDeviceListenerMac> output_device_listener_; |
|
danakj
2016/04/22 22:47:37
include memory
| |
| 129 | 129 |
| 130 // Track the output sample-rate and the default output device | 130 // Track the output sample-rate and the default output device |
| 131 // so we can intelligently handle device notifications only when necessary. | 131 // so we can intelligently handle device notifications only when necessary. |
| 132 int current_sample_rate_; | 132 int current_sample_rate_; |
| 133 AudioDeviceID current_output_device_; | 133 AudioDeviceID current_output_device_; |
| 134 | 134 |
| 135 // Helper class which monitors power events to determine if output streams | 135 // Helper class which monitors power events to determine if output streams |
| 136 // should defer Start() calls. Required to workaround an OSX bug. See | 136 // should defer Start() calls. Required to workaround an OSX bug. See |
| 137 // http://crbug.com/160920 for more details. | 137 // http://crbug.com/160920 for more details. |
| 138 class AudioPowerObserver; | 138 class AudioPowerObserver; |
| 139 scoped_ptr<AudioPowerObserver> power_observer_; | 139 std::unique_ptr<AudioPowerObserver> power_observer_; |
| 140 | 140 |
| 141 // Tracks all constructed input and output streams. | 141 // Tracks all constructed input and output streams. |
| 142 // TODO(alokp): We used to track these streams to close before destruction. | 142 // TODO(alokp): We used to track these streams to close before destruction. |
| 143 // We no longer close the streams, so we may be able to get rid of these | 143 // We no longer close the streams, so we may be able to get rid of these |
| 144 // member variables. They are currently used by MaybeChangeBufferSize(). | 144 // member variables. They are currently used by MaybeChangeBufferSize(). |
| 145 // Investigate if we can remove these. | 145 // Investigate if we can remove these. |
| 146 std::list<AudioInputStream*> basic_input_streams_; | 146 std::list<AudioInputStream*> basic_input_streams_; |
| 147 std::list<AUAudioInputStream*> low_latency_input_streams_; | 147 std::list<AUAudioInputStream*> low_latency_input_streams_; |
| 148 std::list<AUHALStream*> output_streams_; | 148 std::list<AUHALStream*> output_streams_; |
| 149 | 149 |
| 150 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); | 150 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace media | 153 } // namespace media |
| 154 | 154 |
| 155 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ | 155 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ |
| OLD | NEW |