| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // is locked by the waitable event. | 300 // is locked by the waitable event. |
| 301 double playback_time = (Context()->CurrentSampleFrame() + buffer_size_) / | 301 double playback_time = (Context()->CurrentSampleFrame() + buffer_size_) / |
| 302 static_cast<double>(Context()->sampleRate()); | 302 static_cast<double>(Context()->sampleRate()); |
| 303 GetNode()->DispatchEvent(AudioProcessingEvent::Create( | 303 GetNode()->DispatchEvent(AudioProcessingEvent::Create( |
| 304 input_buffer, output_buffer, playback_time)); | 304 input_buffer, output_buffer, playback_time)); |
| 305 } | 305 } |
| 306 | 306 |
| 307 waitable_event->Signal(); | 307 waitable_event->Signal(); |
| 308 } | 308 } |
| 309 | 309 |
| 310 bool ScriptProcessorHandler::RequiresTailProcessing() const { |
| 311 // Always return true since the tail and latency are never zero. |
| 312 return true; |
| 313 } |
| 314 |
| 310 double ScriptProcessorHandler::TailTime() const { | 315 double ScriptProcessorHandler::TailTime() const { |
| 311 return std::numeric_limits<double>::infinity(); | 316 return std::numeric_limits<double>::infinity(); |
| 312 } | 317 } |
| 313 | 318 |
| 314 double ScriptProcessorHandler::LatencyTime() const { | 319 double ScriptProcessorHandler::LatencyTime() const { |
| 315 return std::numeric_limits<double>::infinity(); | 320 return std::numeric_limits<double>::infinity(); |
| 316 } | 321 } |
| 317 | 322 |
| 318 void ScriptProcessorHandler::SetChannelCount(unsigned long channel_count, | 323 void ScriptProcessorHandler::SetChannelCount(unsigned long channel_count, |
| 319 ExceptionState& exception_state) { | 324 ExceptionState& exception_state) { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 497 |
| 493 // If |onaudioprocess| event handler is defined, the node should not be | 498 // If |onaudioprocess| event handler is defined, the node should not be |
| 494 // GCed even if it is out of scope. | 499 // GCed even if it is out of scope. |
| 495 if (HasEventListeners(EventTypeNames::audioprocess)) | 500 if (HasEventListeners(EventTypeNames::audioprocess)) |
| 496 return true; | 501 return true; |
| 497 | 502 |
| 498 return false; | 503 return false; |
| 499 } | 504 } |
| 500 | 505 |
| 501 } // namespace blink | 506 } // namespace blink |
| OLD | NEW |