summaryrefslogtreecommitdiffstats
path: root/media/base/audio_hardware_config.h
diff options
context:
space:
mode:
authorcrogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-13 20:36:51 +0000
committercrogers@google.com <crogers@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-13 20:36:51 +0000
commit06ea4f7c2ee733bdf2e717af72cb56fb571eafac (patch)
treec1e387d65490a2bc7cf9bfc72e32d33b646e1df8 /media/base/audio_hardware_config.h
parenta5d3767bf2ddae040dd9bdb894bbe6276e7f5a2f (diff)
downloadchromium_src-06ea4f7c2ee733bdf2e717af72cb56fb571eafac.zip
chromium_src-06ea4f7c2ee733bdf2e717af72cb56fb571eafac.tar.gz
chromium_src-06ea4f7c2ee733bdf2e717af72cb56fb571eafac.tar.bz2
Pass more detailed audio hardware configuration information to the renderer
AudioHardwareConfig currently contains an ad-hoc mix of pieces of information about the audio input and output hardware. This CL adds more complete and symmetric information about the audio hardware as tracked in AudioHardwareConfig. The ChannelMixer is also upgraded to allow for "discrete" up and down mixing. BUG=none TEST=manual - several tests updated Review URL: https://codereview.chromium.org/12387006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@187936 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/audio_hardware_config.h')
-rw-r--r--media/base/audio_hardware_config.h33
1 files changed, 19 insertions, 14 deletions
diff --git a/media/base/audio_hardware_config.h b/media/base/audio_hardware_config.h
index e61d9ba..d1621b98 100644
--- a/media/base/audio_hardware_config.h
+++ b/media/base/audio_hardware_config.h
@@ -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,36 @@ namespace media {
// 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();
- int GetInputSampleRate();
- ChannelLayout GetInputChannelLayout();
+ int GetOutputBufferSize() const;
+ int GetOutputSampleRate() const;
+ ChannelLayout GetOutputChannelLayout() const;
+ int GetOutputChannels() const;
+
+ int GetInputSampleRate() const;
+ ChannelLayout GetInputChannelLayout() const;
+ int GetInputChannels() const;
+
+ media::AudioParameters GetInputConfig() const;
+ media::AudioParameters GetOutputConfig() 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
// any thread.
- void UpdateInputConfig(int sample_rate, media::ChannelLayout channel_layout);
- void UpdateOutputConfig(int buffer_size, int sample_rate);
+ void UpdateInputConfig(const media::AudioParameters& input_params);
+ void UpdateOutputConfig(const media::AudioParameters& output_params);
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_;
+ mutable base::Lock config_lock_;
+ media::AudioParameters input_params_;
+ media::AudioParameters output_params_;
DISALLOW_COPY_AND_ASSIGN(AudioHardwareConfig);
};