summaryrefslogtreecommitdiffstats
path: root/content/renderer/render_thread_impl.cc
diff options
context:
space:
mode:
authordalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 00:25:41 +0000
committerdalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 00:25:41 +0000
commit3958e97c8efde46a9d72d8cdb5d9e78ccc49a7fc (patch)
treeabafb9736e2d358625aa03d5ba52d3fb2a1d3243 /content/renderer/render_thread_impl.cc
parent9dd95221d9bbde5b91598319bcf1f62d0fbcf888 (diff)
downloadchromium_src-3958e97c8efde46a9d72d8cdb5d9e78ccc49a7fc.zip
chromium_src-3958e97c8efde46a9d72d8cdb5d9e78ccc49a7fc.tar.gz
chromium_src-3958e97c8efde46a9d72d8cdb5d9e78ccc49a7fc.tar.bz2
Enable renderer side mixing behind a flag.
Lands the final bits required to turn on renderer side mixing behind a flag! Switching <audio> over to the PCM_LOW_LATENCY track to boot. Specifically the flag is --enable-renderer-side-mixing. The big picture: RenderThreadImpl owns an AudioRendererMixerManager which RenderAudioSourceProvider uses to create AudioRenderMixerInput, which extensions of AudioRendererSink. When ARMM creates ARMI it passes in callbacks which allow ARMI to retrieve an AudioRendererMixer from ARMM once ARMI::Initialize() has been called. When ARMM gets a request for an ARM from ARMI::Initialize() it will first check if one exists and if so, hand out a reference. If not, it will create a new ARM instance (which it owns) and initialize it with the proper hardware output AudioParameters and an AudioDevice based AudioRenderSink. ARM will immediately call Initialize() and Start() on AudioDevice which will then begin requesting data via RenderCallback from ARM. If the hardware sampling rate is not equal to the input sampling rate, ARM will instantiate a MultiChannelResampler instance to resample the audio as required for use by a PCM_LOW_LATENCY AudioDevice. After ARMI::Initialize() nothing really happens until RASP() eventually calls ARMI::Start() which will then register the ARMI instance with ARM. At which point ARM will start mixing it into the output stream it's providing to AudioDevice. Everything works as far as I can tell, but an optimization pass and more careful testing is necessary on Windows before the feature comes out from behind the flag. BUG=133637 TEST=New unit tests. Manual testing. Review URL: https://chromiumcodereview.appspot.com/10636036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/render_thread_impl.cc')
-rw-r--r--content/renderer/render_thread_impl.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 99988be..0cb9136 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -55,8 +55,10 @@
#include "content/renderer/dom_storage/webstoragenamespace_impl.h"
#include "content/renderer/gpu/compositor_thread.h"
#include "content/renderer/gpu/gpu_benchmarking_extension.h"
+#include "content/renderer/media/audio_hardware.h"
#include "content/renderer/media/audio_input_message_filter.h"
#include "content/renderer/media/audio_message_filter.h"
+#include "content/renderer/media/audio_renderer_mixer_manager.h"
#include "content/renderer/media/media_stream_center.h"
#include "content/renderer/media/video_capture_impl_manager.h"
#include "content/renderer/media/video_capture_message_filter.h"
@@ -111,6 +113,7 @@ using WebKit::WebScriptController;
using WebKit::WebSecurityPolicy;
using WebKit::WebString;
using WebKit::WebView;
+using content::AudioRendererMixerManager;
using content::RenderProcessObserver;
namespace {
@@ -750,6 +753,17 @@ RenderThreadImpl::GetGpuVDAContext3D() {
return gpu_vda_context3d_->AsWeakPtr();
}
+content::AudioRendererMixerManager*
+RenderThreadImpl::GetAudioRendererMixerManager() {
+ if (!audio_renderer_mixer_manager_.get()) {
+ audio_renderer_mixer_manager_.reset(new AudioRendererMixerManager(
+ audio_hardware::GetOutputSampleRate(),
+ audio_hardware::GetOutputBufferSize()));
+ }
+
+ return audio_renderer_mixer_manager_.get();
+}
+
#if defined(OS_WIN)
void RenderThreadImpl::PreCacheFont(const LOGFONT& log_font) {
Send(new ChildProcessHostMsg_PreCacheFont(log_font));