[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
crogers at google.com
crogers at google.com
Wed Dec 22 13:52:22 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit beb5f5e9ecbfc23384bed449ae55812d498788af
Author: crogers at google.com <crogers at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 28 17:55:18 2010 +0000
2010-09-28 Chris Rogers <crogers at google.com>
Reviewed by Kenneth Russell.
Add AudioDestinationNode files
https://bugs.webkit.org/show_bug.cgi?id=45009
No new tests since audio API is not yet implemented.
* webaudio/AudioDestinationNode.cpp: Added.
(WebCore::AudioDestinationNode::AudioDestinationNode):
(WebCore::AudioDestinationNode::~AudioDestinationNode):
(WebCore::AudioDestinationNode::initialize):
(WebCore::AudioDestinationNode::uninitialize):
(WebCore::AudioDestinationNode::provideInput):
* webaudio/AudioDestinationNode.h: Added.
(WebCore::AudioDestinationNode::create):
(WebCore::AudioDestinationNode::process):
(WebCore::AudioDestinationNode::reset):
(WebCore::AudioDestinationNode::currentTime):
(WebCore::AudioDestinationNode::sampleRate):
(WebCore::AudioDestinationNode::numberOfChannels):
* webaudio/AudioDestinationNode.idl: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68540 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1a55f42..b2603b9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,30 @@
Reviewed by Kenneth Russell.
+ Add AudioDestinationNode files
+ https://bugs.webkit.org/show_bug.cgi?id=45009
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioDestinationNode.cpp: Added.
+ (WebCore::AudioDestinationNode::AudioDestinationNode):
+ (WebCore::AudioDestinationNode::~AudioDestinationNode):
+ (WebCore::AudioDestinationNode::initialize):
+ (WebCore::AudioDestinationNode::uninitialize):
+ (WebCore::AudioDestinationNode::provideInput):
+ * webaudio/AudioDestinationNode.h: Added.
+ (WebCore::AudioDestinationNode::create):
+ (WebCore::AudioDestinationNode::process):
+ (WebCore::AudioDestinationNode::reset):
+ (WebCore::AudioDestinationNode::currentTime):
+ (WebCore::AudioDestinationNode::sampleRate):
+ (WebCore::AudioDestinationNode::numberOfChannels):
+ * webaudio/AudioDestinationNode.idl: Added.
+
+2010-09-28 Chris Rogers <crogers at google.com>
+
+ Reviewed by Kenneth Russell.
+
audio engine: audio output classes
https://bugs.webkit.org/show_bug.cgi?id=34716
diff --git a/WebCore/webaudio/AudioDestinationNode.cpp b/WebCore/webaudio/AudioDestinationNode.cpp
new file mode 100644
index 0000000..82f5145
--- /dev/null
+++ b/WebCore/webaudio/AudioDestinationNode.cpp
@@ -0,0 +1,115 @@
+/*
+ * 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 "AudioDestinationNode.h"
+
+#include "AudioBus.h"
+#include "AudioContext.h"
+#include "AudioNodeInput.h"
+#include "AudioNodeOutput.h"
+#include <wtf/Threading.h>
+
+namespace WebCore {
+
+AudioDestinationNode::AudioDestinationNode(AudioContext* context)
+ : AudioNode(context, AudioDestination::hardwareSampleRate())
+ , m_currentTime(0.0)
+{
+ addInput(adoptPtr(new AudioNodeInput(this)));
+
+ setType(NodeTypeDestination);
+
+ initialize();
+}
+
+AudioDestinationNode::~AudioDestinationNode()
+{
+ uninitialize();
+}
+
+void AudioDestinationNode::initialize()
+{
+ if (isInitialized())
+ return;
+
+ double hardwareSampleRate = AudioDestination::hardwareSampleRate();
+#ifndef NDEBUG
+ fprintf(stderr, ">>>> hardwareSampleRate = %f\n", hardwareSampleRate);
+#endif
+
+ m_destination = AudioDestination::create(*this, hardwareSampleRate);
+ m_destination->start();
+
+ m_isInitialized = true;
+}
+
+void AudioDestinationNode::uninitialize()
+{
+ if (!isInitialized())
+ return;
+
+ m_destination->stop();
+
+ m_isInitialized = false;
+}
+
+// The audio hardware calls us back here to gets its input stream.
+void AudioDestinationNode::provideInput(AudioBus* destinationBus, size_t numberOfFrames)
+{
+ context()->setAudioThread(currentThread());
+
+ if (!context()->isRunnable()) {
+ destinationBus->zero();
+ return;
+ }
+
+ // This will cause the node(s) connected to us to process, which in turn will pull on their input(s),
+ // all the way backwards through the rendering graph.
+ AudioBus* renderedBus = input(0)->pull(destinationBus, numberOfFrames);
+
+ if (!renderedBus)
+ destinationBus->zero();
+ else if (renderedBus != destinationBus) {
+ // in-place processing was not possible - so copy
+ destinationBus->copyFrom(*renderedBus);
+ }
+
+ // Let the context take care of any business at the end of each render quantum.
+ context()->handlePostRenderTasks();
+
+ // Advance current time.
+ m_currentTime += numberOfFrames / sampleRate();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_AUDIO)
diff --git a/WebCore/webaudio/AudioDestinationNode.h b/WebCore/webaudio/AudioDestinationNode.h
new file mode 100644
index 0000000..b130518
--- /dev/null
+++ b/WebCore/webaudio/AudioDestinationNode.h
@@ -0,0 +1,76 @@
+/*
+ * 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 AudioDestinationNode_h
+#define AudioDestinationNode_h
+
+#include "AudioDestination.h"
+#include "AudioNode.h"
+#include "AudioSourceProvider.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class AudioBus;
+class AudioContext;
+
+class AudioDestinationNode : public AudioNode, public AudioSourceProvider {
+public:
+ static PassRefPtr<AudioDestinationNode> create(AudioContext* context)
+ {
+ return adoptRef(new AudioDestinationNode(context));
+ }
+
+ virtual ~AudioDestinationNode();
+
+ // AudioNode
+ virtual void process(size_t) { }; // we're pulled by hardware so this is never called
+ virtual void reset() { m_currentTime = 0.0; };
+ virtual void initialize();
+ virtual void uninitialize();
+
+ // The audio hardware calls here periodically to gets its input stream.
+ virtual void provideInput(AudioBus*, size_t numberOfFrames);
+
+ double currentTime() { return m_currentTime; }
+
+ double sampleRate() const { return m_destination->sampleRate(); }
+
+ unsigned numberOfChannels() const { return 2; } // FIXME: update when multi-channel (more than stereo) is supported
+
+private:
+ AudioDestinationNode(AudioContext*);
+
+ OwnPtr<AudioDestination> m_destination;
+ double m_currentTime;
+};
+
+} // namespace WebCore
+
+#endif // AudioDestinationNode_h
diff --git a/WebCore/webaudio/AudioDestinationNode.idl b/WebCore/webaudio/AudioDestinationNode.idl
new file mode 100644
index 0000000..1d2a235
--- /dev/null
+++ b/WebCore/webaudio/AudioDestinationNode.idl
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+module audio {
+ interface [
+ Conditional=WEB_AUDIO,
+ GenerateToJS
+ ] AudioDestinationNode : AudioNode {
+ readonly attribute long numberOfChannels;
+ };
+}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list