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

Unified Diff: webrtc/audio/utility/audio_frame_operations.h

Issue 2712743004: Support 4 channel mic in Windows Core Audio (Closed)
Patch Set: Fix another non-Windows build error Created 3 years, 10 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: webrtc/audio/utility/audio_frame_operations.h
diff --git a/webrtc/audio/utility/audio_frame_operations.h b/webrtc/audio/utility/audio_frame_operations.h
index d16b163e7d1139f10ba00e87e73524648e01bebd..de6fdc472d710074ed603600ce73b8a493165447 100644
--- a/webrtc/audio/utility/audio_frame_operations.h
+++ b/webrtc/audio/utility/audio_frame_operations.h
@@ -40,6 +40,7 @@ class AudioFrameOperations {
static void MonoToStereo(const int16_t* src_audio,
size_t samples_per_channel,
int16_t* dst_audio);
+
// |frame.num_channels_| will be updated. This version checks for sufficient
// buffer size and that |num_channels_| is mono.
static int MonoToStereo(AudioFrame* frame);
@@ -50,10 +51,49 @@ class AudioFrameOperations {
static void StereoToMono(const int16_t* src_audio,
size_t samples_per_channel,
int16_t* dst_audio);
+
// |frame.num_channels_| will be updated. This version checks that
// |num_channels_| is stereo.
static int StereoToMono(AudioFrame* frame);
+ // Downmixes 4 channels |src_audio| to stereo |dst_audio|. This is an in-place
+ // operation, meaning |src_audio| and |dst_audio| may point to the same
+ // buffer.
+ static void QuadToStereo(const int16_t* src_audio,
+ size_t samples_per_channel,
+ int16_t* dst_audio);
+
+ // |frame.num_channels_| will be updated. This version checks that
+ // |num_channels_| is 4 channels.
+ static int QuadToStereo(AudioFrame* frame);
+
+ // Downmixes 4 channels |src_audio| to mono |dst_audio|. This is an in-place
+ // operation, meaning |src_audio| and |dst_audio| may point to the same
+ // buffer.
+ static void QuadToMono(const int16_t* src_audio,
+ size_t samples_per_channel,
+ int16_t* dst_audio);
+
+ // |frame.num_channels_| will be updated. This version checks that
+ // |num_channels_| is 4 channels.
+ static int QuadToMono(AudioFrame* frame);
+
+ // Downmixes |src_channels| |src_audio| to |dst_channels| |dst_audio|.
+ // This is an in-place operation, meaning |src_audio| and |dst_audio|
+ // may point to the same buffer. Supported channel combinations are
+ // Stereo to Mono, Quad to Mono, and Quad to Stereo.
+ static void DownmixChannels(const int16_t* src_audio,
+ size_t src_channels,
+ size_t samples_per_channel,
+ size_t dst_channels,
+ int16_t* dst_audio);
+
+ // |frame.num_channels_| will be updated. This version checks that
+ // |num_channels_| and |dst_channels| are valid and performs relevant
+ // downmix. Supported channel combinations are Stereo to Mono, Quad to Mono,
+ // and Quad to Stereo.
+ static int DownmixChannels(size_t dst_channels, AudioFrame* frame);
+
// Swap the left and right channels of |frame|. Fails silently if |frame| is
// not stereo.
static void SwapStereoChannels(AudioFrame* frame);

Powered by Google App Engine
This is Rietveld 408576698