| 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..33826829ad18a90ef7c1ce07722d48195a0b81ea 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 cannot be changed from the number of outputs.
|
| + 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,
|
|
|