| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, 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 for (unsigned i = 0; i < 2; ++i) { | 96 for (unsigned i = 0; i < 2; ++i) { |
| 97 AudioBuffer* inputBuffer = | 97 AudioBuffer* inputBuffer = |
| 98 m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, | 98 m_numberOfInputChannels ? AudioBuffer::create(m_numberOfInputChannels, |
| 99 bufferSize(), sampleRate) | 99 bufferSize(), sampleRate) |
| 100 : 0; | 100 : 0; |
| 101 AudioBuffer* outputBuffer = | 101 AudioBuffer* outputBuffer = |
| 102 m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, | 102 m_numberOfOutputChannels ? AudioBuffer::create(m_numberOfOutputChannels, |
| 103 bufferSize(), sampleRate) | 103 bufferSize(), sampleRate) |
| 104 : 0; | 104 : 0; |
| 105 | 105 |
| 106 m_inputBuffers.append(inputBuffer); | 106 m_inputBuffers.push_back(inputBuffer); |
| 107 m_outputBuffers.append(outputBuffer); | 107 m_outputBuffers.push_back(outputBuffer); |
| 108 } | 108 } |
| 109 | 109 |
| 110 AudioHandler::initialize(); | 110 AudioHandler::initialize(); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void ScriptProcessorHandler::process(size_t framesToProcess) { | 113 void ScriptProcessorHandler::process(size_t framesToProcess) { |
| 114 // Discussion about inputs and outputs: | 114 // Discussion about inputs and outputs: |
| 115 // As in other AudioNodes, ScriptProcessorNode uses an AudioBus for its input | 115 // As in other AudioNodes, ScriptProcessorNode uses an AudioBus for its input |
| 116 // and output (see inputBus and outputBus below). Additionally, there is a | 116 // and output (see inputBus and outputBus below). Additionally, there is a |
| 117 // double-buffering for input and output which is exposed directly to | 117 // double-buffering for input and output which is exposed directly to |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 480 |
| 481 // If |onaudioprocess| event handler is defined, the node should not be | 481 // If |onaudioprocess| event handler is defined, the node should not be |
| 482 // GCed even if it is out of scope. | 482 // GCed even if it is out of scope. |
| 483 if (hasEventListeners(EventTypeNames::audioprocess)) | 483 if (hasEventListeners(EventTypeNames::audioprocess)) |
| 484 return true; | 484 return true; |
| 485 | 485 |
| 486 return false; | 486 return false; |
| 487 } | 487 } |
| 488 | 488 |
| 489 } // namespace blink | 489 } // namespace blink |
| OLD | NEW |