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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 float AudioDestination::hardwareSampleRate() | 139 float AudioDestination::hardwareSampleRate() |
140 { | 140 { |
141 return static_cast<float>(Platform::current()->audioHardwareSampleRate()); | 141 return static_cast<float>(Platform::current()->audioHardwareSampleRate()); |
142 } | 142 } |
143 | 143 |
144 unsigned long AudioDestination::maxChannelCount() | 144 unsigned long AudioDestination::maxChannelCount() |
145 { | 145 { |
146 return static_cast<float>(Platform::current()->audioHardwareOutputChannels() ); | 146 return static_cast<float>(Platform::current()->audioHardwareOutputChannels() ); |
147 } | 147 } |
148 | 148 |
149 void AudioDestination::render(const WebVector<float*>& sourceData, const WebVect or<float*>& audioData, size_t numberOfFrames) | 149 void AudioDestination::render(const WebVector<float*>& sourceData, const WebVect or<float*>& audioData, size_t numberOfFrames, const WebAudioTimestamp& timestamp ) |
150 { | 150 { |
151 m_outputTimestamp = timestamp; | |
Raymond Toy
2016/06/14 16:42:40
Does this need to be protected by the mutex?
Mikhail
2016/06/17 09:36:57
it looks like here it is always accessed on the sa
| |
151 bool isNumberOfChannelsGood = audioData.size() == m_numberOfOutputChannels; | 152 bool isNumberOfChannelsGood = audioData.size() == m_numberOfOutputChannels; |
152 if (!isNumberOfChannelsGood) { | 153 if (!isNumberOfChannelsGood) { |
153 ASSERT_NOT_REACHED(); | 154 ASSERT_NOT_REACHED(); |
154 return; | 155 return; |
155 } | 156 } |
156 | 157 |
157 bool isBufferSizeGood = numberOfFrames == m_callbackBufferSize; | 158 bool isBufferSizeGood = numberOfFrames == m_callbackBufferSize; |
158 if (!isBufferSizeGood) { | 159 if (!isBufferSizeGood) { |
159 ASSERT_NOT_REACHED(); | 160 ASSERT_NOT_REACHED(); |
160 return; | 161 return; |
(...skipping 15 matching lines...) Expand all Loading... | |
176 } | 177 } |
177 | 178 |
178 void AudioDestination::provideInput(AudioBus* bus, size_t framesToProcess) | 179 void AudioDestination::provideInput(AudioBus* bus, size_t framesToProcess) |
179 { | 180 { |
180 AudioBus* sourceBus = nullptr; | 181 AudioBus* sourceBus = nullptr; |
181 if (m_inputFifo->framesInFifo() >= framesToProcess) { | 182 if (m_inputFifo->framesInFifo() >= framesToProcess) { |
182 m_inputFifo->consume(m_inputBus.get(), framesToProcess); | 183 m_inputFifo->consume(m_inputBus.get(), framesToProcess); |
183 sourceBus = m_inputBus.get(); | 184 sourceBus = m_inputBus.get(); |
184 } | 185 } |
185 | 186 |
186 m_callback.render(sourceBus, bus, framesToProcess); | 187 m_callback.render(sourceBus, bus, framesToProcess, m_outputTimestamp); |
187 } | 188 } |
188 | 189 |
189 } // namespace blink | 190 } // namespace blink |
190 | 191 |
OLD | NEW |