| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 return; | 194 return; |
| 195 | 195 |
| 196 size_t frames_available_to_copy = | 196 size_t frames_available_to_copy = |
| 197 std::min(frames_to_process_, | 197 std::min(frames_to_process_, |
| 198 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames)); | 198 static_cast<size_t>(AudioUtilities::kRenderQuantumFrames)); |
| 199 | 199 |
| 200 for (unsigned channel_index = 0; channel_index < number_of_channels; | 200 for (unsigned channel_index = 0; channel_index < number_of_channels; |
| 201 ++channel_index) { | 201 ++channel_index) { |
| 202 const float* source = render_bus_->Channel(channel_index)->Data(); | 202 const float* source = render_bus_->Channel(channel_index)->Data(); |
| 203 float* destination = | 203 float* destination = |
| 204 render_target_->getChannelData(channel_index)->Data(); | 204 render_target_->getChannelData(channel_index).View()->Data(); |
| 205 memcpy(destination + frames_processed_, source, | 205 memcpy(destination + frames_processed_, source, |
| 206 sizeof(float) * frames_available_to_copy); | 206 sizeof(float) * frames_available_to_copy); |
| 207 } | 207 } |
| 208 | 208 |
| 209 frames_processed_ += frames_available_to_copy; | 209 frames_processed_ += frames_available_to_copy; |
| 210 | 210 |
| 211 DCHECK_GE(frames_to_process_, frames_available_to_copy); | 211 DCHECK_GE(frames_to_process_, frames_available_to_copy); |
| 212 frames_to_process_ -= frames_available_to_copy; | 212 frames_to_process_ -= frames_available_to_copy; |
| 213 } | 213 } |
| 214 | 214 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 SetHandler(OfflineAudioDestinationHandler::Create(*this, render_target)); | 341 SetHandler(OfflineAudioDestinationHandler::Create(*this, render_target)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 OfflineAudioDestinationNode* OfflineAudioDestinationNode::Create( | 344 OfflineAudioDestinationNode* OfflineAudioDestinationNode::Create( |
| 345 BaseAudioContext* context, | 345 BaseAudioContext* context, |
| 346 AudioBuffer* render_target) { | 346 AudioBuffer* render_target) { |
| 347 return new OfflineAudioDestinationNode(*context, render_target); | 347 return new OfflineAudioDestinationNode(*context, render_target); |
| 348 } | 348 } |
| 349 | 349 |
| 350 } // namespace blink | 350 } // namespace blink |
| OLD | NEW |