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..62ff4fd48f1eb1a3098b46491e254af67c0dbf89 100644 |
| --- a/media/audio/audio_parameters.h |
| +++ b/media/audio/audio_parameters.h |
| @@ -44,6 +44,13 @@ class MEDIA_EXPORT AudioParameters { |
| kAudioCDSampleRate = 44100, |
| }; |
| + // Bitmasks to determine whether certain platform (typically hardware) audio |
| + // effects should be enabled. |
| + enum PlatformEffectsMask { |
| + NO_EFFECTS = 0x0, |
| + ECHO_CANCELLER = 0x1 |
| + }; |
| + |
| AudioParameters(); |
| AudioParameters(Format format, ChannelLayout channel_layout, |
| int sample_rate, int bits_per_sample, |
| @@ -51,7 +58,12 @@ class MEDIA_EXPORT AudioParameters { |
| AudioParameters(Format format, ChannelLayout channel_layout, |
| int input_channels, |
| int sample_rate, int bits_per_sample, |
| - int frames_per_buffer); |
| + int frames_per_buffer, int effects); |
| + AudioParameters(Format format, ChannelLayout channel_layout, |
| + int channels, int input_channels, |
| + int sample_rate, int bits_per_sample, |
| + int frames_per_buffer, int effects); |
| + |
| void Reset(Format format, ChannelLayout channel_layout, |
| int channels, int input_channels, |
| int sample_rate, int bits_per_sample, |
| @@ -81,9 +93,7 @@ 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_; } |
| - |
| - // Set to CHANNEL_LAYOUT_DISCRETE with given number of channels. |
| - void SetDiscreteChannels(int channels); |
| + int effects() const { return effects_; } |
| // Comparison with other AudioParams. |
| bool operator==(const AudioParameters& other) const { |
| @@ -93,10 +103,13 @@ 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: |
| + // These members are mutable to support entire struct assignment. They should |
| + // not be mutated individually. |
|
ajm
2013/12/12 03:36:03
Dale, Tommi: To legitimize this comment, I removed
tommi (sloooow) - chröme
2013/12/12 12:05:31
sgtm.
Dale - afaict we never actually set layout
ajm
2013/12/12 17:35:05
It was actually used in audio_manager_mac.cc as we
|
| Format format_; // Format of the stream. |
| ChannelLayout channel_layout_; // Order of surround sound channels. |
| int sample_rate_; // Sampling frequency/rate. |
| @@ -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. |
| + int effects_; // Bitmask using PlatformEffectsMask. |
| }; |
| // Comparison is useful when AudioParameters is used with std structures. |