Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp |
| diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp |
| index 4408762461231e8b8b3d4746942cb44c50e72558..82c4394750f02b873170d8ffc446b3d388e78bab 100644 |
| --- a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp |
| +++ b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp |
| @@ -38,6 +38,9 @@ ChannelSplitterHandler::ChannelSplitterHandler(AudioNode& node, |
| float sampleRate, |
| unsigned numberOfOutputs) |
| : AudioHandler(NodeTypeChannelSplitter, node, sampleRate) { |
| + // These properties are fixed and cannot be changed by the user. |
| + m_channelCount = numberOfOutputs; |
| + setInternalChannelCountMode(Explicit); |
| addInput(); |
| // Create a fixed number of outputs (able to handle the maximum number of |
| @@ -79,6 +82,34 @@ void ChannelSplitterHandler::process(size_t framesToProcess) { |
| } |
| } |
| +void ChannelSplitterHandler::setChannelCount(unsigned long channelCount, |
| + ExceptionState& exceptionState) { |
| + DCHECK(isMainThread()); |
| + BaseAudioContext::AutoLocker locker(context()); |
| + |
| + // channelCount must be 1. |
|
Raymond Toy
2016/10/10 17:06:48
Wrong!
|
| + if (channelCount != numberOfOutputs()) { |
| + exceptionState.throwDOMException( |
| + InvalidStateError, |
| + "ChannelSplitter: channelCount cannot be changed from " + |
| + String::number(numberOfOutputs())); |
| + } |
| +} |
| + |
| +void ChannelSplitterHandler::setChannelCountMode( |
| + const String& mode, |
| + ExceptionState& exceptionState) { |
| + DCHECK(isMainThread()); |
| + BaseAudioContext::AutoLocker locker(context()); |
| + |
| + // channcelCountMode must be 'explicit'. |
| + if (mode != "explicit") { |
| + exceptionState.throwDOMException( |
| + InvalidStateError, |
| + "ChannelSplitter: channelCountMode cannot be changed from 'explicit'"); |
| + } |
| +} |
| + |
| // ---------------------------------------------------------------- |
| ChannelSplitterNode::ChannelSplitterNode(BaseAudioContext& context, |