| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #if ENABLE(WEB_AUDIO) | 33 #if ENABLE(WEB_AUDIO) |
| 34 | 34 |
| 35 #include "platform/audio/AudioDSPKernelProcessor.h" | 35 #include "platform/audio/AudioDSPKernelProcessor.h" |
| 36 | 36 |
| 37 #include "platform/audio/AudioDSPKernel.h" | 37 #include "platform/audio/AudioDSPKernel.h" |
| 38 #include "wtf/MainThread.h" | 38 #include "wtf/MainThread.h" |
| 39 | 39 |
| 40 namespace WebCore { | 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 void AudioDSPKernelProcessor::initialize() | 49 void AudioDSPKernelProcessor::initialize() |
| 50 { | 50 { |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 MutexTryLocker tryLocker(m_processLock); | 145 MutexTryLocker tryLocker(m_processLock); |
| 146 if (tryLocker.locked()) { | 146 if (tryLocker.locked()) { |
| 147 // It is expected that all the kernels have the same latencyTime. | 147 // It is expected that all the kernels have the same latencyTime. |
| 148 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; | 148 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; |
| 149 } | 149 } |
| 150 // 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 |
| 151 // instead of trying to acquire the lock. | 151 // instead of trying to acquire the lock. |
| 152 return std::numeric_limits<double>::infinity(); | 152 return std::numeric_limits<double>::infinity(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace WebCore | 155 } // namespace blink |
| 156 | 156 |
| 157 #endif // ENABLE(WEB_AUDIO) | 157 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |