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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 MutexLocker locker(m_processLock); | 61 MutexLocker locker(m_processLock); |
62 m_kernels.clear(); | 62 m_kernels.clear(); |
63 | 63 |
64 m_initialized = false; | 64 m_initialized = false; |
65 } | 65 } |
66 | 66 |
67 void AudioDSPKernelProcessor::process(const AudioBus* source, | 67 void AudioDSPKernelProcessor::process(const AudioBus* source, |
68 AudioBus* destination, | 68 AudioBus* destination, |
69 size_t framesToProcess) { | 69 size_t framesToProcess) { |
70 DCHECK(source); | 70 ASSERT(source && destination); |
71 DCHECK(destination); | |
72 if (!source || !destination) | 71 if (!source || !destination) |
73 return; | 72 return; |
74 | 73 |
75 if (!isInitialized()) { | 74 if (!isInitialized()) { |
76 destination->zero(); | 75 destination->zero(); |
77 return; | 76 return; |
78 } | 77 } |
79 | 78 |
80 MutexTryLocker tryLocker(m_processLock); | 79 MutexTryLocker tryLocker(m_processLock); |
81 if (tryLocker.locked()) { | 80 if (tryLocker.locked()) { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 if (tryLocker.locked()) { | 153 if (tryLocker.locked()) { |
155 // It is expected that all the kernels have the same latencyTime. | 154 // It is expected that all the kernels have the same latencyTime. |
156 return !m_kernels.isEmpty() ? m_kernels.front()->latencyTime() : 0; | 155 return !m_kernels.isEmpty() ? m_kernels.front()->latencyTime() : 0; |
157 } | 156 } |
158 // Since we don't want to block the Audio Device thread, we return a large | 157 // Since we don't want to block the Audio Device thread, we return a large |
159 // value instead of trying to acquire the lock. | 158 // value instead of trying to acquire the lock. |
160 return std::numeric_limits<double>::infinity(); | 159 return std::numeric_limits<double>::infinity(); |
161 } | 160 } |
162 | 161 |
163 } // namespace blink | 162 } // namespace blink |
OLD | NEW |