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 |
49 void AudioDSPKernelProcessor::initialize() | 53 void AudioDSPKernelProcessor::initialize() |
50 { | 54 { |
51 if (isInitialized()) | 55 if (isInitialized()) |
52 return; | 56 return; |
53 | 57 |
54 MutexLocker locker(m_processLock); | 58 MutexLocker locker(m_processLock); |
55 ASSERT(!m_kernels.size()); | 59 ASSERT(!m_kernels.size()); |
56 | 60 |
57 // Create processing kernels, one per channel. | 61 // Create processing kernels, one per channel. |
58 for (unsigned i = 0; i < numberOfChannels(); ++i) | 62 for (unsigned i = 0; i < numberOfChannels(); ++i) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; | 152 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; |
149 } | 153 } |
150 // Since we don't want to block the Audio Device thread, we return a large v
alue | 154 // 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. | 155 // instead of trying to acquire the lock. |
152 return std::numeric_limits<double>::infinity(); | 156 return std::numeric_limits<double>::infinity(); |
153 } | 157 } |
154 | 158 |
155 } // namespace blink | 159 } // namespace blink |
156 | 160 |
157 #endif // ENABLE(WEB_AUDIO) | 161 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |