OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 if (m_shouldSuspend) | 193 if (m_shouldSuspend) |
194 return; | 194 return; |
195 | 195 |
196 size_t framesAvailableToCopy = | 196 size_t framesAvailableToCopy = |
197 std::min(m_framesToProcess, | 197 std::min(m_framesToProcess, |
198 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames)); | 198 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames)); |
199 | 199 |
200 for (unsigned channelIndex = 0; channelIndex < numberOfChannels; | 200 for (unsigned channelIndex = 0; channelIndex < numberOfChannels; |
201 ++channelIndex) { | 201 ++channelIndex) { |
202 const float* source = m_renderBus->channel(channelIndex)->data(); | 202 const float* source = m_renderBus->channel(channelIndex)->data(); |
203 float* destination = m_renderTarget->getChannelData(channelIndex)->data(); | 203 float* destination = |
| 204 m_renderTarget->getChannelData(channelIndex).view()->data(); |
204 memcpy(destination + m_framesProcessed, source, | 205 memcpy(destination + m_framesProcessed, source, |
205 sizeof(float) * framesAvailableToCopy); | 206 sizeof(float) * framesAvailableToCopy); |
206 } | 207 } |
207 | 208 |
208 m_framesProcessed += framesAvailableToCopy; | 209 m_framesProcessed += framesAvailableToCopy; |
209 | 210 |
210 DCHECK_GE(m_framesToProcess, framesAvailableToCopy); | 211 DCHECK_GE(m_framesToProcess, framesAvailableToCopy); |
211 m_framesToProcess -= framesAvailableToCopy; | 212 m_framesToProcess -= framesAvailableToCopy; |
212 } | 213 } |
213 | 214 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); | 340 setHandler(OfflineAudioDestinationHandler::create(*this, renderTarget)); |
340 } | 341 } |
341 | 342 |
342 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create( | 343 OfflineAudioDestinationNode* OfflineAudioDestinationNode::create( |
343 BaseAudioContext* context, | 344 BaseAudioContext* context, |
344 AudioBuffer* renderTarget) { | 345 AudioBuffer* renderTarget) { |
345 return new OfflineAudioDestinationNode(*context, renderTarget); | 346 return new OfflineAudioDestinationNode(*context, renderTarget); |
346 } | 347 } |
347 | 348 |
348 } // namespace blink | 349 } // namespace blink |
OLD | NEW |