| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (isInitialized()) { | 96 if (isInitialized()) { |
| 97 DCHECK(m_destination->isPlaying()); | 97 DCHECK(m_destination->isPlaying()); |
| 98 m_destination->stop(); | 98 m_destination->stop(); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 unsigned long DefaultAudioDestinationHandler::maxChannelCount() const { | 102 unsigned long DefaultAudioDestinationHandler::maxChannelCount() const { |
| 103 return AudioDestination::maxChannelCount(); | 103 return AudioDestination::maxChannelCount(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 size_t DefaultAudioDestinationHandler::callbackBufferSize() const { |
| 107 return m_destination->callbackBufferSize(); |
| 108 } |
| 109 |
| 106 void DefaultAudioDestinationHandler::setChannelCount( | 110 void DefaultAudioDestinationHandler::setChannelCount( |
| 107 unsigned long channelCount, | 111 unsigned long channelCount, |
| 108 ExceptionState& exceptionState) { | 112 ExceptionState& exceptionState) { |
| 109 // The channelCount for the input to this node controls the actual number of | 113 // The channelCount for the input to this node controls the actual number of |
| 110 // channels we send to the audio hardware. It can only be set depending on the | 114 // channels we send to the audio hardware. It can only be set depending on the |
| 111 // maximum number of channels supported by the hardware. | 115 // maximum number of channels supported by the hardware. |
| 112 | 116 |
| 113 DCHECK(isMainThread()); | 117 DCHECK(isMainThread()); |
| 114 | 118 |
| 115 if (!maxChannelCount() || channelCount > maxChannelCount()) { | 119 if (!maxChannelCount() || channelCount > maxChannelCount()) { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 140 : AudioDestinationNode(context) { | 144 : AudioDestinationNode(context) { |
| 141 setHandler(DefaultAudioDestinationHandler::create(*this)); | 145 setHandler(DefaultAudioDestinationHandler::create(*this)); |
| 142 } | 146 } |
| 143 | 147 |
| 144 DefaultAudioDestinationNode* DefaultAudioDestinationNode::create( | 148 DefaultAudioDestinationNode* DefaultAudioDestinationNode::create( |
| 145 BaseAudioContext* context) { | 149 BaseAudioContext* context) { |
| 146 return new DefaultAudioDestinationNode(*context); | 150 return new DefaultAudioDestinationNode(*context); |
| 147 } | 151 } |
| 148 | 152 |
| 149 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |