Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(461)

Unified Diff: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp

Issue 1978063002: [DO NOT SUBMIT] AudioWorklet FS2a: AudioWorkletThread on OfflineAudioContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FS2-audiorendersink-audioworkletthread
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
index 2363ae5cbf11d7ea48d39286fd470b0e4ee00031..302556ac6376c282f4efde8cc5ae5d43c84aa436 100644
--- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioDestinationNode.cpp
@@ -41,12 +41,14 @@ const size_t OfflineAudioDestinationHandler::renderQuantumSize = 128;
OfflineAudioDestinationHandler::OfflineAudioDestinationHandler(AudioNode& node, AudioBuffer* renderTarget)
: AudioDestinationHandler(node, renderTarget->sampleRate())
, m_renderTarget(renderTarget)
- , m_renderThread(adoptPtr(Platform::current()->createThread("offline audio renderer")))
, m_framesProcessed(0)
, m_framesToProcess(0)
, m_isRenderingStarted(false)
, m_shouldSuspend(false)
{
+ m_renderThread = AudioWorkletThread::create(*this);
+ // m_renderThread->initialize(frame, std::move(startUpData));
+
m_renderBus = AudioBus::create(renderTarget->numberOfChannels(), renderQuantumSize);
m_framesToProcess = m_renderTarget->length();
}
@@ -103,14 +105,14 @@ void OfflineAudioDestinationHandler::startRendering()
// Rendering was not started. Starting now.
if (!m_isRenderingStarted) {
m_isRenderingStarted = true;
- m_renderThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE,
+ m_renderThread->audioRenderThread().postTask(BLINK_FROM_HERE,
threadSafeBind(&OfflineAudioDestinationHandler::startOfflineRendering, this));
return;
}
// Rendering is already started, which implicitly means we resume the
// rendering by calling |doOfflineRendering| on the render thread.
- m_renderThread->getWebTaskRunner()->postTask(BLINK_FROM_HERE,
+ m_renderThread->audioRenderThread().postTask(BLINK_FROM_HERE,
threadSafeBind(&OfflineAudioDestinationHandler::doOfflineRendering, this));
}
@@ -120,7 +122,7 @@ void OfflineAudioDestinationHandler::stopRendering()
ASSERT_NOT_REACHED();
}
-WebThread* OfflineAudioDestinationHandler::offlineRenderThread()
+AudioWorkletThread* OfflineAudioDestinationHandler::offlineRenderThread()
{
ASSERT(m_renderThread);

Powered by Google App Engine
This is Rietveld 408576698