| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // reference to it is kept for later use in that class. | 129 // reference to it is kept for later use in that class. |
| 130 RefPtr<AudioBus> bufferBus = | 130 RefPtr<AudioBus> bufferBus = |
| 131 AudioBus::create(numberOfChannels, bufferLength, false); | 131 AudioBus::create(numberOfChannels, bufferLength, false); |
| 132 for (unsigned i = 0; i < numberOfChannels; ++i) | 132 for (unsigned i = 0; i < numberOfChannels; ++i) |
| 133 bufferBus->setChannelMemory(i, buffer->getChannelData(i)->data(), | 133 bufferBus->setChannelMemory(i, buffer->getChannelData(i)->data(), |
| 134 bufferLength); | 134 bufferLength); |
| 135 | 135 |
| 136 bufferBus->setSampleRate(buffer->sampleRate()); | 136 bufferBus->setSampleRate(buffer->sampleRate()); |
| 137 | 137 |
| 138 // Create the reverb with the given impulse response. | 138 // Create the reverb with the given impulse response. |
| 139 std::unique_ptr<Reverb> reverb = wrapUnique( | 139 std::unique_ptr<Reverb> reverb = wrapUnique(new Reverb( |
| 140 new Reverb(bufferBus.get(), ProcessingSizeInFrames, MaxFFTSize, 2, | 140 bufferBus.get(), AudioUtilities::kRenderQuantumFrames, MaxFFTSize, 2, |
| 141 context() && context()->hasRealtimeConstraint(), m_normalize)); | 141 context() && context()->hasRealtimeConstraint(), m_normalize)); |
| 142 | 142 |
| 143 { | 143 { |
| 144 // Synchronize with process(). | 144 // Synchronize with process(). |
| 145 MutexLocker locker(m_processLock); | 145 MutexLocker locker(m_processLock); |
| 146 m_reverb = std::move(reverb); | 146 m_reverb = std::move(reverb); |
| 147 m_buffer = buffer; | 147 m_buffer = buffer; |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 AudioBuffer* ConvolverHandler::buffer() { | 151 AudioBuffer* ConvolverHandler::buffer() { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 227 |
| 228 bool ConvolverNode::normalize() const { | 228 bool ConvolverNode::normalize() const { |
| 229 return convolverHandler().normalize(); | 229 return convolverHandler().normalize(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void ConvolverNode::setNormalize(bool normalize) { | 232 void ConvolverNode::setNormalize(bool normalize) { |
| 233 convolverHandler().setNormalize(normalize); | 233 convolverHandler().setNormalize(normalize); |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace blink | 236 } // namespace blink |
| OLD | NEW |