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

Unified Diff: media/audio/audio_parameters.h

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some cross-platform errors. Created 5 years, 3 months 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
Index: media/audio/audio_parameters.h
diff --git a/media/audio/audio_parameters.h b/media/audio/audio_parameters.h
index a73982e6ba259721770158a9c00bbf707b28f283..0fff28bee4107f0e5079f2c542612dce098e2bfa 100644
--- a/media/audio/audio_parameters.h
+++ b/media/audio/audio_parameters.h
@@ -11,6 +11,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/time/time.h"
+#include "media/audio/point.h"
#include "media/base/audio_bus.h"
#include "media/base/channel_layout.h"
#include "media/base/media_export.h"
@@ -80,15 +81,25 @@ class MEDIA_EXPORT AudioParameters {
};
AudioParameters();
- AudioParameters(Format format, ChannelLayout channel_layout,
- int sample_rate, int bits_per_sample,
- int frames_per_buffer);
- AudioParameters(Format format, ChannelLayout channel_layout,
- int sample_rate, int bits_per_sample,
- int frames_per_buffer, int effects);
- AudioParameters(Format format, ChannelLayout channel_layout,
- int channels, int sample_rate, int bits_per_sample,
- int frames_per_buffer, int effects);
+ AudioParameters(
+ Format format,
+ ChannelLayout channel_layout,
+ int sample_rate,
+ int bits_per_sample,
+ int frames_per_buffer,
+ const std::vector<Point>& mic_positions = std::vector<Point>(),
+ int effects = NO_EFFECTS);
+ AudioParameters(
+ Format format,
+ int channels,
+ ChannelLayout channel_layout,
+ int sample_rate,
+ int bits_per_sample,
+ int frames_per_buffer,
+ const std::vector<Point>& mic_positions = std::vector<Point>(),
+ int effects = NO_EFFECTS);
+
+ ~AudioParameters();
void Reset(Format format, ChannelLayout channel_layout,
int channels, int sample_rate, int bits_per_sample,
@@ -125,6 +136,7 @@ class MEDIA_EXPORT AudioParameters {
int frames_per_buffer() const { return frames_per_buffer_; }
int channels() const { return channels_; }
int effects() const { return effects_; }
+ const std::vector<Point>& mic_positions() const { return mic_positions_; }
private:
// These members are mutable to support entire struct assignment. They should
@@ -137,6 +149,20 @@ class MEDIA_EXPORT AudioParameters {
int channels_; // Number of channels. Value set based on
// |channel_layout|.
+
+ // Microphone positions using Cartesian coordinates:
+ // x: the horizontal dimension, with positive to the right from the camera's
+ // perspective.
+ // y: the depth dimension, with positive forward from the camera's
+ // perspective.
+ // z: the vertical dimension, with positive upwards.
+ //
+ // Usually, the center of the microphone array will be treated as the origin
+ // (often the position of the camera).
+ //
+ // An empty vector indicates unknown positions.
+ std::vector<Point> mic_positions_;
+
int effects_; // Bitmask using PlatformEffectsMask.
};

Powered by Google App Engine
This is Rietveld 408576698