Diff
Modified: trunk/Source/WebCore/ChangeLog (139651 => 139652)
--- trunk/Source/WebCore/ChangeLog 2013-01-14 21:16:15 UTC (rev 139651)
+++ trunk/Source/WebCore/ChangeLog 2013-01-14 21:21:37 UTC (rev 139652)
@@ -1,3 +1,30 @@
+2013-01-14 Mark Pilgrim <pilg...@chromium.org>
+
+ [Chromium] Move AudioDestinationChromium into WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=106803
+
+ Reviewed by Adam Barth.
+
+ This doesn't really belong in WebKit/chromium/src since it defines
+ things directly in the WebCore namespace.
+
+ * WebCore.gypi:
+ * platform/audio/chromium/AudioDestinationChromium.cpp: Added.
+ (WebCore):
+ (WebCore::AudioDestination::create):
+ (WebCore::AudioDestinationChromium::AudioDestinationChromium):
+ (WebCore::AudioDestinationChromium::~AudioDestinationChromium):
+ (WebCore::AudioDestinationChromium::start):
+ (WebCore::AudioDestinationChromium::stop):
+ (WebCore::AudioDestination::hardwareSampleRate):
+ (WebCore::AudioDestinationChromium::render):
+ (WebCore::AudioDestinationChromium::provideInput):
+ * platform/audio/chromium/AudioDestinationChromium.h: Added.
+ (WebCore):
+ (AudioDestinationChromium):
+ (WebCore::AudioDestinationChromium::isPlaying):
+ (WebCore::AudioDestinationChromium::sampleRate):
+
2013-01-14 Adrian Perez de Castro <ape...@igalia.com>
[GTK] Fix indentation for GStreamer supported MIME types list
Modified: trunk/Source/WebCore/WebCore.gypi (139651 => 139652)
--- trunk/Source/WebCore/WebCore.gypi 2013-01-14 21:16:15 UTC (rev 139651)
+++ trunk/Source/WebCore/WebCore.gypi 2013-01-14 21:21:37 UTC (rev 139652)
@@ -3616,6 +3616,8 @@
'platform/audio/ZeroPole.cpp',
'platform/audio/ZeroPole.h',
'platform/audio/chromium/AudioBusChromium.cpp',
+ 'platform/audio/chromium/AudioDestinationChromium.cpp',
+ 'platform/audio/chromium/AudioDestinationChromium.h',
'platform/audio/mac/AudioBusMac.mm',
'platform/audio/mac/AudioDestinationMac.cpp',
'platform/audio/mac/AudioDestinationMac.h',
Copied: trunk/Source/WebCore/platform/audio/chromium/AudioDestinationChromium.cpp (from rev 139650, trunk/Source/WebKit/chromium/src/AudioDestinationChromium.cpp) (0 => 139652)
--- trunk/Source/WebCore/platform/audio/chromium/AudioDestinationChromium.cpp (rev 0)
+++ trunk/Source/WebCore/platform/audio/chromium/AudioDestinationChromium.cpp 2013-01-14 21:21:37 UTC (rev 139652)
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_AUDIO)
+
+#include "AudioDestinationChromium.h"
+
+#include "AudioFIFO.h"
+#include "AudioPullFIFO.h"
+#include <public/Platform.h>
+
+namespace WebCore {
+
+// Buffer size at which the web audio engine will render.
+const unsigned renderBufferSize = 128;
+
+// Size of the FIFO
+const size_t fifoSize = 8192;
+
+// Factory method: Chromium-implementation
+PassOwnPtr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate)
+{
+ return adoptPtr(new AudioDestinationChromium(callback, numberOfInputChannels, numberOfOutputChannels, sampleRate));
+}
+
+AudioDestinationChromium::AudioDestinationChromium(AudioIOCallback& callback, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate)
+ : m_callback(callback)
+ , m_numberOfOutputChannels(numberOfOutputChannels)
+ , m_inputBus(numberOfInputChannels, renderBufferSize)
+ , m_renderBus(numberOfOutputChannels, renderBufferSize, false)
+ , m_sampleRate(sampleRate)
+ , m_isPlaying(false)
+{
+ // Use the optimal buffer size recommended by the audio backend.
+ m_callbackBufferSize = WebKit::Platform::current()->audioHardwareBufferSize();
+
+ // Quick exit if the requested size is too large.
+ ASSERT(m_callbackBufferSize + renderBufferSize <= fifoSize);
+ if (m_callbackBufferSize + renderBufferSize > fifoSize)
+ return;
+
+ // FIXME: switch to new API (with input channels) once chromium supports it.
+ m_audioDevice = adoptPtr(WebKit::Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfOutputChannels, sampleRate, this));
+ ASSERT(m_audioDevice);
+
+ // Create a FIFO to handle the possibility of the callback size
+ // not being a multiple of the render size. If the FIFO already
+ // contains enough data, the data will be provided directly.
+ // Otherwise, the FIFO will call the provider enough times to
+ // satisfy the request for data.
+ m_fifo = adoptPtr(new AudioPullFIFO(*this, numberOfOutputChannels, fifoSize, renderBufferSize));
+
+ // Input buffering.
+ m_inputFifo = adoptPtr(new AudioFIFO(numberOfInputChannels, fifoSize));
+
+ // If the callback size does not match the render size, then we need to buffer some
+ // extra silence for the input. Otherwise, we can over-consume the input FIFO.
+ if (m_callbackBufferSize != renderBufferSize) {
+ // FIXME: handle multi-channel input and don't hard-code to stereo.
+ AudioBus silence(2, renderBufferSize);
+ m_inputFifo->push(&silence);
+ }
+}
+
+AudioDestinationChromium::~AudioDestinationChromium()
+{
+ stop();
+}
+
+void AudioDestinationChromium::start()
+{
+ if (!m_isPlaying && m_audioDevice) {
+ m_audioDevice->start();
+ m_isPlaying = true;
+ }
+}
+
+void AudioDestinationChromium::stop()
+{
+ if (m_isPlaying && m_audioDevice) {
+ m_audioDevice->stop();
+ m_isPlaying = false;
+ }
+}
+
+float AudioDestination::hardwareSampleRate()
+{
+ return static_cast<float>(WebKit::Platform::current()->audioHardwareSampleRate());
+}
+
+void AudioDestinationChromium::render(const WebKit::WebVector<float*>& sourceData, const WebKit::WebVector<float*>& audioData, size_t numberOfFrames)
+{
+ bool isNumberOfChannelsGood = audioData.size() == m_numberOfOutputChannels;
+ if (!isNumberOfChannelsGood) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+
+ bool isBufferSizeGood = numberOfFrames == m_callbackBufferSize;
+ if (!isBufferSizeGood) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+
+ // Buffer optional live input.
+ if (sourceData.size() >= 2) {
+ // FIXME: handle multi-channel input and don't hard-code to stereo.
+ AudioBus wrapperBus(2, numberOfFrames, false);
+ wrapperBus.setChannelMemory(0, sourceData[0], numberOfFrames);
+ wrapperBus.setChannelMemory(1, sourceData[1], numberOfFrames);
+ m_inputFifo->push(&wrapperBus);
+ }
+
+ m_renderBus.setChannelMemory(0, audioData[0], numberOfFrames);
+ m_renderBus.setChannelMemory(1, audioData[1], numberOfFrames);
+
+ m_fifo->consume(&m_renderBus, numberOfFrames);
+}
+
+void AudioDestinationChromium::provideInput(AudioBus* bus, size_t framesToProcess)
+{
+ AudioBus* sourceBus = 0;
+ if (m_inputFifo->framesInFifo() >= framesToProcess) {
+ m_inputFifo->consume(&m_inputBus, framesToProcess);
+ sourceBus = &m_inputBus;
+ }
+
+ m_callback.render(sourceBus, bus, framesToProcess);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
Copied: trunk/Source/WebCore/platform/audio/chromium/AudioDestinationChromium.h (from rev 139650, trunk/Source/WebKit/chromium/src/AudioDestinationChromium.h) (0 => 139652)
--- trunk/Source/WebCore/platform/audio/chromium/AudioDestinationChromium.h (rev 0)
+++ trunk/Source/WebCore/platform/audio/chromium/AudioDestinationChromium.h 2013-01-14 21:21:37 UTC (rev 139652)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AudioDestinationChromium_h
+#define AudioDestinationChromium_h
+
+#include "AudioBus.h"
+#include "AudioDestination.h"
+#include "AudioIOCallback.h"
+#include "AudioSourceProvider.h"
+#include <public/WebAudioDevice.h>
+#include <public/WebVector.h>
+
+namespace WebCore {
+
+class AudioFIFO;
+class AudioPullFIFO;
+
+// An AudioDestination using Chromium's audio system
+
+class AudioDestinationChromium : public AudioDestination, public WebKit::WebAudioDevice::RenderCallback, public AudioSourceProvider {
+public:
+ AudioDestinationChromium(AudioIOCallback&, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate);
+ virtual ~AudioDestinationChromium();
+
+ virtual void start();
+ virtual void stop();
+ bool isPlaying() { return m_isPlaying; }
+
+ float sampleRate() const { return m_sampleRate; }
+
+ // WebKit::WebAudioDevice::RenderCallback
+ virtual void render(const WebKit::WebVector<float*>& sourceData, const WebKit::WebVector<float*>& audioData, size_t numberOfFrames);
+
+ // WebCore::AudioSourceProvider
+ virtual void provideInput(AudioBus*, size_t framesToProcess);
+
+private:
+ AudioIOCallback& m_callback;
+ unsigned m_numberOfOutputChannels;
+ AudioBus m_inputBus;
+ AudioBus m_renderBus;
+ float m_sampleRate;
+ bool m_isPlaying;
+ OwnPtr<WebKit::WebAudioDevice> m_audioDevice;
+ size_t m_callbackBufferSize;
+
+ OwnPtr<AudioFIFO> m_inputFifo;
+ OwnPtr<AudioPullFIFO> m_fifo;
+};
+
+} // namespace WebCore
+
+#endif // AudioDestinationChromium_h
Modified: trunk/Source/WebKit/chromium/ChangeLog (139651 => 139652)
--- trunk/Source/WebKit/chromium/ChangeLog 2013-01-14 21:16:15 UTC (rev 139651)
+++ trunk/Source/WebKit/chromium/ChangeLog 2013-01-14 21:21:37 UTC (rev 139652)
@@ -1,3 +1,17 @@
+2013-01-14 Mark Pilgrim <pilg...@chromium.org>
+
+ [Chromium] Move AudioDestinationChromium into WebCore
+ https://bugs.webkit.org/show_bug.cgi?id=106803
+
+ Reviewed by Adam Barth.
+
+ This doesn't really belong in WebKit/chromium/src since it defines
+ things directly in the WebCore namespace.
+
+ * WebKit.gyp:
+ * src/AudioDestinationChromium.cpp: Removed.
+ * src/AudioDestinationChromium.h: Removed.
+
2013-01-14 Stephen Chenney <schen...@chromium.org>
Re-enabling the SK_DISABLE_DASHING_OPTIMIZATION flag for Skia
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (139651 => 139652)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2013-01-14 21:16:15 UTC (rev 139651)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2013-01-14 21:21:37 UTC (rev 139652)
@@ -350,8 +350,6 @@
'src/AsyncFileSystemChromium.h',
'src/AsyncFileWriterChromium.cpp',
'src/AsyncFileWriterChromium.h',
- 'src/AudioDestinationChromium.cpp',
- 'src/AudioDestinationChromium.h',
'src/AutofillPopupMenuClient.cpp',
'src/AutofillPopupMenuClient.h',
'src/BackForwardListChromium.cpp',
Deleted: trunk/Source/WebKit/chromium/src/AudioDestinationChromium.cpp (139651 => 139652)
--- trunk/Source/WebKit/chromium/src/AudioDestinationChromium.cpp 2013-01-14 21:16:15 UTC (rev 139651)
+++ trunk/Source/WebKit/chromium/src/AudioDestinationChromium.cpp 2013-01-14 21:21:37 UTC (rev 139652)
@@ -1,160 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_AUDIO)
-#include "AudioDestinationChromium.h"
-#include "AudioFIFO.h"
-#include "AudioPullFIFO.h"
-#include <public/Platform.h>
-
-using namespace WebKit;
-
-namespace WebCore {
-
-// Buffer size at which the web audio engine will render.
-const unsigned renderBufferSize = 128;
-
-// Size of the FIFO
-const size_t fifoSize = 8192;
-
-// Factory method: Chromium-implementation
-PassOwnPtr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate)
-{
- return adoptPtr(new AudioDestinationChromium(callback, numberOfInputChannels, numberOfOutputChannels, sampleRate));
-}
-
-AudioDestinationChromium::AudioDestinationChromium(AudioIOCallback& callback, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate)
- : m_callback(callback)
- , m_numberOfOutputChannels(numberOfOutputChannels)
- , m_inputBus(numberOfInputChannels, renderBufferSize)
- , m_renderBus(numberOfOutputChannels, renderBufferSize, false)
- , m_sampleRate(sampleRate)
- , m_isPlaying(false)
-{
- // Use the optimal buffer size recommended by the audio backend.
- m_callbackBufferSize = WebKit::Platform::current()->audioHardwareBufferSize();
-
- // Quick exit if the requested size is too large.
- ASSERT(m_callbackBufferSize + renderBufferSize <= fifoSize);
- if (m_callbackBufferSize + renderBufferSize > fifoSize)
- return;
-
- // FIXME: switch to new API (with input channels) once chromium supports it.
- m_audioDevice = adoptPtr(WebKit::Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfOutputChannels, sampleRate, this));
- ASSERT(m_audioDevice);
-
- // Create a FIFO to handle the possibility of the callback size
- // not being a multiple of the render size. If the FIFO already
- // contains enough data, the data will be provided directly.
- // Otherwise, the FIFO will call the provider enough times to
- // satisfy the request for data.
- m_fifo = adoptPtr(new AudioPullFIFO(*this, numberOfOutputChannels, fifoSize, renderBufferSize));
-
- // Input buffering.
- m_inputFifo = adoptPtr(new AudioFIFO(numberOfInputChannels, fifoSize));
-
- // If the callback size does not match the render size, then we need to buffer some
- // extra silence for the input. Otherwise, we can over-consume the input FIFO.
- if (m_callbackBufferSize != renderBufferSize) {
- // FIXME: handle multi-channel input and don't hard-code to stereo.
- AudioBus silence(2, renderBufferSize);
- m_inputFifo->push(&silence);
- }
-}
-
-AudioDestinationChromium::~AudioDestinationChromium()
-{
- stop();
-}
-
-void AudioDestinationChromium::start()
-{
- if (!m_isPlaying && m_audioDevice) {
- m_audioDevice->start();
- m_isPlaying = true;
- }
-}
-
-void AudioDestinationChromium::stop()
-{
- if (m_isPlaying && m_audioDevice) {
- m_audioDevice->stop();
- m_isPlaying = false;
- }
-}
-
-float AudioDestination::hardwareSampleRate()
-{
- return static_cast<float>(WebKit::Platform::current()->audioHardwareSampleRate());
-}
-
-void AudioDestinationChromium::render(const WebVector<float*>& sourceData, const WebVector<float*>& audioData, size_t numberOfFrames)
-{
- bool isNumberOfChannelsGood = audioData.size() == m_numberOfOutputChannels;
- if (!isNumberOfChannelsGood) {
- ASSERT_NOT_REACHED();
- return;
- }
-
- bool isBufferSizeGood = numberOfFrames == m_callbackBufferSize;
- if (!isBufferSizeGood) {
- ASSERT_NOT_REACHED();
- return;
- }
-
- // Buffer optional live input.
- if (sourceData.size() >= 2) {
- // FIXME: handle multi-channel input and don't hard-code to stereo.
- AudioBus wrapperBus(2, numberOfFrames, false);
- wrapperBus.setChannelMemory(0, sourceData[0], numberOfFrames);
- wrapperBus.setChannelMemory(1, sourceData[1], numberOfFrames);
- m_inputFifo->push(&wrapperBus);
- }
-
- m_renderBus.setChannelMemory(0, audioData[0], numberOfFrames);
- m_renderBus.setChannelMemory(1, audioData[1], numberOfFrames);
-
- m_fifo->consume(&m_renderBus, numberOfFrames);
-}
-
-void AudioDestinationChromium::provideInput(AudioBus* bus, size_t framesToProcess)
-{
- AudioBus* sourceBus = 0;
- if (m_inputFifo->framesInFifo() >= framesToProcess) {
- m_inputFifo->consume(&m_inputBus, framesToProcess);
- sourceBus = &m_inputBus;
- }
-
- m_callback.render(sourceBus, bus, framesToProcess);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WEB_AUDIO)
Deleted: trunk/Source/WebKit/chromium/src/AudioDestinationChromium.h (139651 => 139652)
--- trunk/Source/WebKit/chromium/src/AudioDestinationChromium.h 2013-01-14 21:16:15 UTC (rev 139651)
+++ trunk/Source/WebKit/chromium/src/AudioDestinationChromium.h 2013-01-14 21:21:37 UTC (rev 139652)
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef AudioDestinationChromium_h
-#define AudioDestinationChromium_h
-
-#include "AudioBus.h"
-#include "AudioDestination.h"
-#include "AudioIOCallback.h"
-#include "AudioSourceProvider.h"
-#include <public/WebAudioDevice.h>
-#include <public/WebVector.h>
-
-namespace WebKit { class WebAudioDevice; }
-
-namespace WebCore {
-
-class AudioFIFO;
-class AudioPullFIFO;
-
-// An AudioDestination using Chromium's audio system
-
-class AudioDestinationChromium : public AudioDestination, public WebKit::WebAudioDevice::RenderCallback, public AudioSourceProvider {
-public:
- AudioDestinationChromium(AudioIOCallback&, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate);
- virtual ~AudioDestinationChromium();
-
- virtual void start();
- virtual void stop();
- bool isPlaying() { return m_isPlaying; }
-
- float sampleRate() const { return m_sampleRate; }
-
- // WebKit::WebAudioDevice::RenderCallback
- virtual void render(const WebKit::WebVector<float*>& sourceData, const WebKit::WebVector<float*>& audioData, size_t numberOfFrames);
-
- // WebCore::AudioSourceProvider
- virtual void provideInput(AudioBus*, size_t framesToProcess);
-
-private:
- AudioIOCallback& m_callback;
- unsigned m_numberOfOutputChannels;
- AudioBus m_inputBus;
- AudioBus m_renderBus;
- float m_sampleRate;
- bool m_isPlaying;
- OwnPtr<WebKit::WebAudioDevice> m_audioDevice;
- size_t m_callbackBufferSize;
-
- OwnPtr<AudioFIFO> m_inputFifo;
- OwnPtr<AudioPullFIFO> m_fifo;
-};
-
-} // namespace WebCore
-
-#endif // AudioDestinationChromium_h