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..63d61ea0cfc51b8a12de7812a6e309f4d384d754 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: |
| @@ -46,16 +49,26 @@ public: |
| virtual void initialize() override; |
| virtual void uninitialize() override; |
| - // AudioDestinationHandler |
| + // Override the one from AudioContext. Create a rendering thread and |
| + // initiate rendering loop or resume rendering if already started and |
| + // suspended. |
| virtual void startRendering() override; |
| + |
| + // This should NOT be called within OfflineAudioContext. |
|
Raymond Toy
2015/05/28 16:37:37
Explain why.
hongchan
2015/06/09 20:50:00
Done.
|
| virtual void stopRendering() override; |
| - virtual float sampleRate() const override { return m_renderTarget->sampleRate(); } |
| + virtual float sampleRate() const override { return m_renderTarget->sampleRate(); } |
| + |
| + // Quantize time (in seconds) to the nearest block boundary in the past. |
| + virtual size_t quantizeTime(double when) const override; |
| private: |
| OfflineAudioDestinationHandler(AudioNode&, AudioBuffer* renderTarget); |
| - void offlineRender(); |
| - void offlineRenderInternal(); |
| + |
| + // For start/suspend/resume rendering in the destination node. |
| + void startOfflineRendering(); |
| + void runOfflineRendering(); |
| + void finishOfflineRendering(); |
| // For completion callback on main thread. |
| void notifyComplete(); |
| @@ -69,7 +82,9 @@ private: |
| // Rendering thread. |
| OwnPtr<WebThread> m_renderThread; |
| - bool m_startedRendering; |
|
Raymond Toy
2015/05/28 16:37:37
Don't need this anymore? Or was this renamed to m_
hongchan
2015/06/09 20:50:00
This is removed.
|
| + |
| + size_t m_framesProcessed; |
| + size_t m_framesToProcess; |
| }; |
| class OfflineAudioDestinationNode final : public AudioDestinationNode { |