Changeset 71200 in webkit


Ignore:
Timestamp:
Nov 2, 2010 6:55:55 PM (13 years ago)
Author:
crogers@google.com
Message:

2010-11-02 Chris Rogers <crogers@google.com>

Reviewed by Kenneth Russell.

Simple followup changes to files affected by AudioNodeInput thread safety
https://bugs.webkit.org/show_bug.cgi?id=48661

No new tests since audio API is not yet implemented.

  • webaudio/AudioBasicProcessorNode.cpp: (WebCore::AudioBasicProcessorNode::checkNumberOfChannelsForInput):
  • webaudio/AudioChannelSplitter.cpp: (WebCore::AudioChannelSplitter::process):
  • webaudio/AudioDestinationNode.cpp: (WebCore::AudioDestinationNode::initialize): (WebCore::AudioDestinationNode::uninitialize): (WebCore::AudioDestinationNode::provideInput):
  • webaudio/AudioGainNode.cpp: (WebCore::AudioGainNode::checkNumberOfChannelsForInput):
  • webaudio/AudioPannerNode.cpp: (WebCore::AudioPannerNode::notifyAudioSourcesConnectedToNode):
Location:
trunk/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r71198 r71200  
     12010-11-02  Chris Rogers  <crogers@google.com>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        Simple followup changes to files affected by AudioNodeInput thread safety
     6        https://bugs.webkit.org/show_bug.cgi?id=48661
     7
     8        No new tests since audio API is not yet implemented.
     9
     10        * webaudio/AudioBasicProcessorNode.cpp:
     11        (WebCore::AudioBasicProcessorNode::checkNumberOfChannelsForInput):
     12        * webaudio/AudioChannelSplitter.cpp:
     13        (WebCore::AudioChannelSplitter::process):
     14        * webaudio/AudioDestinationNode.cpp:
     15        (WebCore::AudioDestinationNode::initialize):
     16        (WebCore::AudioDestinationNode::uninitialize):
     17        (WebCore::AudioDestinationNode::provideInput):
     18        * webaudio/AudioGainNode.cpp:
     19        (WebCore::AudioGainNode::checkNumberOfChannelsForInput):
     20        * webaudio/AudioPannerNode.cpp:
     21        (WebCore::AudioPannerNode::notifyAudioSourcesConnectedToNode):
     22
    1232010-11-02  Chris Guillory  <chris.guillory@google.com>
    224
  • trunk/WebCore/webaudio/AudioBasicProcessorNode.cpp

    r69131 r71200  
    3030
    3131#include "AudioBus.h"
     32#include "AudioContext.h"
    3233#include "AudioNodeInput.h"
    3334#include "AudioNodeOutput.h"
     
    110111void AudioBasicProcessorNode::checkNumberOfChannelsForInput(AudioNodeInput* input)
    111112{
    112     ASSERT(isMainThread());
     113    ASSERT(context()->isAudioThread() && context()->isGraphOwner());
    113114   
    114115    ASSERT(input == this->input(0));
     
    129130    }
    130131   
    131     // This will propagate the channel count to any nodes connected further down the chain...
    132     output(0)->setNumberOfChannels(numberOfChannels);
     132    if (!isInitialized()) {
     133        // This will propagate the channel count to any nodes connected further down the chain...
     134        output(0)->setNumberOfChannels(numberOfChannels);
    133135
    134     // Re-initialize the processor with the new channel count.
    135     processor()->setNumberOfChannels(numberOfChannels);
    136     initialize();
     136        // Re-initialize the processor with the new channel count.
     137        processor()->setNumberOfChannels(numberOfChannels);
     138        initialize();
     139    }
    137140}
    138141
  • trunk/WebCore/webaudio/AudioChannelSplitter.cpp

    r71149 r71200  
    6969            // It would be nice to avoid the copy and simply pass along pointers, but this becomes extremely difficult with fanout and fanin.
    7070            destination->channel(0)->copyFrom(source->channel(i));
    71         } else if (output(i)->fanOutCount() > 0) {
     71        } else if (output(i)->renderingFanOutCount() > 0) {
    7272            // Only bother zeroing out the destination if it's connected to anything
    7373            destination->zero();
  • trunk/WebCore/webaudio/AudioDestinationNode.cpp

    r71149 r71200  
    6666    m_destination->start();
    6767   
    68     m_isInitialized = true;
     68    AudioNode::initialize();
    6969}
    7070
     
    7676    m_destination->stop();
    7777
    78     m_isInitialized = false;
     78    AudioNode::uninitialize();
    7979}
    8080
     
    8888        return;
    8989    }
     90
     91    // Let the context take care of any business at the start of each render quantum.
     92    context()->handlePreRenderTasks();
    9093
    9194    // This will cause the node(s) connected to us to process, which in turn will pull on their input(s),
  • trunk/WebCore/webaudio/AudioGainNode.cpp

    r71149 r71200  
    102102    }
    103103
    104     // This will propagate the channel count to any nodes connected further downstream in the graph.
    105     output(0)->setNumberOfChannels(numberOfChannels);
    106 
    107     initialize();
     104    if (!isInitialized()) {
     105        // This will propagate the channel count to any nodes connected further downstream in the graph.
     106        output(0)->setNumberOfChannels(numberOfChannels);
     107        initialize();
     108    }
    108109}
    109110
  • trunk/WebCore/webaudio/AudioPannerNode.cpp

    r71149 r71200  
    304304
    305305            // For each input, go through all of its connections, looking for AudioBufferSourceNodes.
    306             for (unsigned j = 0; j < input->numberOfConnections(); ++j) {
    307                 AudioNodeOutput* connectedOutput = input->output(j);
     306            for (unsigned j = 0; j < input->numberOfRenderingConnections(); ++j) {
     307                AudioNodeOutput* connectedOutput = input->renderingOutput(j);
    308308                AudioNode* connectedNode = connectedOutput->node();
    309309                notifyAudioSourcesConnectedToNode(connectedNode); // recurse
Note: See TracChangeset for help on using the changeset viewer.