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

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

Issue 1214463003: Split "Online" and "Offline" AudioContext processing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Bring to ToT Created 5 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') | Source/modules/webaudio/ScriptProcessorNode.h » ('j') | 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 6504526cb60f67632f53553ec54cb4a2989f1bf8..57c26e6320b1c810d6aaadca03bc2762963b4de9 100644
--- a/Source/modules/webaudio/PannerNode.cpp
+++ b/Source/modules/webaudio/PannerNode.cpp
@@ -30,8 +30,8 @@
#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
+#include "modules/webaudio/AbstractAudioContext.h"
#include "modules/webaudio/AudioBufferSourceNode.h"
-#include "modules/webaudio/AudioContext.h"
#include "modules/webaudio/AudioNodeInput.h"
#include "modules/webaudio/AudioNodeOutput.h"
#include "platform/audio/HRTFPanner.h"
@@ -107,14 +107,15 @@ void PannerHandler::process(size_t framesToProcess)
MutexTryLocker tryListenerLocker(listener()->listenerLock());
if (tryLocker.locked() && tryListenerLocker.locked()) {
- // HRTFDatabase should be loaded before proceeding for offline audio context when the panning model is HRTF.
+ // HRTFDatabase should be loaded before proceeding when the panning model is HRTF.
if (m_panningModel == Panner::PanningModelHRTF && !listener()->isHRTFDatabaseLoaded()) {
- if (context()->isOfflineContext()) {
- listener()->waitForHRTFDatabaseLoaderThreadCompletion();
- } else {
+ if (context()->hasRealtimeConstraint()) {
+ // Some AbstractAudioContexts cannot block on the HRTFDatabase loader.
destination->zero();
return;
}
+
+ listener()->waitForHRTFDatabaseLoaderThreadCompletion();
}
// Apply the panning effect.
@@ -529,7 +530,7 @@ void PannerHandler::markPannerAsDirty(unsigned dirty)
void PannerHandler::setChannelCount(unsigned long channelCount, ExceptionState& exceptionState)
{
ASSERT(isMainThread());
- AudioContext::AutoLocker locker(context());
+ AbstractAudioContext::AutoLocker locker(context());
// A PannerNode only supports 1 or 2 channels
if (channelCount > 0 && channelCount <= 2) {
@@ -554,7 +555,7 @@ void PannerHandler::setChannelCount(unsigned long channelCount, ExceptionState&
void PannerHandler::setChannelCountMode(const String& mode, ExceptionState& exceptionState)
{
ASSERT(isMainThread());
- AudioContext::AutoLocker locker(context());
+ AbstractAudioContext::AutoLocker locker(context());
ChannelCountMode oldMode = m_channelCountMode;
@@ -579,13 +580,13 @@ void PannerHandler::setChannelCountMode(const String& mode, ExceptionState& exce
// ----------------------------------------------------------------
-PannerNode::PannerNode(AudioContext& context, float sampelRate)
+PannerNode::PannerNode(AbstractAudioContext& context, float sampelRate)
: AudioNode(context)
{
setHandler(PannerHandler::create(*this, sampelRate));
}
-PannerNode* PannerNode::create(AudioContext& context, float sampleRate)
+PannerNode* PannerNode::create(AbstractAudioContext& context, float sampleRate)
{
return new PannerNode(context, sampleRate);
}
« no previous file with comments | « Source/modules/webaudio/PannerNode.h ('k') | Source/modules/webaudio/ScriptProcessorNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698