Changeset 117404 in webkit


Ignore:
Timestamp:
May 16, 2012 11:53:07 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r117372.
http://trac.webkit.org/changeset/117372
https://bugs.webkit.org/show_bug.cgi?id=86710

"triggerring crashes" (Requested by morrita on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-05-16

Source/WebCore:

  • Modules/webaudio/AudioParam.cpp:

(WebCore::AudioParam::calculateSampleAccurateValues):
(WebCore::AudioParam::calculateAudioRateSignalValues):
(WebCore::AudioParam::connect):
(WebCore::AudioParam::disconnect):

  • Modules/webaudio/AudioParam.h:

(WebCore::AudioParam::context):
(WebCore::AudioParam::hasSampleAccurateValues):
(WebCore::AudioParam::AudioParam):
(AudioParam):

LayoutTests:

  • webaudio/audioparam-connect-audioratesignal.html:
  • webaudio/audioparam-summingjunction-expected.txt: Removed.
  • webaudio/audioparam-summingjunction.html: Removed.
Location:
trunk
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117403 r117404  
     12012-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
    1132012-05-16  Zan Dobersek  <zandobersek@gmail.com>
    214
  • trunk/LayoutTests/webaudio/audioparam-connect-audioratesignal.html

    r117372 r117404  
    8888    // Create a gain node controlling the gain of constantSource and make the connections.
    8989    var gainNode = context.createGainNode();
    90 
    91     // Intrinsic baseline gain of zero.
    92     gainNode.gain.value = 0;
    93 
    9490    constantSource.connect(gainNode);
    9591    gainNode.connect(context.destination);
  • trunk/Source/WebCore/ChangeLog

    r117394 r117404  
     12012-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
    1202012-05-16  Hayato Ito  <hayato@chromium.org>
    221
  • trunk/Source/WebCore/Modules/webaudio/AudioParam.cpp

    r117372 r117404  
    102102        return;
    103103
    104     if (numberOfRenderingConnections())
     104    if (m_audioRateSignal)
    105105        calculateAudioRateSignalValues(values, numberOfValues);
    106106    else
     
    110110void AudioParam::calculateAudioRateSignalValues(float* values, unsigned numberOfValues)
    111111{
    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)
    115120        return;
    116121
    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);
    122125    } 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.
    129130    }
    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.
    146132}
    147133
     
    159145}
    160146
    161 void AudioParam::connect(AudioNodeOutput* output)
     147void AudioParam::connect(AudioNodeOutput* audioRateSignal)
    162148{
    163149    ASSERT(context()->isGraphOwner());
    164 
    165     ASSERT(output);
    166     if (!output)
     150    ASSERT(audioRateSignal);
     151    if (!audioRateSignal)
    167152        return;
    168153
    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
     163void AudioParam::disconnect(AudioNodeOutput* audioRateSignal)
     164{
     165    ASSERT(context()->isGraphOwner());
     166    ASSERT(audioRateSignal);
     167    if (!audioRateSignal)
    170168        return;
    171169
    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;
    190174}
    191175
  • trunk/Source/WebCore/Modules/webaudio/AudioParam.h

    r117372 r117404  
    3232#include "AudioContext.h"
    3333#include "AudioParamTimeline.h"
    34 #include "AudioSummingJunction.h"
    3534#include "PlatformString.h"
    3635#include <sys/types.h>
     
    4342class AudioNodeOutput;
    4443
    45 class AudioParam : public AudioSummingJunction, public RefCounted<AudioParam> {
     44class AudioParam : public RefCounted<AudioParam> {
    4645public:
    4746    static const double DefaultSmoothingConstant;
     
    5352    }
    5453
    55     // AudioSummingJunction
    56     virtual bool canUpdateState() OVERRIDE { return true; }
    57     virtual void didUpdate() OVERRIDE { }
     54    AudioContext* context() { return m_context.get(); }
    5855
    5956    float value();
     
    8885    void cancelScheduledValues(float startTime) { m_timeline.cancelScheduledValues(startTime); }
    8986
    90     bool hasSampleAccurateValues() { return m_timeline.hasValues() || numberOfRenderingConnections(); }
     87    bool hasSampleAccurateValues() { return m_timeline.hasValues() || m_audioRateSignal; }
    9188   
    9289    // Calculates numberOfValues parameter values starting at the context's current time.
     
    10097protected:
    10198    AudioParam(AudioContext* context, const String& name, double defaultValue, double minValue, double maxValue, unsigned units = 0)
    102         : AudioSummingJunction(context)
     99        : m_context(context)
    103100        , m_name(name)
    104101        , m_value(defaultValue)
     
    109106        , m_smoothedValue(defaultValue)
    110107        , m_smoothingConstant(DefaultSmoothingConstant)
     108        , m_audioRateSignal(0)
    111109    {
    112110    }
     
    116114    void calculateTimelineValues(float* values, unsigned numberOfValues);
    117115
     116    RefPtr<AudioContext> m_context;
    118117    String m_name;
    119118    double m_value;
     
    128127   
    129128    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;
    130134};
    131135
Note: See TracChangeset for help on using the changeset viewer.