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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 for (size_t i = 0; i < m_stages.size(); ++i) | 192 for (size_t i = 0; i < m_stages.size(); ++i) |
193 m_stages[i]->process(source, framesToProcess); | 193 m_stages[i]->process(source, framesToProcess); |
194 | 194 |
195 // Finally read from accumulation buffer | 195 // Finally read from accumulation buffer |
196 m_accumulationBuffer.readAndClear(destination, framesToProcess); | 196 m_accumulationBuffer.readAndClear(destination, framesToProcess); |
197 | 197 |
198 // Now that we've buffered more input, post another task to the background | 198 // Now that we've buffered more input, post another task to the background |
199 // thread. | 199 // thread. |
200 if (m_backgroundThread) | 200 if (m_backgroundThread) |
201 m_backgroundThread->getWebTaskRunner()->postTask( | 201 m_backgroundThread->getWebTaskRunner()->postTask( |
202 BLINK_FROM_HERE, crossThreadBind(&ReverbConvolver::processInBackground, | 202 BLINK_FROM_HERE, |
203 crossThreadUnretained(this))); | 203 crossThreadBind(&ReverbConvolver::processInBackground, |
| 204 crossThreadUnretained(this))); |
204 } | 205 } |
205 | 206 |
206 void ReverbConvolver::reset() { | 207 void ReverbConvolver::reset() { |
207 for (size_t i = 0; i < m_stages.size(); ++i) | 208 for (size_t i = 0; i < m_stages.size(); ++i) |
208 m_stages[i]->reset(); | 209 m_stages[i]->reset(); |
209 | 210 |
210 for (size_t i = 0; i < m_backgroundStages.size(); ++i) | 211 for (size_t i = 0; i < m_backgroundStages.size(); ++i) |
211 m_backgroundStages[i]->reset(); | 212 m_backgroundStages[i]->reset(); |
212 | 213 |
213 m_accumulationBuffer.reset(); | 214 m_accumulationBuffer.reset(); |
214 m_inputBuffer.reset(); | 215 m_inputBuffer.reset(); |
215 } | 216 } |
216 | 217 |
217 size_t ReverbConvolver::latencyFrames() const { | 218 size_t ReverbConvolver::latencyFrames() const { |
218 return 0; | 219 return 0; |
219 } | 220 } |
220 | 221 |
221 } // namespace blink | 222 } // namespace blink |
OLD | NEW |