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

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: 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..547705d15d99a40175f37da0430a7fb4e98a1a93 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_channels = 0;
tommi (sloooow) - chröme 2012/01/17 12:01:08 input_channel_count
henrika (OOO until Aug 14) 2012/01/17 12:54:59 Done.
namespace audio_hardware {
@@ -47,12 +48,26 @@ size_t GetOutputBufferSize() {
return output_buffer_size;
}
+size_t GetInputChannels() {
+ DCHECK(RenderThreadImpl::current() != NULL);
+
+ if (!input_channels) {
+ size_t channels = 0;
+ RenderThreadImpl::current()->Send(
+ new ViewHostMsg_GetHardwareInputChannels(&channels));
+ input_channels = channels;
+ }
+
+ return input_channels;
+}
+
void ResetCache() {
DCHECK(RenderThreadImpl::current() != NULL);
output_sample_rate = 0.0;
input_sample_rate = 0.0;
output_buffer_size = 0;
+ input_channels = 0;
}
} // namespace audio_hardware

Powered by Google App Engine
This is Rietveld 408576698