Chromium Code Reviews| Index: media/base/audio_hardware_config.h |
| =================================================================== |
| --- media/base/audio_hardware_config.h (revision 185058) |
| +++ media/base/audio_hardware_config.h (working copy) |
| @@ -15,18 +15,37 @@ |
| // Provides thread safe access to the audio hardware configuration. |
| class MEDIA_EXPORT AudioHardwareConfig { |
| public: |
| - AudioHardwareConfig(int output_buffer_size, int output_sample_rate, |
| + AudioHardwareConfig(); |
|
DaleCurtis
2013/02/28 02:18:08
Is this necessary?
|
| + |
| + AudioHardwareConfig(int buffer_size, |
| + int output_sample_rate, |
| + int output_channels, |
| + ChannelLayout output_channel_layout, |
| int input_sample_rate, |
| + int input_channels, |
| ChannelLayout input_channel_layout); |
| virtual ~AudioHardwareConfig(); |
| + void Reset(int buffer_size, |
|
DaleCurtis
2013/02/28 02:18:08
output_buffer_size here and elsewhere. Why not jus
|
| + int output_sample_rate, |
| + int output_channels, |
| + ChannelLayout output_channel_layout, |
| + int input_sample_rate, |
| + int input_channels, |
| + ChannelLayout input_channel_layout); |
| + |
| // Accessors for the currently cached hardware configuration. Safe to call |
| // from any thread. |
| - int GetOutputBufferSize(); |
| - int GetOutputSampleRate(); |
| - int GetInputSampleRate(); |
| - ChannelLayout GetInputChannelLayout(); |
| + int GetOutputBufferSize() const; |
| + |
| + int GetOutputSampleRate() const; |
| + int GetOutputChannels() const; |
| + ChannelLayout GetOutputChannelLayout() const; |
| + int GetInputSampleRate() const; |
| + int GetInputChannels() const; |
| + ChannelLayout GetInputChannelLayout() const; |
| + |
| // Allows callers to update the cached values for either input or output. The |
| // values are paired under the assumption that these values will only be set |
| // after an input or output device change respectively. Safe to call from |
| @@ -36,10 +55,14 @@ |
| private: |
| // Cached values; access is protected by |config_lock_|. |
| - base::Lock config_lock_; |
| + mutable base::Lock config_lock_; |
| + |
| int output_buffer_size_; |
| int output_sample_rate_; |
| + int output_channels_; |
| + ChannelLayout output_channel_layout_; |
| int input_sample_rate_; |
| + int input_channels_; |
| ChannelLayout input_channel_layout_; |
| DISALLOW_COPY_AND_ASSIGN(AudioHardwareConfig); |