OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 { | 69 { |
70 // Conform the input bus into the internal mix bus, which represents | 70 // Conform the input bus into the internal mix bus, which represents |
71 // MediaStreamDestination's channel count. | 71 // MediaStreamDestination's channel count. |
72 m_mixBus->copyFrom(*input(0).bus()); | 72 m_mixBus->copyFrom(*input(0).bus()); |
73 | 73 |
74 m_source->consumeAudio(m_mixBus.get(), numberOfFrames); | 74 m_source->consumeAudio(m_mixBus.get(), numberOfFrames); |
75 } | 75 } |
76 | 76 |
77 void MediaStreamAudioDestinationHandler::setChannelCount(unsigned long channelCo
unt, ExceptionState& exceptionState) | 77 void MediaStreamAudioDestinationHandler::setChannelCount(unsigned long channelCo
unt, ExceptionState& exceptionState) |
78 { | 78 { |
79 ASSERT(isMainThread()); | 79 DCHECK(isMainThread()); |
80 | 80 |
81 // Currently the maximum channel count supported for this node is 8, | 81 // Currently the maximum channel count supported for this node is 8, |
82 // which is constrained by m_source (WebAudioCapturereSource). Although | 82 // which is constrained by m_source (WebAudioCapturereSource). Although |
83 // it has its own safety check for the excessive channels, throwing an | 83 // it has its own safety check for the excessive channels, throwing an |
84 // exception here is useful to developers. | 84 // exception here is useful to developers. |
85 if (channelCount > maxChannelCount()) { | 85 if (channelCount > maxChannelCount()) { |
86 exceptionState.throwDOMException( | 86 exceptionState.throwDOMException( |
87 IndexSizeError, | 87 IndexSizeError, |
88 ExceptionMessages::indexOutsideRange<unsigned>("channel count", | 88 ExceptionMessages::indexOutsideRange<unsigned>("channel count", |
89 channelCount, | 89 channelCount, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 return new MediaStreamAudioDestinationNode(context, numberOfChannels); | 134 return new MediaStreamAudioDestinationNode(context, numberOfChannels); |
135 } | 135 } |
136 | 136 |
137 MediaStream* MediaStreamAudioDestinationNode::stream() const | 137 MediaStream* MediaStreamAudioDestinationNode::stream() const |
138 { | 138 { |
139 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); | 139 return static_cast<MediaStreamAudioDestinationHandler&>(handler()).stream(); |
140 } | 140 } |
141 | 141 |
142 } // namespace blink | 142 } // namespace blink |
143 | 143 |
OLD | NEW |