[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
crogers at google.com
crogers at google.com
Wed Dec 22 17:55:29 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 4f3387263437fc5b6589fc7639acbb7c558fa5b7
Author: crogers at google.com <crogers at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Dec 2 19:48:39 2010 +0000
2010-12-02 Chris Rogers <crogers at google.com>
Reviewed by Kenneth Russell.
AudioContext needs createBuffer() method from ArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=50343
No new tests since audio API is not yet implemented.
* webaudio/AudioContext.cpp:
(WebCore::AudioContext::createBuffer):
* webaudio/AudioContext.h:
* webaudio/AudioContext.idl:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9b91edd..499de2b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-02 Chris Rogers <crogers at google.com>
+
+ Reviewed by Kenneth Russell.
+
+ AudioContext needs createBuffer() method from ArrayBuffer
+ https://bugs.webkit.org/show_bug.cgi?id=50343
+
+ No new tests since audio API is not yet implemented.
+
+ * webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::createBuffer):
+ * webaudio/AudioContext.h:
+ * webaudio/AudioContext.idl:
+
2010-12-02 Noel Gordon <noel.gordon at gmail.com>
Reviewed by David Levin.
diff --git a/WebCore/webaudio/AudioContext.cpp b/WebCore/webaudio/AudioContext.cpp
index 30198e8..a452775 100644
--- a/WebCore/webaudio/AudioContext.cpp
+++ b/WebCore/webaudio/AudioContext.cpp
@@ -28,6 +28,7 @@
#include "AudioContext.h"
+#include "ArrayBuffer.h"
#include "AudioBuffer.h"
#include "AudioBufferSourceNode.h"
#include "AudioChannelMerger.h"
@@ -37,7 +38,6 @@
#include "AudioNodeInput.h"
#include "AudioNodeOutput.h"
#include "AudioPannerNode.h"
-#include "CachedAudio.h"
#include "ConvolverNode.h"
#include "DelayNode.h"
#include "Document.h"
@@ -60,22 +60,6 @@ const unsigned MaxNodesToDeletePerQuantum = 10;
namespace WebCore {
-PassRefPtr<CachedAudio> AudioContext::createAudioRequest(const String &url, bool mixToMono)
-{
- lazyInitialize();
-
- // Convert relative URL to absolute
- KURL completedURL = document()->completeURL(url);
- String completedURLString = completedURL.string();
-
- RefPtr<CachedAudio> cachedAudio = CachedAudio::create(completedURLString, this, document(), sampleRate(), mixToMono);
- CachedAudio* c = cachedAudio.get();
-
- m_cachedAudioReferences.append(c);
-
- return cachedAudio;
-}
-
PassRefPtr<AudioContext> AudioContext::create(Document* document)
{
return adoptRef(new AudioContext(document));
@@ -201,6 +185,15 @@ PassRefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, si
return AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate);
}
+PassRefPtr<AudioBuffer> AudioContext::createBuffer(ArrayBuffer* arrayBuffer, bool mixToMono)
+{
+ ASSERT(arrayBuffer);
+ if (!arrayBuffer)
+ return 0;
+
+ return AudioBuffer::createFromAudioFileData(arrayBuffer->data(), arrayBuffer->byteLength(), mixToMono, sampleRate());
+}
+
PassRefPtr<AudioBufferSourceNode> AudioContext::createBufferSource()
{
ASSERT(isMainThread());
diff --git a/WebCore/webaudio/AudioContext.h b/WebCore/webaudio/AudioContext.h
index b79cd14..ddd474c 100644
--- a/WebCore/webaudio/AudioContext.h
+++ b/WebCore/webaudio/AudioContext.h
@@ -40,6 +40,7 @@
namespace WebCore {
+class ArrayBuffer;
class AudioBuffer;
class AudioBufferSourceNode;
class AudioChannelMerger;
@@ -47,7 +48,6 @@ class AudioChannelSplitter;
class AudioGainNode;
class AudioPannerNode;
class AudioListener;
-class CachedAudio;
class DelayNode;
class Document;
class LowPass2FilterNode;
@@ -81,8 +81,7 @@ public:
double sampleRate() { return m_destinationNode->sampleRate(); }
PassRefPtr<AudioBuffer> createBuffer(unsigned numberOfChannels, size_t numberOfFrames, double sampleRate);
-
- PassRefPtr<CachedAudio> createAudioRequest(const String &url, bool mixToMono);
+ PassRefPtr<AudioBuffer> createBuffer(ArrayBuffer* arrayBuffer, bool mixToMono);
// Keep track of this buffer so we can release memory after the context is shut down...
void refBuffer(PassRefPtr<AudioBuffer> buffer);
@@ -221,8 +220,6 @@ private:
// Accumulate nodes which need to be deleted at the end of a render cycle (in realtime thread) here.
Vector<AudioNode*> m_nodesToDelete;
- Vector<RefPtr<CachedAudio> > m_cachedAudioReferences;
-
// Only accessed when the graph lock is held.
HashSet<AudioNodeInput*> m_dirtyAudioNodeInputs;
HashSet<AudioNodeOutput*> m_dirtyAudioNodeOutputs;
diff --git a/WebCore/webaudio/AudioContext.idl b/WebCore/webaudio/AudioContext.idl
index 35aea35..9f0f49c 100644
--- a/WebCore/webaudio/AudioContext.idl
+++ b/WebCore/webaudio/AudioContext.idl
@@ -42,6 +42,7 @@ module webaudio {
readonly attribute AudioListener listener;
AudioBuffer createBuffer(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate);
+ AudioBuffer createBuffer(in ArrayBuffer buffer, in boolean mixToMono);
// Source
AudioBufferSourceNode createBufferSource();
@@ -59,8 +60,5 @@ module webaudio {
// Channel splitting and merging
AudioChannelSplitter createChannelSplitter();
AudioChannelMerger createChannelMerger();
-
- // FIXME: Temporary - to be replaced with XHR.
- CachedAudio createAudioRequest(in DOMString url, in boolean mixToMono);
};
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list