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

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: Removed more size_t 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
« no previous file with comments | « content/renderer/media/audio_hardware.h ('k') | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..183ebecd529510bea3e2d132f02ebe447f44ea10 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 uint32 input_channel_count = 0;
namespace audio_hardware {
@@ -47,12 +48,26 @@ size_t GetOutputBufferSize() {
return output_buffer_size;
}
+uint32 GetInputChannelCount() {
+ DCHECK(RenderThreadImpl::current() != NULL);
+
+ if (!input_channel_count) {
+ uint32 channels = 0;
+ RenderThreadImpl::current()->Send(
+ new ViewHostMsg_GetHardwareInputChannelCount(&channels));
+ 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
« no previous file with comments | « content/renderer/media/audio_hardware.h ('k') | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698