Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: media/audio/audio_parameters.h

Issue 115413002: Enable platform echo cancellation through the AudioRecord path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/android/audio_record_input.cc ('k') | media/audio/audio_parameters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
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.
« no previous file with comments | « media/audio/android/audio_record_input.cc ('k') | media/audio/audio_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698