void AudioNodeOutput::setNumberOfChannels(unsigned numberOfChannels)
{
    ASSERT(numberOfChannels <= MaxNumberOfChannels);
    ASSERT(context()->isGraphOwner());

    m_desiredNumberOfChannels = numberOfChannels;

    if (context()->isAudioThread()) {
        // If we're in the audio thread then we can take care of it right away (we should be at the very start or end of a rendering quantum).
        updateNumberOfChannels();
    } else {
        // Let the context take care of it in the audio thread in the pre and post render tasks.
        context()->markAudioNodeOutputDirty(this);
    }
}
Example #2
0
void AudioNodeOutput::setNumberOfChannels(unsigned numberOfChannels) {
  DCHECK_LE(numberOfChannels, BaseAudioContext::maxNumberOfChannels());
  ASSERT(deferredTaskHandler().isGraphOwner());

  m_desiredNumberOfChannels = numberOfChannels;

  if (deferredTaskHandler().isAudioThread()) {
    // If we're in the audio thread then we can take care of it right away (we
    // should be at the very start or end of a rendering quantum).
    updateNumberOfChannels();
  } else {
    DCHECK(!m_didCallDispose);
    // Let the context take care of it in the audio thread in the pre and post
    // render tasks.
    deferredTaskHandler().markAudioNodeOutputDirty(this);
  }
}
Example #3
0
void AudioNodeOutput::updateRenderingState() {
  updateNumberOfChannels();
  m_renderingFanOutCount = fanOutCount();
  m_renderingParamFanOutCount = paramFanOutCount();
}