Chromium Code Reviews| Index: media/audio/audio_parameters.h |
| diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h |
| index 9b86d31186a7c2d33f6f0388b36a344f0855cd97..f921fd0b2c97a50943b9aa5d78e2d80eeaec36df 100644 |
| --- a/media/audio/audio_parameters.h |
| +++ b/media/audio/audio_parameters.h |
| @@ -44,6 +44,16 @@ class MEDIA_EXPORT AudioParameters { |
| kAudioCDSampleRate = 44100, |
| }; |
| + // Used to carry whether certin platform (typically hardware) audio effects |
| + // should be enabled. |
| + struct PlatformEffects { |
| + PlatformEffects() : echo_canceller(false) {} |
| + bool operator==(const PlatformEffects& other) const { |
|
tommi (sloooow) - chröme
2013/12/11 12:14:36
document why you need the comparison operator. Usu
ajm
2013/12/11 17:46:49
It was only to support the AudioParameters compari
|
| + return echo_canceller == other.echo_canceller; |
| + } |
| + bool echo_canceller; |
| + }; |
| + |
| AudioParameters(); |
| AudioParameters(Format format, ChannelLayout channel_layout, |
| int sample_rate, int bits_per_sample, |
| @@ -81,9 +91,11 @@ class MEDIA_EXPORT AudioParameters { |
| int frames_per_buffer() const { return frames_per_buffer_; } |
| int channels() const { return channels_; } |
| int input_channels() const { return input_channels_; } |
| + const PlatformEffects& effects() const { return effects_; } |
| // Set to CHANNEL_LAYOUT_DISCRETE with given number of channels. |
| void SetDiscreteChannels(int channels); |
| + void SetPlatformEffects(const PlatformEffects& effects); |
| // Comparison with other AudioParams. |
| bool operator==(const AudioParameters& other) const { |
| @@ -93,7 +105,8 @@ class MEDIA_EXPORT AudioParameters { |
| channels_ == other.channels() && |
| input_channels_ == other.input_channels() && |
| bits_per_sample_ == other.bits_per_sample() && |
| - frames_per_buffer_ == other.frames_per_buffer(); |
| + frames_per_buffer_ == other.frames_per_buffer() && |
| + effects_ == other.effects(); |
| } |
| private: |
| @@ -108,6 +121,7 @@ class MEDIA_EXPORT AudioParameters { |
| int input_channels_; // Optional number of input channels. |
| // Normally 0, but can be set to specify |
| // synchronized I/O. |
| + PlatformEffects effects_; // See PlatformEffects. |
| }; |
| // Comparison is useful when AudioParameters is used with std structures. |