| Index: Source/modules/webaudio/OfflineAudioDestinationNode.h
|
| diff --git a/Source/modules/webaudio/OfflineAudioDestinationNode.h b/Source/modules/webaudio/OfflineAudioDestinationNode.h
|
| index ca70d96aa1f5974f2f96f337040ff40479475c2d..e986e0d03ee3ebce612140bd0c82cc915c4b4cdc 100644
|
| --- a/Source/modules/webaudio/OfflineAudioDestinationNode.h
|
| +++ b/Source/modules/webaudio/OfflineAudioDestinationNode.h
|
| @@ -46,16 +46,30 @@ 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;
|
| +
|
| + // There is no support of the explicit stopping in OfflineAudioContext. This
|
| + // is just to match the class method signature.
|
| virtual void stopRendering() override;
|
|
|
| - virtual float sampleRate() const override { return m_renderTarget->sampleRate(); }
|
| + virtual float sampleRate() const override { return m_renderTarget->sampleRate(); }
|
| +
|
| + // Return the frame position by quantizing the time (in seconds) and
|
| + // rounding it down to the nearest render quantum boundary.
|
| + size_t quantizeTimeToRenderQuantum(double when) const;
|
| +
|
| + virtual WebThread* offlineRenderThread() 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 +83,11 @@ private:
|
|
|
| // Rendering thread.
|
| OwnPtr<WebThread> m_renderThread;
|
| - bool m_startedRendering;
|
| +
|
| + size_t m_framesProcessed;
|
| + size_t m_framesToProcess;
|
| +
|
| + bool m_isRenderingStarted;
|
| };
|
|
|
| class OfflineAudioDestinationNode final : public AudioDestinationNode {
|
|
|