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

Unified Diff: content/renderer/media/audio_hardware.cc

Issue 9221010: Adds support for 16kHz input sample rate and mono channel config. in WebRTC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding 16 and 32kHz input support on Mac OS X Created 8 years, 11 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: content/renderer/media/audio_hardware.cc
diff --git a/content/renderer/media/audio_hardware.cc b/content/renderer/media/audio_hardware.cc
index 24df14f1219ceb8dcb9d7185402a0b58b09849dc..662df10f4b328850c02487652f808bf38aa9e76d 100644
--- a/content/renderer/media/audio_hardware.cc
+++ b/content/renderer/media/audio_hardware.cc
@@ -11,6 +11,7 @@
static double output_sample_rate = 0.0;
static double input_sample_rate = 0.0;
static size_t output_buffer_size = 0;
+static size_t input_channel_count = 0;
namespace audio_hardware {
@@ -47,12 +48,26 @@ size_t GetOutputBufferSize() {
return output_buffer_size;
}
+size_t GetInputChannelCount() {
+ DCHECK(RenderThreadImpl::current() != NULL);
+
+ if (!input_channel_count) {
+ size_t channels = 0;
+ RenderThreadImpl::current()->Send(
+ new ViewHostMsg_GetHardwareInputChannelCount(&channels));
scherkus (not reviewing) 2012/01/18 18:19:38 indent
henrika (OOO until Aug 14) 2012/01/19 09:42:24 Done.
+ input_channel_count = channels;
+ }
+
+ return input_channel_count;
+}
+
void ResetCache() {
DCHECK(RenderThreadImpl::current() != NULL);
output_sample_rate = 0.0;
input_sample_rate = 0.0;
output_buffer_size = 0;
+ input_channel_count = 0;
}
} // namespace audio_hardware

Powered by Google App Engine
This is Rietveld 408576698