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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 ASSERT(!isInitialized()); | 119 ASSERT(!isInitialized()); |
120 if (!isInitialized()) | 120 if (!isInitialized()) |
121 m_numberOfChannels = numberOfChannels; | 121 m_numberOfChannels = numberOfChannels; |
122 } | 122 } |
123 | 123 |
124 double AudioDSPKernelProcessor::tailTime() const { | 124 double AudioDSPKernelProcessor::tailTime() const { |
125 ASSERT(!isMainThread()); | 125 ASSERT(!isMainThread()); |
126 MutexTryLocker tryLocker(m_processLock); | 126 MutexTryLocker tryLocker(m_processLock); |
127 if (tryLocker.locked()) { | 127 if (tryLocker.locked()) { |
128 // It is expected that all the kernels have the same tailTime. | 128 // It is expected that all the kernels have the same tailTime. |
129 return !m_kernels.isEmpty() ? m_kernels.first()->tailTime() : 0; | 129 return !m_kernels.isEmpty() ? m_kernels.front()->tailTime() : 0; |
130 } | 130 } |
131 // Since we don't want to block the Audio Device thread, we return a large | 131 // Since we don't want to block the Audio Device thread, we return a large |
132 // value instead of trying to acquire the lock. | 132 // value instead of trying to acquire the lock. |
133 return std::numeric_limits<double>::infinity(); | 133 return std::numeric_limits<double>::infinity(); |
134 } | 134 } |
135 | 135 |
136 double AudioDSPKernelProcessor::latencyTime() const { | 136 double AudioDSPKernelProcessor::latencyTime() const { |
137 ASSERT(!isMainThread()); | 137 ASSERT(!isMainThread()); |
138 MutexTryLocker tryLocker(m_processLock); | 138 MutexTryLocker tryLocker(m_processLock); |
139 if (tryLocker.locked()) { | 139 if (tryLocker.locked()) { |
140 // It is expected that all the kernels have the same latencyTime. | 140 // It is expected that all the kernels have the same latencyTime. |
141 return !m_kernels.isEmpty() ? m_kernels.first()->latencyTime() : 0; | 141 return !m_kernels.isEmpty() ? m_kernels.front()->latencyTime() : 0; |
142 } | 142 } |
143 // Since we don't want to block the Audio Device thread, we return a large | 143 // Since we don't want to block the Audio Device thread, we return a large |
144 // value instead of trying to acquire the lock. | 144 // value instead of trying to acquire the lock. |
145 return std::numeric_limits<double>::infinity(); | 145 return std::numeric_limits<double>::infinity(); |
146 } | 146 } |
147 | 147 |
148 } // namespace blink | 148 } // namespace blink |
OLD | NEW |