OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |