Chromium Code Reviews| Index: media/audio/mac/audio_manager_mac.h |
| diff --git a/media/audio/mac/audio_manager_mac.h b/media/audio/mac/audio_manager_mac.h |
| index f8c99e80dfb749c01cd689223c955e02fed2b8ab..2b4064fe1389225260b3e4fa834654a7111f5381 100644 |
| --- a/media/audio/mac/audio_manager_mac.h |
| +++ b/media/audio/mac/audio_manager_mac.h |
| @@ -9,6 +9,7 @@ |
| #include <CoreAudio/AudioHardware.h> |
| #include <stddef.h> |
| #include <list> |
| +#include <map> |
|
o1ka
2016/04/22 12:24:24
move to .cc?
henrika (OOO until Aug 14)
2016/04/25 13:54:14
Used a map as member first. Then forgot to remove.
|
| #include <string> |
| #include "base/compiler_specific.h" |
| @@ -109,6 +110,25 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase { |
| } |
| size_t basic_input_streams() const { return basic_input_streams_.size(); } |
| +#if !defined(NDEBUG) |
| + // Prints a list of all existing output streams and there current buffer size |
| + // state (required and actual). Does nothing in Release builds. |
| + void PrintOutputBufferSizes(); |
| +#endif // !defined(NDEBUG) |
| + |
| + // This method is called when an output stream has been released and it takes |
| + // the given |device_id| and scans all active output streams that are |
| + // using this id. The goal is to find a new (larger) I/O buffer size which |
| + // can be applied to all active output streams since doing so will save |
| + // system resources. |
| + // Note that, it is only called if no input stream is also using the device. |
| + // Example: two active output streams where #1 wants 1024 as buffer size but |
| + // is using 256 since stream #2 wants it. Now, if stream #2 is closed down, |
| + // the native I/O buffer size will be increased to 1024 instead of 256. |
| + // TODO(henrika): possibly extend the scheme to also take input streams into |
| + // account. |
| + bool IncreaseIOBufferSizeIfPossible(AudioDeviceID device_id); |
|
o1ka
2016/04/22 12:24:24
Protected?
henrika (OOO until Aug 14)
2016/04/25 13:54:14
My bad. Now even private.
|
| + |
| protected: |
| ~AudioManagerMac() override; |
| @@ -125,6 +145,9 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase { |
| // sample rate has changed, otherwise does nothing. |
| void HandleDeviceChanges(); |
| + // Returns true if any active input stream is using the specified |device_id|. |
| + bool AudioDeviceIsUsedForInput(AudioDeviceID device_id); |
| + |
| scoped_ptr<AudioDeviceListenerMac> output_device_listener_; |
| // Track the output sample-rate and the default output device |