| 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 * 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 27 matching lines...) Expand all Loading... |
| 38 #include "public/platform/Platform.h" | 38 #include "public/platform/Platform.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 ScriptProcessorHandler::ScriptProcessorHandler( | 42 ScriptProcessorHandler::ScriptProcessorHandler( |
| 43 AudioNode& node, | 43 AudioNode& node, |
| 44 float sample_rate, | 44 float sample_rate, |
| 45 size_t buffer_size, | 45 size_t buffer_size, |
| 46 unsigned number_of_input_channels, | 46 unsigned number_of_input_channels, |
| 47 unsigned number_of_output_channels) | 47 unsigned number_of_output_channels) |
| 48 : AudioHandler(kNodeTypeJavaScript, node, sample_rate), | 48 : AudioHandler(kNodeTypeScriptProcessor, node, sample_rate), |
| 49 double_buffer_index_(0), | 49 double_buffer_index_(0), |
| 50 buffer_size_(buffer_size), | 50 buffer_size_(buffer_size), |
| 51 buffer_read_write_index_(0), | 51 buffer_read_write_index_(0), |
| 52 number_of_input_channels_(number_of_input_channels), | 52 number_of_input_channels_(number_of_input_channels), |
| 53 number_of_output_channels_(number_of_output_channels), | 53 number_of_output_channels_(number_of_output_channels), |
| 54 internal_input_bus_(AudioBus::Create(number_of_input_channels, | 54 internal_input_bus_(AudioBus::Create(number_of_input_channels, |
| 55 AudioUtilities::kRenderQuantumFrames, | 55 AudioUtilities::kRenderQuantumFrames, |
| 56 false)) { | 56 false)) { |
| 57 // Regardless of the allowed buffer sizes, we still need to process at the | 57 // Regardless of the allowed buffer sizes, we still need to process at the |
| 58 // granularity of the AudioNode. | 58 // granularity of the AudioNode. |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 492 |
| 493 // If |onaudioprocess| event handler is defined, the node should not be | 493 // If |onaudioprocess| event handler is defined, the node should not be |
| 494 // GCed even if it is out of scope. | 494 // GCed even if it is out of scope. |
| 495 if (HasEventListeners(EventTypeNames::audioprocess)) | 495 if (HasEventListeners(EventTypeNames::audioprocess)) |
| 496 return true; | 496 return true; |
| 497 | 497 |
| 498 return false; | 498 return false; |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace blink | 501 } // namespace blink |
| OLD | NEW |