Chromium Code Reviews| Index: Source/modules/webaudio/OfflineAudioDestinationNode.h |
| diff --git a/Source/modules/webaudio/OfflineAudioDestinationNode.h b/Source/modules/webaudio/OfflineAudioDestinationNode.h |
| index ca70d96aa1f5974f2f96f337040ff40479475c2d..1d91d73c564ccb58b7869444393407956e2dac54 100644 |
| --- a/Source/modules/webaudio/OfflineAudioDestinationNode.h |
| +++ b/Source/modules/webaudio/OfflineAudioDestinationNode.h |
| @@ -26,7 +26,9 @@ |
| #define OfflineAudioDestinationNode_h |
| #include "modules/webaudio/AudioBuffer.h" |
| +#include "modules/webaudio/AudioContext.h" |
| #include "modules/webaudio/AudioDestinationNode.h" |
| +#include "modules/webaudio/OfflineAudioContext.h" |
| #include "public/platform/WebThread.h" |
| #include "wtf/PassRefPtr.h" |
| #include "wtf/RefPtr.h" |
| @@ -35,6 +37,7 @@ namespace blink { |
| class AudioBus; |
| class AudioContext; |
| +class OfflineAudioContext; |
| class OfflineAudioDestinationHandler final : public AudioDestinationHandler { |
| public: |
| @@ -54,22 +57,30 @@ public: |
| private: |
| OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget); |
| - void offlineRender(); |
| - void offlineRenderInternal(); |
| - // For completion callback on main thread. |
| + // For start/suspend/resume rendering. |
| + void initiateOfflineRendering(); |
| + void renderNextQuantum(); |
| + void finishOfflineRendering(); |
| + |
| + // For callback on main thread. |
| + void notifySuspend(); |
| void notifyComplete(); |
| - // This AudioHandler renders into this AudioBuffer. |
| - // This Persistent doesn't make a reference cycle including the owner |
| - // OfflineAudioDestinationNode. |
| + // This AudioHandler renders into this AudioBuffer. This Persistent doesn't |
| + // make a reference cycle including the owner OfflineAudioDestinationNode. |
| Persistent<AudioBuffer> m_renderTarget; |
| + |
| // Temporary AudioBus for each render quantum. |
| RefPtr<AudioBus> m_renderBus; |
| // Rendering thread. |
| OwnPtr<WebThread> m_renderThread; |
| - bool m_startedRendering; |
|
Raymond Toy
2015/05/13 17:16:08
Changed the name? Why?
|
| + |
| + bool m_isRenderingStarted; |
| + |
| + unsigned m_framesProcessed; |
| + size_t m_framesToProcess; |
|
Raymond Toy
2015/05/13 17:16:08
Why is m_framesProcessed unsigned but m_framesToPr
hongchan
2015/05/13 17:30:53
I just followed the previous implementation. Shoul
Raymond Toy
2015/05/19 21:46:40
IIUC, m_framesProcessed counts up from 0 to the le
hongchan
2015/05/20 22:09:40
Done.
|
| }; |
| class OfflineAudioDestinationNode final : public AudioDestinationNode { |