diff options
Diffstat (limited to 'WebCore/webaudio/AudioContext.h')
-rw-r--r-- | WebCore/webaudio/AudioContext.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/WebCore/webaudio/AudioContext.h b/WebCore/webaudio/AudioContext.h index 9fe1347..b79cd14 100644 --- a/WebCore/webaudio/AudioContext.h +++ b/WebCore/webaudio/AudioContext.h @@ -29,6 +29,7 @@ #include "AudioBus.h" #include "AudioDestinationNode.h" #include "HRTFDatabaseLoader.h" +#include <wtf/HashSet.h> #include <wtf/OwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> @@ -107,6 +108,9 @@ public: // When a source node has no more processing to do (has finished playing), then it tells the context to dereference it. void notifyNodeFinishedProcessing(AudioNode*); + // Called at the start of each render quantum. + void handlePreRenderTasks(); + // Called at the end of each render quantum. void handlePostRenderTasks(); @@ -132,7 +136,7 @@ public: void setAudioThread(ThreadIdentifier thread) { m_audioThread = thread; } // FIXME: check either not initialized or the same ThreadIdentifier audioThread() const { return m_audioThread; } - bool isAudioThread(); + bool isAudioThread() const; // Returns true only after the audio thread has been started and then shutdown. bool isAudioThreadFinished() { return m_isAudioThreadFinished; } @@ -147,7 +151,7 @@ public: void unlock(); // Returns true if this thread owns the context's lock. - bool isGraphOwner(); + bool isGraphOwner() const; class AutoLocker { public: @@ -173,6 +177,10 @@ public: // In the audio thread at the start of each render cycle, we'll call handleDeferredFinishDerefs(). void handleDeferredFinishDerefs(); + + // Only accessed when the graph lock is held. + void markAudioNodeInputDirty(AudioNodeInput*); + void markAudioNodeOutputDirty(AudioNodeOutput*); private: AudioContext(Document*); @@ -214,6 +222,12 @@ private: 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; + void handleDirtyAudioNodeInputs(); + void handleDirtyAudioNodeOutputs(); OwnPtr<AudioBus> m_temporaryMonoBus; OwnPtr<AudioBus> m_temporaryStereoBus; |