Associate audio streams with their source/destination RenderView.
commit5ff11135bfe657fab30536b393522ba9b9b9a7bf
authormiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 4 Dec 2012 09:53:29 +0000 (4 09:53 +0000)
committermiu@chromium.org <miu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 4 Dec 2012 09:53:29 +0000 (4 09:53 +0000)
treefd5d16f744cc8d356e136f50c623332c2a93c818
parentc97dfc681180e48f4408c8121293cd4ea64bc41c
Associate audio streams with their source/destination RenderView.

This is a first step towards implementing three major Chromium features, all of which need to associate audio outputs with their source tabs.  See BUGs referenced by this change for more details.

Previous attempt/approach: https://codereview.chromium.org/11166002/

Specifics:

1. Added two new IPC messages: AudioHostMsg_AssociateStreamWithProducer and AudioInputHostMsg_AssociateStreamWithConsumer.
2. Added "associate to render_view_id" IPC calls: PepperPlatformAudioInputImpl, PepperPlatformAudioOutputImpl, RenderAudioSourceProvider, RendererWebAudioDeviceImpl, WebRtcAudioRenderer.
3. AudioOutputDevice instances re-use the same stream IDs.
4. Removed AudioDeviceFactory and replaced test-injection scheme in AudioRendererMixerManager.

Not in scope:

1. Associating RenderViews with audio input to WebRTC.
2. Associating RenderViews with streams produced by the AudioRendererMixer.
3. Speech Input (implementation is in the browser process, not the render process).

Testing method: Confirm correct render_view_id shows up in debug logging when engaging the various audio code paths.  Some of the many test sites used:

1. PPAPI (in and out): http://www.midomi.com/index.php?action=main.mic_check
2. WebMediaPlayer (e.g., <audio> and <video>): http://html5video.org/
3. WebAudio API: http://chromium.googlecode.com/svn/trunk/samples/audio/convolution-effects.html
4. WebRTC (output only): http://apprtc.appspot.com/

BUG=3541,64215,153392
TEST=Enabled debug logging via --vmodule=audio_renderer_host=1,audio_input_renderer_host=1 and then engaged the various Chrome audio code paths to confirm correct render_view_id shows up in browser process.

Review URL: https://chromiumcodereview.appspot.com/11359196

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170919 0039d316-1c4b-4281-b951-d872f2087c98
38 files changed:
content/browser/renderer_host/media/audio_input_renderer_host.cc
content/browser/renderer_host/media/audio_input_renderer_host.h
content/browser/renderer_host/media/audio_renderer_host.cc
content/browser/renderer_host/media/audio_renderer_host.h
content/common/media/audio_messages.h
content/content_renderer.gypi
content/renderer/media/audio_device_factory.cc
content/renderer/media/audio_device_factory.h
content/renderer/media/audio_input_message_filter.cc
content/renderer/media/audio_input_message_filter.h
content/renderer/media/audio_message_filter.cc
content/renderer/media/audio_message_filter.h
content/renderer/media/audio_renderer_mixer_manager.cc
content/renderer/media/audio_renderer_mixer_manager.h
content/renderer/media/audio_renderer_mixer_manager_unittest.cc
content/renderer/media/media_stream_impl.cc
content/renderer/media/render_audiosourceprovider.cc
content/renderer/media/render_audiosourceprovider.h
content/renderer/media/renderer_audio_output_device.cc [new file with mode: 0644]
content/renderer/media/renderer_audio_output_device.h [new file with mode: 0644]
content/renderer/media/renderer_webaudiodevice_impl.cc
content/renderer/media/renderer_webaudiodevice_impl.h
content/renderer/media/webrtc_audio_capturer.cc
content/renderer/media/webrtc_audio_capturer.h
content/renderer/media/webrtc_audio_device_impl.cc
content/renderer/media/webrtc_audio_device_unittest.cc
content/renderer/media/webrtc_audio_renderer.cc
content/renderer/media/webrtc_audio_renderer.h
content/renderer/pepper/pepper_platform_audio_input_impl.cc
content/renderer/pepper/pepper_platform_audio_input_impl.h
content/renderer/pepper/pepper_platform_audio_output_impl.cc
content/renderer/pepper/pepper_platform_audio_output_impl.h
content/renderer/pepper/pepper_plugin_delegate_impl.cc
content/renderer/render_view_impl.cc
content/test/webrtc_audio_device_test.cc
media/audio/audio_output_device.cc
media/audio/audio_output_device.h
media/audio/audio_output_device_unittest.cc