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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp

Issue 2168653003: Pass through audio if HRTF database isn't loaded yet. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 } 127 }
128 128
129 // The audio thread can't block on this lock, so we call tryLock() instead. 129 // The audio thread can't block on this lock, so we call tryLock() instead.
130 MutexTryLocker tryLocker(m_processLock); 130 MutexTryLocker tryLocker(m_processLock);
131 MutexTryLocker tryListenerLocker(listener()->listenerLock()); 131 MutexTryLocker tryListenerLocker(listener()->listenerLock());
132 132
133 if (tryLocker.locked() && tryListenerLocker.locked()) { 133 if (tryLocker.locked() && tryListenerLocker.locked()) {
134 // HRTFDatabase should be loaded before proceeding when the panning mode l is HRTF. 134 // HRTFDatabase should be loaded before proceeding when the panning mode l is HRTF.
135 if (m_panningModel == Panner::PanningModelHRTF && !listener()->isHRTFDat abaseLoaded()) { 135 if (m_panningModel == Panner::PanningModelHRTF && !listener()->isHRTFDat abaseLoaded()) {
136 if (context()->hasRealtimeConstraint()) { 136 if (context()->hasRealtimeConstraint()) {
137 // Some BaseAudioContexts cannot block on the HRTFDatabase loade r. 137 // Realtime AudioContext's cannot block on the HRTFDatabase
138 destination->zero(); 138 // loader. Instead, copy the input to the output so we can at
139 // least hear something until the database is ready.
140 destination->copyFrom(*source, m_channelInterpretation);
139 return; 141 return;
140 } 142 }
141 143
142 listener()->waitForHRTFDatabaseLoaderThreadCompletion(); 144 listener()->waitForHRTFDatabaseLoaderThreadCompletion();
143 } 145 }
144 146
145 if (hasSampleAccurateValues() || listener()->hasSampleAccurateValues()) { 147 if (hasSampleAccurateValues() || listener()->hasSampleAccurateValues()) {
146 // It's tempting to skip sample-accurate processing if isAzimuthElev ationDirty() and 148 // It's tempting to skip sample-accurate processing if isAzimuthElev ationDirty() and
147 // isDistanceConeGain() both return false. But in general we can't because something 149 // isDistanceConeGain() both return false. But in general we can't because something
148 // may scheduled to start in the middle of the rendering quantum. O n the other hand, 150 // may scheduled to start in the middle of the rendering quantum. O n the other hand,
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 visitor->trace(m_positionZ); 782 visitor->trace(m_positionZ);
781 783
782 visitor->trace(m_orientationX); 784 visitor->trace(m_orientationX);
783 visitor->trace(m_orientationY); 785 visitor->trace(m_orientationY);
784 visitor->trace(m_orientationZ); 786 visitor->trace(m_orientationZ);
785 787
786 AudioNode::trace(visitor); 788 AudioNode::trace(visitor);
787 } 789 }
788 790
789 } // namespace blink 791 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698