From 1ac780fbb82a40fb92fbd785a68bd64fe568e88b Mon Sep 17 00:00:00 2001 From: "henrika@chromium.org" Date: Thu, 19 Jan 2012 14:30:23 +0000 Subject: Adds support for 16kHz input sample rate and mono channel config. in WebRTC. BUG=WebRTC demo doesn't work with Logitech 9000 as microphone TEST=content_unittest --gtest_filter=WebRTCAudioDeviceTest* Review URL: https://chromiumcodereview.appspot.com/9221010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118291 0039d316-1c4b-4281-b951-d872f2087c98 --- content/browser/renderer_host/render_message_filter.cc | 6 ++++++ content/browser/renderer_host/render_message_filter.h | 1 + 2 files changed, 7 insertions(+) (limited to 'content/browser') diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 6429524..23e4e25 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -380,6 +380,8 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message, OnGetHardwareInputSampleRate) IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate, OnGetHardwareSampleRate) + IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareInputChannelCount, + OnGetHardwareInputChannelCount) IPC_MESSAGE_HANDLER(ViewHostMsg_MediaLogEvent, OnMediaLogEvent) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP_EX() @@ -673,6 +675,10 @@ void RenderMessageFilter::OnGetHardwareSampleRate(double* sample_rate) { *sample_rate = media::GetAudioHardwareSampleRate(); } +void RenderMessageFilter::OnGetHardwareInputChannelCount(uint32* channels) { + *channels = static_cast(media::GetAudioInputHardwareChannelCount()); +} + void RenderMessageFilter::OnDownloadUrl(const IPC::Message& message, const GURL& url, const GURL& referrer, diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index f0519fd..445bcd9 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h @@ -175,6 +175,7 @@ class RenderMessageFilter : public content::BrowserMessageFilter { void OnGetHardwareBufferSize(uint32* buffer_size); void OnGetHardwareInputSampleRate(double* sample_rate); void OnGetHardwareSampleRate(double* sample_rate); + void OnGetHardwareInputChannelCount(uint32* channels); // Used to ask the browser to allocate a block of shared memory for the // renderer to send back data in, since shared memory can't be created -- cgit v1.1