Allow AudioDestination to support local/live audio input
authorcrogers@google.com <crogers@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2012 23:04:48 +0000 (23:04 +0000)
committercrogers@google.com <crogers@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2012 23:04:48 +0000 (23:04 +0000)
commitfa21243dac8a9005f3f6ad22370a4f50a390f39b
tree0ff8ebd4021587308d0cc0c5ed9d2b61be4d2e83
parent8d42d3088e64e8d637b296dd506ffbc4e403aa1d
Allow AudioDestination to support local/live audio input
https://bugs.webkit.org/show_bug.cgi?id=90318

Reviewed by Kenneth Russell.

Source/Platform:

* chromium/public/WebAudioDevice.h:
(WebKit::WebAudioDevice::RenderCallback::render):
(RenderCallback):

Source/WebCore:

* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* GNUmakefile.list.am:
Add AudioIOCallback.h to make files.

* Modules/webaudio/AudioDestinationNode.h:
* Modules/webaudio/AudioDestinationNode.cpp:
(WebCore::AudioDestinationNode::render):
Change provideInput() method to render() to support optional audio input.

(AudioDestinationNode):
(WebCore::AudioDestinationNode::localAudioInputProvider):
Expose public access to an AudioSourceProvider for local/live audio input.

(LocalAudioInputProvider):
(WebCore::AudioDestinationNode::LocalAudioInputProvider::LocalAudioInputProvider):
(WebCore::AudioDestinationNode::LocalAudioInputProvider::set):
(WebCore::AudioDestinationNode::LocalAudioInputProvider::provideInput):
Add simple AudioSourceProvider implementation which dishes out a single AudioBus each
render quantum for optional local/live audio input.

* Modules/webaudio/OfflineAudioDestinationNode.h:
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):
(WebCore::OfflineAudioDestinationNode::offlineRenderEntry):
(WebCore::OfflineAudioDestinationNode::offlineRender):
Simple name change using "offline" prefix to avoid confusion with AudioDestinationNode::render() method (implementing AudioIOCallback)

* platform/audio/AudioDestination.h:
Switch create() method to take an AudioIOCallback instead of AudioSourceProvider.

* platform/audio/AudioIOCallback.h:
(WebCore::AudioIOCallback::~AudioIOCallback):
Add new AudioIOCallback interface for audio input/output.

* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::AudioDestination::create):
(WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
* platform/audio/gstreamer/AudioDestinationGStreamer.h:
(AudioDestinationGStreamer):
(WebCore::AudioDestinationGStreamer::callback):
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(_WebKitWebAudioSourcePrivate):
(webKitWebAudioSrcSetProperty):
(webKitWebAudioSrcLoop):
Small tweaks to AudioDestinationGStreamer implementation to account for switch to AudioIOCallback.

* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestination::create):
(WebCore::AudioDestinationMac::AudioDestinationMac):
(WebCore::AudioDestinationMac::render):
* platform/audio/mac/AudioDestinationMac.h:
(AudioDestinationMac):
Small tweaks to AudioDestinationMac implementation to account for switch to AudioIOCallback.

Source/WebKit/chromium:

* src/AudioDestinationChromium.cpp:
(WebCore::AudioDestination::create):
(WebCore::AudioDestinationChromium::AudioDestinationChromium):
(WebCore::AudioDestinationChromium::provideInput):
(WebCore):
* src/AudioDestinationChromium.h:
(AudioDestinationChromium):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@124264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/Platform/ChangeLog
Source/Platform/chromium/public/WebAudioDevice.h
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Modules/webaudio/AudioDestinationNode.cpp
Source/WebCore/Modules/webaudio/AudioDestinationNode.h
Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.cpp
Source/WebCore/Modules/webaudio/OfflineAudioDestinationNode.h
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/audio/AudioDestination.h
Source/WebCore/platform/audio/AudioIOCallback.h [new file with mode: 0644]
Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.cpp
Source/WebCore/platform/audio/gstreamer/AudioDestinationGStreamer.h
Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
Source/WebCore/platform/audio/mac/AudioDestinationMac.cpp
Source/WebCore/platform/audio/mac/AudioDestinationMac.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/AudioDestinationChromium.cpp
Source/WebKit/chromium/src/AudioDestinationChromium.h