Changeset 117404 in webkit
- Timestamp:
- May 16, 2012 11:53:07 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r117403 r117404 1 2012-05-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r117372. 4 http://trac.webkit.org/changeset/117372 5 https://bugs.webkit.org/show_bug.cgi?id=86710 6 7 "triggerring crashes" (Requested by morrita on #webkit). 8 9 * webaudio/audioparam-connect-audioratesignal.html: 10 * webaudio/audioparam-summingjunction-expected.txt: Removed. 11 * webaudio/audioparam-summingjunction.html: Removed. 12 1 13 2012-05-16 Zan Dobersek <zandobersek@gmail.com> 2 14 -
trunk/LayoutTests/webaudio/audioparam-connect-audioratesignal.html
r117372 r117404 88 88 // Create a gain node controlling the gain of constantSource and make the connections. 89 89 var gainNode = context.createGainNode(); 90 91 // Intrinsic baseline gain of zero.92 gainNode.gain.value = 0;93 94 90 constantSource.connect(gainNode); 95 91 gainNode.connect(context.destination); -
trunk/Source/WebCore/ChangeLog
r117394 r117404 1 2012-05-16 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r117372. 4 http://trac.webkit.org/changeset/117372 5 https://bugs.webkit.org/show_bug.cgi?id=86710 6 7 "triggerring crashes" (Requested by morrita on #webkit). 8 9 * Modules/webaudio/AudioParam.cpp: 10 (WebCore::AudioParam::calculateSampleAccurateValues): 11 (WebCore::AudioParam::calculateAudioRateSignalValues): 12 (WebCore::AudioParam::connect): 13 (WebCore::AudioParam::disconnect): 14 * Modules/webaudio/AudioParam.h: 15 (WebCore::AudioParam::context): 16 (WebCore::AudioParam::hasSampleAccurateValues): 17 (WebCore::AudioParam::AudioParam): 18 (AudioParam): 19 1 20 2012-05-16 Hayato Ito <hayato@chromium.org> 2 21 -
trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp
r117372 r117404 102 102 return; 103 103 104 if ( numberOfRenderingConnections())104 if (m_audioRateSignal) 105 105 calculateAudioRateSignalValues(values, numberOfValues); 106 106 else … … 110 110 void AudioParam::calculateAudioRateSignalValues(float* values, unsigned numberOfValues) 111 111 { 112 bool isGood = numberOfRenderingConnections() && numberOfValues; 113 ASSERT(isGood); 114 if (!isGood) 112 // FIXME: support fan-in (multiple audio connections to this parameter with unity-gain summing). 113 // https://bugs.webkit.org/show_bug.cgi?id=83610 114 ASSERT(m_audioRateSignal); 115 116 AudioBus* bus = m_audioRateSignal->pull(0, numberOfValues); 117 bool isBusGood = bus && bus->numberOfChannels() && bus->length() >= numberOfValues; 118 ASSERT(isBusGood); 119 if (!isBusGood) 115 120 return; 116 121 117 // The calculated result will be the "intrinsic" value summed with all audio-rate connections. 118 119 if (m_timeline.hasValues()) { 120 // Calculate regular timeline values, if we have any. 121 calculateTimelineValues(values, numberOfValues); 122 if (bus->numberOfChannels() == 1) { 123 // The normal case is to deal with a mono audio-rate signal. 124 memcpy(values, bus->channel(0)->data(), sizeof(float) * numberOfValues); 122 125 } else { 123 // Otherwise set values array to our constant value. 124 float value = m_value; // Cache in local. 125 126 // FIXME: can be optimized if we create a new VectorMath function. 127 for (unsigned i = 0; i < numberOfValues; ++i) 128 values[i] = value; 126 // Do a standard mixdown to one channel if necessary. 127 AudioBus wrapperBus(1, numberOfValues, false); 128 wrapperBus.setChannelMemory(0, values, numberOfValues); 129 wrapperBus.copyFrom(*bus); // Mixdown. 129 130 } 130 131 // Now sum all of the audio-rate connections together (unity-gain summing junction). 132 // Note that connections would normally be mono, but we mix down to mono if necessary. 133 AudioBus summingBus(1, numberOfValues, false); 134 summingBus.setChannelMemory(0, values, numberOfValues); 135 136 for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) { 137 AudioNodeOutput* output = renderingOutput(i); 138 ASSERT(output); 139 140 // Render audio from this output. 141 AudioBus* connectionBus = output->pull(0, numberOfValues); 142 143 // Sum, with unity-gain. 144 summingBus.sumFrom(*connectionBus); 145 } 131 m_value = values[0]; // Update to first value. 146 132 } 147 133 … … 159 145 } 160 146 161 void AudioParam::connect(AudioNodeOutput* output)147 void AudioParam::connect(AudioNodeOutput* audioRateSignal) 162 148 { 163 149 ASSERT(context()->isGraphOwner()); 164 165 ASSERT(output); 166 if (!output) 150 ASSERT(audioRateSignal); 151 if (!audioRateSignal) 167 152 return; 168 153 169 if (m_outputs.contains(output)) 154 if (m_audioRateSignal && m_audioRateSignal != audioRateSignal) { 155 // Because we don't currently support fan-in we must explicitly disconnect from an old output. 156 m_audioRateSignal->removeParam(this); 157 } 158 159 audioRateSignal->addParam(this); 160 m_audioRateSignal = audioRateSignal; 161 } 162 163 void AudioParam::disconnect(AudioNodeOutput* audioRateSignal) 164 { 165 ASSERT(context()->isGraphOwner()); 166 ASSERT(audioRateSignal); 167 if (!audioRateSignal) 170 168 return; 171 169 172 output->addParam(this); 173 m_outputs.add(output); 174 changedOutputs(); 175 } 176 177 void AudioParam::disconnect(AudioNodeOutput* output) 178 { 179 ASSERT(context()->isGraphOwner()); 180 181 ASSERT(output); 182 if (!output) 183 return; 184 185 if (m_outputs.contains(output)) { 186 m_outputs.remove(output); 187 changedOutputs(); 188 output->removeParam(this); 189 } 170 // FIXME: support fan-in (multiple audio connections to this parameter with unity-gain summing). 171 // https://bugs.webkit.org/show_bug.cgi?id=83610 172 if (m_audioRateSignal == audioRateSignal) 173 m_audioRateSignal = 0; 190 174 } 191 175 -
trunk/Source/WebCore/Modules/webaudio/AudioParam.h
r117372 r117404 32 32 #include "AudioContext.h" 33 33 #include "AudioParamTimeline.h" 34 #include "AudioSummingJunction.h"35 34 #include "PlatformString.h" 36 35 #include <sys/types.h> … … 43 42 class AudioNodeOutput; 44 43 45 class AudioParam : public AudioSummingJunction, publicRefCounted<AudioParam> {44 class AudioParam : public RefCounted<AudioParam> { 46 45 public: 47 46 static const double DefaultSmoothingConstant; … … 53 52 } 54 53 55 // AudioSummingJunction 56 virtual bool canUpdateState() OVERRIDE { return true; } 57 virtual void didUpdate() OVERRIDE { } 54 AudioContext* context() { return m_context.get(); } 58 55 59 56 float value(); … … 88 85 void cancelScheduledValues(float startTime) { m_timeline.cancelScheduledValues(startTime); } 89 86 90 bool hasSampleAccurateValues() { return m_timeline.hasValues() || numberOfRenderingConnections(); }87 bool hasSampleAccurateValues() { return m_timeline.hasValues() || m_audioRateSignal; } 91 88 92 89 // Calculates numberOfValues parameter values starting at the context's current time. … … 100 97 protected: 101 98 AudioParam(AudioContext* context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0) 102 : AudioSummingJunction(context)99 : m_context(context) 103 100 , m_name(name) 104 101 , m_value(defaultValue) … … 109 106 , m_smoothedValue(defaultValue) 110 107 , m_smoothingConstant(DefaultSmoothingConstant) 108 , m_audioRateSignal(0) 111 109 { 112 110 } … … 116 114 void calculateTimelineValues(float* values, unsigned numberOfValues); 117 115 116 RefPtr<AudioContext> m_context; 118 117 String m_name; 119 118 double m_value; … … 128 127 129 128 AudioParamTimeline m_timeline; 129 130 // An audio-rate signal directly providing parameter values. 131 // FIXME: support fan-in (multiple audio connections to this parameter with unity-gain summing). 132 // https://bugs.webkit.org/show_bug.cgi?id=83610 133 AudioNodeOutput* m_audioRateSignal; 130 134 }; 131 135
Note: See TracChangeset
for help on using the changeset viewer.