Chromium Code Reviews| Index: media/base/audio_hardware_config.h |
| =================================================================== |
| --- media/base/audio_hardware_config.h (revision 186233) |
| +++ media/base/audio_hardware_config.h (working copy) |
| @@ -7,6 +7,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/synchronization/lock.h" |
| +#include "media/audio/audio_parameters.h" |
| #include "media/base/channel_layout.h" |
| #include "media/base/media_export.h" |
| @@ -15,32 +16,34 @@ |
| // Provides thread safe access to the audio hardware configuration. |
| class MEDIA_EXPORT AudioHardwareConfig { |
| public: |
| - AudioHardwareConfig(int output_buffer_size, int output_sample_rate, |
| - int input_sample_rate, |
| - ChannelLayout input_channel_layout); |
| + AudioHardwareConfig(const media::AudioParameters& input_params, |
| + const media::AudioParameters& output_params); |
| virtual ~AudioHardwareConfig(); |
| // Accessors for the currently cached hardware configuration. Safe to call |
| // from any thread. |
| int GetOutputBufferSize(); |
| int GetOutputSampleRate(); |
| + ChannelLayout GetOutputChannelLayout(); |
| + int GetOutputChannels(); |
| + |
| int GetInputSampleRate(); |
| ChannelLayout GetInputChannelLayout(); |
| + int GetInputChannels(); |
| // 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 |
| // any thread. |
| + // TODO(crogers): These methods should be updated to take AudioParameters! |
|
DaleCurtis
2013/03/06 19:19:30
Seems like that should be done in this CL? You're
|
| void UpdateInputConfig(int sample_rate, media::ChannelLayout channel_layout); |
| void UpdateOutputConfig(int buffer_size, int sample_rate); |
| private: |
| // Cached values; access is protected by |config_lock_|. |
| base::Lock config_lock_; |
| - int output_buffer_size_; |
| - int output_sample_rate_; |
| - int input_sample_rate_; |
| - ChannelLayout input_channel_layout_; |
| + media::AudioParameters input_params_; |
| + media::AudioParameters output_params_; |
| DISALLOW_COPY_AND_ASSIGN(AudioHardwareConfig); |
| }; |