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

Unified Diff: Source/modules/webaudio/PannerNode.cpp

Issue 393363002: Move handle of HRTFDatabaseLoader to AudioListener. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move all HRTF loader functionality to AudioListener. Created 6 years, 5 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
« no previous file with comments | « Source/modules/webaudio/PannerNode.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/PannerNode.cpp
diff --git a/Source/modules/webaudio/PannerNode.cpp b/Source/modules/webaudio/PannerNode.cpp
index 143f01da832dba1aaf95ad133b87c8ec9db32b31..e72c33665091a81a4b5e9565eaa00492a40bcc7a 100644
--- a/Source/modules/webaudio/PannerNode.cpp
+++ b/Source/modules/webaudio/PannerNode.cpp
@@ -63,7 +63,7 @@ PannerNode::PannerNode(AudioContext* context, float sampleRate)
{
// Load the HRTF database asynchronously so we don't block the Javascript thread while creating the HRTF database.
// The HRTF panner will return zeroes until the database is loaded.
- m_hrtfDatabaseLoader = HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(context->sampleRate());
+ listener()->createAndLoadHRTFDatabaseLoader(context->sampleRate());
ScriptWrappable::init(this);
addInput();
@@ -123,9 +123,9 @@ void PannerNode::process(size_t framesToProcess)
if (tryLocker.locked() && tryListenerLocker.locked()) {
// HRTFDatabase should be loaded before proceeding for offline audio context when the panning model is HRTF.
- if (m_panningModel == Panner::PanningModelHRTF && !m_hrtfDatabaseLoader->isLoaded()) {
+ if (m_panningModel == Panner::PanningModelHRTF && !listener()->isHRTFDatabaseLoaded()) {
if (context()->isOfflineContext()) {
- m_hrtfDatabaseLoader->waitForLoaderThreadCompletion();
+ listener()->waitForHRTFDatabaseLoaderThreadCompletion();
} else {
destination->zero();
return;
@@ -160,7 +160,7 @@ void PannerNode::initialize()
if (isInitialized())
return;
- m_panner = Panner::create(m_panningModel, sampleRate(), m_hrtfDatabaseLoader.get());
+ m_panner = Panner::create(m_panningModel, sampleRate(), listener()->hrtfDatabaseLoader());
listener()->addPanner(this);
AudioNode::initialize();
@@ -211,7 +211,7 @@ bool PannerNode::setPanningModel(unsigned model)
if (!m_panner.get() || model != m_panningModel) {
// This synchronizes with process().
MutexLocker processLocker(m_processLock);
- OwnPtr<Panner> newPanner = Panner::create(model, sampleRate(), m_hrtfDatabaseLoader.get());
+ OwnPtr<Panner> newPanner = Panner::create(model, sampleRate(), listener()->hrtfDatabaseLoader());
m_panner = newPanner.release();
m_panningModel = model;
}
« no previous file with comments | « Source/modules/webaudio/PannerNode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698