| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 // setNumberOfChannels() may later be called if the object is not yet in an "ini
tialized" state. | 42 // setNumberOfChannels() may later be called if the object is not yet in an "ini
tialized" state. |
| 43 AudioDSPKernelProcessor::AudioDSPKernelProcessor(float sampleRate, unsigned numb
erOfChannels) | 43 AudioDSPKernelProcessor::AudioDSPKernelProcessor(float sampleRate, unsigned numb
erOfChannels) |
| 44 : AudioProcessor(sampleRate, numberOfChannels) | 44 : AudioProcessor(sampleRate, numberOfChannels) |
| 45 , m_hasJustReset(true) | 45 , m_hasJustReset(true) |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 AudioDSPKernelProcessor::~AudioDSPKernelProcessor() | |
| 50 { | |
| 51 } | |
| 52 | |
| 53 void AudioDSPKernelProcessor::initialize() | 49 void AudioDSPKernelProcessor::initialize() |
| 54 { | 50 { |
| 55 if (isInitialized()) | 51 if (isInitialized()) |
| 56 return; | 52 return; |
| 57 | 53 |
| 58 MutexLocker locker(m_processLock); | 54 MutexLocker locker(m_processLock); |
| 59 ASSERT(!m_kernels.size()); | 55 ASSERT(!m_kernels.size()); |
| 60 | 56 |
| 61 // Create processing kernels, one per channel. | 57 // Create processing kernels, one per channel. |
| 62 for (unsigned i = 0; i < numberOfChannels(); ++i) | 58 for (unsigned i = 0; i < numberOfChannels(); ++i) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; | 148 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; |
| 153 } | 149 } |
| 154 // Since we don't want to block the Audio Device thread, we return a large v
alue | 150 // Since we don't want to block the Audio Device thread, we return a large v
alue |
| 155 // instead of trying to acquire the lock. | 151 // instead of trying to acquire the lock. |
| 156 return std::numeric_limits<double>::infinity(); | 152 return std::numeric_limits<double>::infinity(); |
| 157 } | 153 } |
| 158 | 154 |
| 159 } // namespace blink | 155 } // namespace blink |
| 160 | 156 |
| 161 #endif // ENABLE(WEB_AUDIO) | 157 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |