https://bugs.webkit.org/show_bug.cgi?id=76506
Patch by Raymond Liu <raymond.liu@intel.com> on 2012-01-18
Reviewed by Kenneth Russell.
No new tests required.
* webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon):
(WebCore::AudioContext::uninitialize):
* webaudio/AudioContext.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105375
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2012-01-18 Raymond Liu <raymond.liu@intel.com>
+ Remove some unused code in AudioContext
+ https://bugs.webkit.org/show_bug.cgi?id=76506
+
+ Reviewed by Kenneth Russell.
+
+ No new tests required.
+
+ * webaudio/AudioContext.cpp:
+ (WebCore::AudioContext::constructCommon):
+ (WebCore::AudioContext::uninitialize):
+ * webaudio/AudioContext.h:
+
+2012-01-18 Raymond Liu <raymond.liu@intel.com>
+
Only create AudioBus with required number of channels for AudioNodeOutput
https://bugs.webkit.org/show_bug.cgi?id=76417
FFTFrame::initialize();
m_listener = AudioListener::create();
- m_temporaryMonoBus = adoptPtr(new AudioBus(1, AudioNode::ProcessingSizeInFrames));
- m_temporaryStereoBus = adoptPtr(new AudioBus(2, AudioNode::ProcessingSizeInFrames));
}
AudioContext::~AudioContext()
deleteMarkedNodes();
- // Because the AudioBuffers are garbage collected, we can't delete them here.
- // Instead, at least release the potentially large amount of allocated memory for the audio data.
- // Note that we do this *after* the context is uninitialized and stops processing audio.
- for (unsigned i = 0; i < m_allocatedBuffers.size(); ++i)
- m_allocatedBuffers[i]->releaseMemory();
- m_allocatedBuffers.clear();
-
m_isInitialized = false;
}
}
return m_document;
}
-void AudioContext::refBuffer(PassRefPtr<AudioBuffer> buffer)
-{
- m_allocatedBuffers.append(buffer);
-}
-
PassRefPtr<AudioBuffer> AudioContext::createBuffer(unsigned numberOfChannels, size_t numberOfFrames, float sampleRate, ExceptionCode& ec)
{
RefPtr<AudioBuffer> audioBuffer = AudioBuffer::create(numberOfChannels, numberOfFrames, sampleRate);
// Asynchronous audio file data decoding.
void decodeAudioData(ArrayBuffer*, PassRefPtr<AudioBufferCallback>, PassRefPtr<AudioBufferCallback>, ExceptionCode& ec);
- // Keep track of this buffer so we can release memory after the context is shut down...
- void refBuffer(PassRefPtr<AudioBuffer> buffer);
-
AudioListener* listener() { return m_listener.get(); }
// The AudioNode create methods are called on the main thread (from JavaScript).
PassRefPtr<AudioChannelSplitter> createChannelSplitter();
PassRefPtr<AudioChannelMerger> createChannelMerger();
- AudioBus* temporaryMonoBus() { return m_temporaryMonoBus.get(); }
- AudioBus* temporaryStereoBus() { return m_temporaryStereoBus.get(); }
-
// When a source node has no more processing to do (has finished playing), then it tells the context to dereference it.
void notifyNodeFinishedProcessing(AudioNode*);
RefPtr<AudioDestinationNode> m_destinationNode;
RefPtr<AudioListener> m_listener;
- // Only accessed in the main thread.
- Vector<RefPtr<AudioBuffer> > m_allocatedBuffers;
-
// Only accessed in the audio thread.
Vector<AudioNode*> m_finishedNodes;
void handleDirtyAudioNodeInputs();
void handleDirtyAudioNodeOutputs();
- OwnPtr<AudioBus> m_temporaryMonoBus;
- OwnPtr<AudioBus> m_temporaryStereoBus;
-
unsigned m_connectionCount;
// Graph locking.